Changelog#
Development releases#
Version 0.2.0#
2024, January 4th
First and foremost, this update moves motornet from tensorflow to pytorch. There has been systematic requests for
a pytorch implementation of this package, and over time it is becoming clear that this will enable better integration
with existing research efforts from the scientific community that this package is aiming to help. As a consequence,
many API changes and change in the code structure were made, as the logical structure of pytorch is fundamentally
different than that of tensorflow. These changes are further detailed below.
Renamed the
motornet.plantspackage toeffectorand themotornet.plants.Plantclass toEffector, as ‘plant’ is a specific engineering term and may be overly arcanic to a more general audience. Generally, the swap from “plant” to “effector” has been enacted consistently in the text and code.Taskobject essentially perform computations pertaining toenvironmentobjects in typical simulation software for machine learning. Therefore, themotornet.tasksmodule has been renamedmotornet.environmentand theTaskbase class has been renamed toEnvironment. This is also now a subclass of gymnasium‘s gymnasium.Env class, and it shares its API convention. The motivation behind these changes is thatgymnasiumis a popular interfacing package for simulation environments in machine learning, and standardizingmotornet‘s API according togymnasiumwill enable wider cross-compatibility, as well as facilitate familiarization efforts from a lot of researchers already accustomed togymnasium‘s API. Users are strongly encouraged to check the updated tutorial notebooks onmotornet‘s GitHub repository and on the online documentation website for more detailed explanation of the newEnvironmentAPI, if they are not alredy familiar withgymnasium. Generally, the swap from “task” to “environment” has been enacted consistently in the text and code.Pytorchdoes not require the creation of end-to-endmodelobjects astensorflowdoes. Consequently,motornetpipelines only require setting up anEffectorand wrapping it up in anEnvironmentobject, without having to create aNetworkobject at all. Feedback delays and Gaussian noise are now handled directly by theEnvironmentclass.Removed all sub-packages in
motornet. Thepytorchimplementation allows users to create their own loss and network objects the way they typically would for any project beyondmotornet, removing the need for a complex sub-packaging structure differentiating between set of modules falling under thenetsoreffectorscategory. Therefore,motornetnow only contains modules. For instance, themotornet.effector.muscle.Muscleclass is now directly accessible asmotornet.muscle.Muscle.The
motornet.plotor.plot_pos_over_time()function now takes cartesian position as argument rather than full cartesian states that include positions and velocities. In practice, the velocities were always discarded by that function so we removed this step to allow for a more transparent and intuitive function syntax.The
muscle_typeargument of themotornet.effector.Effectorclass has been renamed tomusclefor conciseness.The term
excitationis now replaced byactionto better match the terminology in place in continuous control machine learning. Note thatactionandactivationare not the same variables.Added a
motornet.effector.muscles.MujocoHillMuscleclass to themusclemodule. This object instantiates MuJoCo’s Hill-type muscle as described in the MuJoCo documentation.The
motornet.utils.parallelizer.pyfile has been removed, as the means of streamlining model training pipelines usually boils down to personal preference.Users can now seed their
EnvironmentandEffectorclasses. Seeding is an important aspect of reproducible programming, and is usually considered a “best practice”. Since theEnvironmentandEffectorclasses are the only classes that make use of a random generator, these are the only classes that currently require seeding inmotornet.All
motornetobjects now inherit from thetorch.nn.Moduleclass. Amongst other things, this allows easy device assignment for model parameters, usingpytorch‘s usual.to(device)method.Renamed the
muscles,skeletons,effectors, andenvironmentsmodules tomuscle,skeleton,effector, andenvironmentfor conciseness.
Version 0.1.5#
2023, February 19th
Fixed a typo for a parameter value in the
mn.plants.muscles.RigidTendonHillMuscleThelenclass, from 0.66 to 0.6. This parameter was epsilon_0^M in equation 3 of the main reference (Thelen, 2003).Random noise is now correctly applied to gated recurrent units in the
mn.nets.layers.GRUNetwork.forward_pass()method. Specifically, it is now applied before the non-linearity is applied rather than after.
Version 0.1.4#
2022, November 8th
Added an attribute alias object at
mn.utils.Aliasthat allows users declare transparent aliases to object attributes.Declared an alias
state_namesforoutput_namesin the mn.nets.Network base class.Fixed the first
state_nameofReluMuscleclass fromexcitation/activationtoactivation, as excitation and activation are actually distinct variables. See that class’ documentation for details.
Version 0.1.3#
2022, October 30th
Fixed a bug which would prevent some new custom models from compiling due to mismatched sequence duration.
Added a
ClippedPositionLoss, which penalizes positional error unless the radial distance to the desired position is less than a user-defined radius (target size) around said desired position (see documentation in themn.nets.lossesmodule for more details).The
plot_pos_over_timefunction in themn.utils.plotormodule can now take colormaps as a keyword argument (see documentation for details.)Removed a numpy.ndarray from
CenterOutReachattributes to allow for JSON serialization when saving models.Added a warning in
Taskbase class to inform users when their task contains a numpy.ndarray as attribute. This is to make them aware that it might raise an error when saving models due to numpy.ndarray not being JSON serializable.Fixed an error in
mn.plants.Plant.get_muscle_cfg()which occured when the method is called and theadd_musclemethod was not called before.
Version 0.1.2#
2022, July 31st
Some optional arguments, and associated attributes for
mn.plants.skeletons.TwoDofArmat initialization are now case-insensitive.Removed a typo that resulted in printing of some state shapes in
mn.plants.skeletons.TwoDofArm.path2cartesian()method.
Version 0.1.1#
2022, June 4th
Fixed
setup.pyto allow for solving thetensorflowdependency on M1-chip equipped Apple devices. Instead of asking fortensorflowas a requirement uponpip installcalls,motornetwill now ask for the M1-compatible version of TensorFlow on machines equipped with M1 chips, which is tensorflow-macos.
Version 0.1.0#
2022, June 3th
Initial release.