Code for training neural network controllers to emulate posture and reach tasks.
- PyTorch deep learning library
- Numpy
- Scipy
- Matplotlib
Each folder has three python scripts.
- muscularArmClass.py contains dynamics of 2-DOF planar arm containing shoulder and elbow joints and muscle activation dynamics.
- NetworkClass.py contains script for neural network and cost computation for the executed movements.
- optimizingscript.py runs the posture/reach tasks and optimizes/trains neural networks to learn an optimal control policy.
- Go to posture/reach folder
- Open and execute script titled "optimizingscript_xxtask.py" where xx = reach for reach task and xx = posture for posture task
- Data is saved as .mat files in the folders named "data"
The code is a part of research article titled "Rotational dynamics in motor cortex are consistent with a feedback controller" in eLife (DOI: 10.7554/eLife.67256).
eLife 2021;10:e67256