Skip to content
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

Passing batch of initial states / batch of inputs. #88

Open
rejuvyesh opened this issue Nov 3, 2021 · 3 comments
Open

Passing batch of initial states / batch of inputs. #88

rejuvyesh opened this issue Nov 3, 2021 · 3 comments

Comments

@rejuvyesh
Copy link

The underlying OrdinaryDiffEq.jl package supports solving from a batch of initial conditions. It's very likely I am misunderstanding something but in principle it should be possible to support the same even here. Would love to know if there is a particular reason that the dynamics and readout functions have their type signatures restricted to AbstractVector.

@slibkind
Copy link
Collaborator

slibkind commented Nov 4, 2021

One of the reasons that dynamics and readout have their type signatures restricted is that in order to compute the composite dynamics (e.g. the dynamics of two machines wired together), we have to assume the form of the input. However, it seems possible to change the induced_dynamics and induced_readout methods to support other types of input. Do you have an example of the kind of thing you're interested in?

@rejuvyesh
Copy link
Author

Simplest example would be modifying the Cyber-Physical example as: https://gist.github.com/rejuvyesh/537924449c334656ac367b0cdc02e660. Essentially I have tried modifying the functions L, C, D that correspond to their respective boxes to support a batch dimension.

@slibkind
Copy link
Collaborator

slibkind commented Nov 6, 2021

Neat! Thanks for sharing. PR #89 adds the functionality for evaluating the dynamics of a system with batch initial conditions and inputs, although so far only for systems composed using directed wiring diagrams (which is the case in the Cyber-Physical example). Here is an example in the test file.

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

No branches or pull requests

2 participants