-
Notifications
You must be signed in to change notification settings - Fork 70
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
Convert State to Stateful Parameter #89
Comments
Apart from parameters nodes also have stateful parameters whose values are associated with a function and evolves with time as the graph is evaluated.
Initial work on this here: https://github.com/ModECI/MDF/tree/stateful_parameter Initial thoughts on implementing the translator:
|
A couple of comments (if there is a better mechanism for providing comments, please let me know):
a) There should be no specific requirement that a stateful parameter is associated with one or more functions, though its state will of course not change if it is not. The only implementational requirement for a stateful parameter (that is, that must be implemented by the execution environment) is that its value is maintained from one execution to the next.
b) The functions that take and return stateful parameters need not have time and dt as parameters, though if they take one, they should take the other, and should also be associated with a derivative (though we have not yet formalized how that will be; one possibility is that the expression for a derivative can be an attribute of a function, in which case the triad of: time argument, dt argument, derivative attribute should always go together).
…Sent from my iPad
On Jul 8, 2021, at 9:24 PM, Shanka Subhra Mondal ***@***.***> wrote:
Apart from parameters nodes also have stateful parameters whose values are associated with a function and evolves with time as the graph is evaluated.
.
A stateful parameter has the following components:
1. id
2. default initial value to start with
3. value updated by a MDF function that uses the previous value of the stateful parameter, time increment (dt)
Initial work on this here:
Initial thoughts on implementing the translator:
1. Input should be any json file with implementation of states.
2. Extract the parameters / arguments from the expression of time derivative, parameters field of the nodes.
3. Create a new MDF function using the expression of time derivative for each state, extracted arguments.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#89 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACSHKGEJ4ZFOCB6TYEY4QFLTWZFV5ANCNFSM5ABVUE7Q>.
|
Translator has been implemented and tested successfully. Translator converts files with state if it contains to file with stateful parameters, otherwise unchanged. The output file upon evaluation produces the same results.
file location: src/modeci_mdf/full_translator.py |
Translator code merged |
Overview
Bring in the concept of Stateful Parameters instead of State. The Node object will have Function and Parameter, and further Parameter is categorized as Stateful and fixed Parameter. Stateful Parameter stores the value and changes with time.
Step1: Create Stateful Parameter
Step2: Write the Translator
The text was updated successfully, but these errors were encountered: