Skip to content

Conversation

@ba2tripleO
Copy link
Contributor

No description provided.

@ChrisRackauckas ChrisRackauckas requested a review from avik-pal July 12, 2022 00:41
@ChrisRackauckas
Copy link
Member

What's the status of this?

@ba2tripleO
Copy link
Contributor Author

ba2tripleO commented Oct 23, 2022

NeuralDSDE and NeuralSDE with Lux work now using EM or LambaEM with BacksolveAdjoint. But the AD vjp s are throwing some errors. It works only with numerical vjp right now. I think we'll need some changes to SciMLSensitivity to make vjp compatible?

@ChrisRackauckas
Copy link
Member

How is it erroring? Use EulerHeun so it's in Stratanovich form: that's simpler for training.

ba2tripleO added a commit to ba2tripleO/StochasticDiffEq.jl that referenced this pull request Dec 11, 2022
While using `EulerHeun` with `BacksolveAdjoint` there's this mul! issues due to W.dW being a matrix. Doing `vec()` fixes it. Downstream: SciML/DiffEqFlux.jl#750 (comment)
@ba2tripleO ba2tripleO marked this pull request as ready for review January 4, 2023 11:28
@ChrisRackauckas
Copy link
Member

@avik-pal
Copy link
Member

avik-pal commented Jan 6, 2023

I had never stored parameters in the layers so never tested @functor. The fallback definition there is to allow recursively traverse container layers.

For Flux compat, I think we should directly define the Optimisers.trainable though that will not allow Flux.gpu to work as expected.

@ChrisRackauckas
Copy link
Member

But it seems it shouldn't dispatch on the second argument if it's going to work with @functor?

@avik-pal
Copy link
Member

avik-pal commented Jan 6, 2023

LuxDL/Lux.jl#229 should fix it. I will tag a release once the CI passes

@ChrisRackauckas
Copy link
Member

@Abhishek-1Bhatt https://github.com/SciML/DiffEqFlux.jl/actions/runs/3855851152/jobs/6581195485 this failure looks real, but looks like it just needs a functor overload.

@ba2tripleO
Copy link
Contributor Author

The error message, seems to be referring to model as in NeuralDELayer <: Lux.AbstractExplicitContainerLayer{(:model,)} as HamiltonianNeuralDE is also subtyped to NeuralDELayer here , maybe doing something like this could help?

@ChrisRackauckas
Copy link
Member

yes the naming seems wrong, so it either needs to rename to just model or have another abstract type. I would recommend just naming it model like the others, I think that might make the structure simpler.

@ChrisRackauckas ChrisRackauckas merged commit c30246e into SciML:master Jan 11, 2023
@ba2tripleO ba2tripleO deleted the lux branch January 20, 2023 10:48
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

Successfully merging this pull request may close these issues.

3 participants