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 156 forks source link

Singular mass matrices not compatible with hardcoded adjoints #34

Closed rminhas closed 4 years ago

rminhas commented 5 years ago

I'm trying to use a DAE as a layer in a neural net. When the DAE is specified as an ODEProblem using an ODEFunction and mass_matrix, DiffEqFlux can solve the problem but it cannot be used in a neural net using diffeq_adjoint. On the Slack channel, @ChrisRackauckas mentioned that mass matrices are currently not compatible with diffeq_adjoint. I'm reporting this issue here so it can be tracked. Thanks.

ChrisRackauckas commented 5 years ago

Yup, thank you for the report. We are looking into how the adjoint can be extended to allow mass matrices. It doesn't seem to be that difficult, so I think we may have it sooner rather than later.

rminhas commented 5 years ago

Great - thanks.

rkurchin commented 5 years ago

Hi there @ChrisRackauckas, any update on this? I have a problem where I'd like to either have a DAE solve as part of the loss function, or as the last layer of the network (either would work for my application) – is there any way to do that right now?

Thanks for this package, it was the thing that finally pushed me to bite the bullet and learn Julia. :)

ChrisRackauckas commented 5 years ago

There's an implementation here https://github.com/JuliaDiffEq/DiffEqSensitivity.jl/pull/86 and it works with non-singular mass matrices, but I can't find out why it doesn't work for singular mass matrices.

ChrisRackauckas commented 4 years ago

Non-singular mass matrices are now supported, but singular mass matrices are coming next.

ChrisRackauckas commented 4 years ago

It's good now.