Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use ODEBlock for convlayers with different channels? #5

Open
saysth opened this issue May 14, 2021 · 3 comments
Open

How can I use ODEBlock for convlayers with different channels? #5

saysth opened this issue May 14, 2021 · 3 comments

Comments

@saysth
Copy link

saysth commented May 14, 2021

like this:
ODEBlock(
'''
conv2d(in_ch, mid_ch)
'''
conv2d(mid_ch, out_ch)
'''
)

I've noticed that in_ch, mid_ch, out_ch should be the same so that ODEBlock would work correctly.
but how to deal with the condition that they're not the same?

@juntang-zhuang
Copy link
Owner

The ODE is dz(t)/dt = f(z(t),t), it requires f(z(t),t) has the same shape as z(t) in order to be a valid ODE. Within f, you can put whatever function, as long as f(z(t),t) has the same shape as z(t), otherwise it's not ODE. For this example, it requires in_ch = out_ch, mid_ch does not matter

@saysth
Copy link
Author

saysth commented Jun 4, 2021

@juntang-zhuang Thanks! Another question, can I use more than two convlayers in one ODEBlock? Does this operation affect the performance(better or worse)?

@juntang-zhuang
Copy link
Owner

Just for the code to run does not limit the form of $f$, you can put as many layers or complicated structures, the only requirement is f(z,t) has the same shape as z. Speaking of empirical performance, it's hard to say, varies from problem to problem, the same thing happens with discrete-layer networks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants