Adding online learning to lds model #10
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds online learning capabilities to the existing linear dynamical systems model for kinematics.
Changes to main.py
Several modifications were made to the main.py code. The
KalmanFilterKinematics
class now contains several new attributes and functions. Critically, theoptimize
function calls thelds.learning.scipy_optimize_SS_tracking_diagV0
function from the lds package to perform optimisation of the selected parameters. Therun_optimization
function batches the observations and calls the optimize function. Therun_optimization_async
function performs the same way, except it creates a separate thread to run optimization and sets a callback function calledon_completion
to report back when optimization has finished. There are additional functions to check when optimization is finished and to reset the optimization loop.Include workflows added
Two additional
IncludeWorkflows
were added. TheRunOptimizationAsync
workflow allows the model to perform asynchronous optimization of selected model parameters given mini batches of data. The workflow will produce a single output once the optimization procedure has started. Therefore, to check when the optimization has finished, theCheckOptimizationFinished
workflow tests on every input whether the model is currently performing optimization and emits a value when the optimization procedure has completed.