motornet.utils#

Module contents#

This package contains various functions and scripts that can be useful to the general user for building, training, and analysing models from MotorNet.

class motornet_tf.utils.Alias(source_name: str, alias_name: str)#

Bases: object

Object to create a transparent alias for attributes. Modified from a solution proposed here: https://adamj.eu/tech/2021/10/13/how-to-create-a-transparent-attribute-alias-in-python/

Parameters:
  • source_nameString, the name of the attribute being aliased.

  • alias_nameString, the desired alias for the attribute.

motornet.utils.parallelizer#

This python script allows training MotorNet models in parallel on the CPU. This is particularly useful for CPUs with a large amount of cores, and should significantly improve training speed over many model iterations.

This script should be called from a terminal console, and takes up to four parameter inputs.

param 1:

String, directory to use. The declared directory should contain the model configurations saved as a JSON file. See motornet.nets.models.DistalTeacher.save_model() for more information on how to produce a model configuration file.

param 2:

String, whether run this script in train or test mode.

param 3:

Run mode to be passed to task object. The type and content of this input will likely depend on the task object being used.

param 4:

Integer, total number of training iterations.

raises ValueError:

If the first input’s directory does not contain a model’s JSON configuration file.

raises ValueError:

If the second input is not a train or test string.

motornet.utils.plotor#