Comments (12)
Hi, we have a full tutorial notebook showing you how to implement and solve second-order (and even higher, such as tenth-order) Neural ODEs. Check that out then let us know if you have further, more specific questions :)
from torchdyn.
Hi, Thank you for your reply. I checked the tutorial but the ODE function wasn't defined in any function. How do we solve the differential equation without defining?
Kindly let me know. Thank you.
from torchdyn.
Hi,
In the first example of the tutorial (the 2nd order model), we define the ODE by specifying the neural network f
representing its vector field
f = nn.Sequential(nn.Linear(4, 64), nn.Tanh(), nn.Linear(64, 2))
and subsequently passing it to the NeuralDE
class, effectively defining the ODE.
model = NeuralDE(f, order=2, solver='dopri5', sensitivity='adjoint')
from torchdyn.
Hi, I understand that the NN is defined and passed as argument to the class NeuralDE and solving used ode solver. If I am not wrong, it seems more like solving neural network with ODE solver, rather than solving differential equation with neural network. Isn't it correct? Because, I could not see the step where the ODE is defined and the neural network being trained to solve it.
Kindly advise. Thank you
from torchdyn.
To add on what @massastrello said, if you wish to specify an ODE that does not involve neural networks, (or does, but only partially) you can do so by building a custom nn.Module
.
You're correct in stating that the standard Neural ODEs framework does not involve solving ODEs with neural networks. The ODE is solved with standard solvers, and the neural network simply parametrizes the vector field and is trained to perform different tasks.
For more on using neural networks to enhance ODE solvers you might be interested in our recent work on Hypersolvers: paper, repo
from torchdyn.
Hi, Kindly excuse me if I am not asking right questions because I have absolutely no idea of how to use neural networks to solve ODE's. My ODE equation is d2x/dt2=(-2xmbmdx/dt)-(km^2x)+Gmkm(Pm+C*(2theta1)/1+np.exp(theta2(theta3-x))), with boundary conditions f(0)=0.3, f(1)=0.3. And I was thinking of using torchdyn to solve it. Does torchdyn allow to define ODE and solve it by minimizing cost function or some other way? Thank you.
from torchdyn.
What you're describing is a boundary value problem (BVP), which torchdyn
(or any Neural ODE suite in Python) does not currently support. In the hypersolver implementation above we also consider IVPs only.
from torchdyn.
Hi, Okay. Doesn't torchdiffeq support solving differential equations by minimizing the cost function through neural networks? I am not clear if I have presented my problem correctly.
Thank you.
from torchdyn.
torchdiffeq
solves ODEs (vector field parametrized by neural networks) with classical numerical schemes, in order to perform tasks such as image classification. It does not train neural networks to solve ODEs via cost function minimization :)
from torchdyn.
Hi. Okay. I didn't know that. But, a general question. Let's say, you are solving ODE's (I don't know what's vector parametrized means?) through torchdyn. How is it possible to define a neural network and solve it by using solver without any equation? I am failing to see the equation here, since ODE's means differential equation. Numerically or analytically, when we solve, we define and implement solvers to solve them. But here, there is no equation being defined and the neural network is being solved through solvers, which I find slightly confusing. After getting results, how do you validate your result? Do you compare with numerical simulation or analytical simulation to check if the result is correct?
from torchdyn.
The ODE here is defined as the forward pass of the neural network passed to NeuralDE
. In the simplest form (fully connected neural network) it's a series of nonlinear matrix multiplications interleaved with element-wise nonlinearities. This is what the solver is solving as the ODE.
from torchdyn.
Closing the Issue
for the moment.
from torchdyn.
Related Issues (20)
- Does the odeint method support complex tensors?
- Sklearn dependency push to pypi HOT 4
- Can we use Neural ODE Block with a normal neural network block? HOT 3
- ModuleNotFoundError: No module named 'torchdyn' for torchdyn==1.0.4 on pypi HOT 2
- Hypersolvers missing `args` kwarg
- Multiple shooting solvers missing coarse/fine solver attributes
- 1.0.4 torchdyn not found HOT 11
- Example of controlled dynamical system? HOT 2
- Is there any example of 3D input tensors?
- Module not found error for 'import torchdyn' HOT 4
- Argument mismatch and hard-coded `return_all_eval`
- Parallel integration routines with different t_spans ?
- PyTorch Version Compatibility HOT 1
- Model require `forward` to have `*args, **kwargs` in 1.0.6 HOT 2
- AttributeError: 'NeuralODE' object has no attribute 'defun
- __init__() got an unexpected keyword argument 'func' HOT 2
- shape of gradient does not match the parameter shape in vector field while using adjoint method
- How should i set the seminorm option like it is in the torchdiffeq?
- Boring default setting: will uninstall the installed torch which makes trouble.
- How to do backpropagation with multiple shooting?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torchdyn.