SciML / DiffEqFlux.jl

Pre-built implicit layer architectures with O(1) backprop, GPUs, and stiff+non-stiff DE solvers, demonstrating scientific machine learning (SciML) and physics-informed machine learning methods
https://docs.sciml.ai/DiffEqFlux/stable
MIT License
871 stars 157 forks source link

Including parameters in NeuralODE #798

Closed MaAl13 closed 12 months ago

MaAl13 commented 1 year ago

Hello,

is there a way to incorporate parameters in the NeuralODE? I want to use the NeuralODE as a surrogate model, that gives me the trajectory of problem at specific time points, depending on the parameters. I have a few thousand trajectories of the forward problem given at time points, for specific parameters, to train the NeuralODE. Would be happy if someone could help me out!

ChrisRackauckas commented 1 year ago

Just append them to the vector? There's nothing extra to do here other than choose an architecture which makes sense. For example, instead of defining the neural ODE as f(u,p,t) = NN(u), you can just do f(u,p,t) = NN([u;p]), so then the parameters of the ODE are p = [model_parameters ; neuralnet_weights]

ChrisRackauckas commented 12 months ago

Handled by the ComponentArray and tutorials in SciMLSensitivity.