Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Exporting a trained neural network as an FMU #42

Closed
SriRama29 opened this issue May 21, 2024 · 1 comment
Closed

Exporting a trained neural network as an FMU #42

SriRama29 opened this issue May 21, 2024 · 1 comment
Assignees

Comments

@SriRama29
Copy link

SriRama29 commented May 21, 2024

Hi,
Let us assume I have the parameters of a neural network that I have trained using the neural ODE framework. Is it possible for me to use this package to export it as an FMU?

I have spent some time trying to understand the examples. I think the NeuralFMU example is more complicated than what I need. I think I might need to make my code from a mix of the bouncing ball example and the neural FMU example.

I have not yet figured out how I would load the parameters into the code and export it as an FMU. (Any advice is appreciated!)

But before I attempt to work further on it, I wanted to verify if I can even accomplish my requirement with the package 😄

Looking forward to your response!

@ThummeTo
Copy link
Owner

ThummeTo commented May 23, 2024

Hi,

short answer:
you can use this lib to export your neural ODE as FMU!

longer answer:
As proposed, I would start with the bouncing ball example. A neural ODE is nothing but a neural network that is interpreted as right-hand side of an ODE, that gets solved by a numerical ODE solver. So to export this as FMU, you just need to define your function f that maps state x to state derivative dx, this is just your NN inference. For the bouncing ball its the second order ODE for a mass that is accelerated by gravity (so the most simple system existing). The more advanced things for discontinuous systems (event indicators, condition and affect) you can skip for your (I think continuous) neural ODE. So to conclude, replacing the f and setting the remaining functions to neutral should do the trick.

Best regards!

Remark: We should make a tutorial for this, because this is not the first time I get ask this :-)

@ThummeTo ThummeTo self-assigned this May 23, 2024
Repository owner locked and limited conversation to collaborators May 23, 2024
@ThummeTo ThummeTo converted this issue into discussion #43 May 23, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants