Mouse-GYM Training Protocols
A Mouse-GYM Training Protocol is a mechanism for incremental training through one or more phases of device configuration and system behavior. Progress within a protocol is tracked individually for each animal. Animals may have multiple protocol histories.
Training Protocols
A Training Protocol is the definition of the specific procedures and requirements to move through phases of training. It is defined once. The progress of individual animals with a protocol is tracked separately. A protocol consists of:
ida unique identifier for each protocol generated by the system (not guaranteed to be user-friendly)namea user-friendly name/identifierdescriptionmore detailed information than the name (optional)phasesa set of Training Phases (defined later) to progress through
Training Phases
A Training Phase defines the state of the system for given phase of training (which can be modified during the phase) and requirements for exiting the phase. One set of requirements represents the condition(s) to advance to the next phase if there is one. A second, optional set of requirements represent the condition(s) to fall back to the previous phase due to insufficient progress in some amount of time or any other supported metric.
At the end of every behavior trial, three steps are taken for the current phase:
- Any defined "trial actions" are called. These do not directly affect exiting the phase.
- An example could be moving the pellet arm after every trial where a pellet is consumed.
- A trial action could modify a property of the training progress that would affect the phase exit behavior to follow
- These actions, if present, are also called at the start of the phase
- If fall-back conditions are defined, they are evaluated and if the result is True, the system transitions to the previous phase
- If advance conditions are defined, they are evaluated and if the result is True, the system transitions to the next phase
Trial actions, fall-back conditions, and advance conditions are all optional.
The definition of what is a separate training phase vs. something that is modified during trial actions (e.g., changing pellet delivery location) is up to the Training Protocol writer.
A Training Phase definition consists of:
ida unique identifier for each phase generated by the system (not guaranteed to be user-friendly)namea user-friendly name/identifierdescriptionmore detailed information than the name (optional)fallback conditioncondition(s) for returning to the previous phaseadvance conditioncondition(s) for advancing to the next phasetrial actionspredefined actions or arbitrary Python code to execute after each trial
There are also default settings for most behavior algorithm settings, such as:
pellet delivery enabledpellet covering enabledbaseline magnet intensityreach distance to uncoverauto-clamp enabledauto-clamp release delayauto-clamp load count
These are set when the phase is entered. They may be changed by trial actions.
Training Predicates
Training Predicates define the conditions for exiting a phase, either to advance or fall back. There are built-in predicates for simple tests and a Python predicate that will evaluate user-defined Python code. Predicates include:
Number Comparisonwill test <, <=, ==, >=, or > for integer or floating point valuesString Comparisonwill test string valuesPythonwill execute user-defined python code (not fully implemented)Compoundcan be set to return True if all child predicates are True or set to return True if any child predicates are True (OR vs AND)
Compound predicates can be used to assemble any combination of any or all conditions at any depth.
Predicates have access to all public behavior algorithm, tunnel device, and pellet device public properties, as well as
all properties tracked as progress for the animal such as pellets consumed. Properties at any depth in these objects
can be reached via property paths delimited by periods such as progress.pellets_consumed.
Training Actions
Training Actions are performed each time a trial completes. They can be used to make adjustments during a phase that do not constitute moving a new phase.
Similar to predicates, there are predefined actions that do not require user-defined Python code to execute. If none of the predefined actions provide the required functionality, user-defined Python code can be used. These include:
HeadMagnetIntensityAction- defines a range of values (start, increment, end) of head magnet intensity values to progress through based on the specified number of pellets successfully consumed for each stepReachDistanceBasicAction- defines a range of values (start, increment, end) of pellet-y offset values to progress through based on the specified number of pellets successfully consumed for each stepPython- will execute user-defined python code (not fully implemented)
Training actions may also contribute to determining whether a phase is complete. In addition to checking predicates, if
an action is marked as has_progress, its is_complete property will be evaluated after each trial.
Training Progress
Training Progress is the per-animal tracking of progress through the protocol and each phase. This is primarily used to evaluate exit conditions. Values include:
- Amount of time since the phase was first entered (calendar time, i.e., Sept. 12, even if the system was not running the entire time)
- Active time in phase - the amount of time actually spend with the phase active and system running
- Pellets presented
- Pellets consumed
- Successful reaches
- Starting pellet delivery location for this phase
- Current pellet delivery location (might be different if modified by actions)
This a partial list and the list will grow as more metrics are required for assessing progress or reporting.
There is also a generic dictionary available for Python trial actions and predicates to read and write any JSON serializable value.
Notes for Code Development
- The user-facing Training Protocol entity is represented in the class
TrainingPlandue to specific use ofProtocolin Python.
Metadata
Release files for auto-trainer-training 0.10.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| auto_trainer_training-0.10.1.tar.gz | 120.1 kB | With provenance | Details for auto_trainer_training-0.10.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| auto_trainer_training-0.10.1-py3-none-any.whl | Python 3 | none | any | Details for auto_trainer_training-0.10.1-py3-none-any.whl |
Total release size: 174.9 kB
Release files / auto_trainer_training-0.10.1.tar.gz
| Download URL | auto_trainer_training-0.10.1.tar.gz |
|---|---|
| Size | 120.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b05dec9c231c44d944afa6b8871a75403cfa20c33f831da5abf37a1ddc24f37
|
|
BLAKE2b-256 checksum How to use checksums |
1fae7bea97df7e4e88879a64228198a11a1e9eb6ef859df6f57d56051bfd72eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / auto_trainer_training-0.10.1-py3-none-any.whl
| Download URL | auto_trainer_training-0.10.1-py3-none-any.whl |
|---|---|
| Size | 54.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aad25052ef65c823faa2109286b24f3573380ffac2c240271adb57a64090cfd4
|
|
BLAKE2b-256 checksum How to use checksums |
c46aa5c4d1272d026a256961b3042ec86d8c99a63900df644c375278164e5950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logSecurity for auto-trainer-training 0.10.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for auto_trainer_training-0.10.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.