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

Typing of scalar derivatives of state variables #11

Open
mlprt opened this issue Feb 17, 2024 · 1 comment
Open

Typing of scalar derivatives of state variables #11

mlprt opened this issue Feb 17, 2024 · 1 comment
Labels
invalid This doesn't seem right typing

Comments

@mlprt
Copy link
Owner

mlprt commented Feb 17, 2024

feedbax.dynamics.AbstractDynamicalSystem is a generic of StateT. Each subclass must define a vector field that returns the time derivatives of each array in a state PyTree.

def vector_field(
    self, 
    t: float, 
    state: StateT, 
    input: PyTree[Array],  
) -> StateT:
    """Returns the time derivatives of the system's states."""
    ...

The return type StateT is more or less correct: the return value will have the same PyTree structure as state, and -- because the time derivative is scalar -- the same array shapes as well.

This seems fine to me, but perhaps there is a better way to make it explicit when we are passing around derivatives.

@mlprt mlprt added the typing label Feb 17, 2024
@mlprt
Copy link
Owner Author

mlprt commented Jul 26, 2024

This will probably be obviated if we replace the staged model approach with a DAG approach (#28), so I'm tagging this issue as "invalid".

@mlprt mlprt added the invalid This doesn't seem right label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right typing
Projects
None yet
Development

No branches or pull requests

1 participant