Releases: RatInABox-Lab/RatInABox
v1.9.3
v1.9.2
v1.9.1
Minor big fix for VectorCells
v1.9.0
Two main changes:
- Refactoring of
VectorCells
(BVCs and OVCs) andFieldOfViewNeurons
have been moved from contribs to main fileNeurons.py
. See #71 - New
NeuralNetworkNeurons
class in contribs. These (exciting) new neurons map inputs through a user-provided PyTorch NN to the outputs. Can be used to make awesomely complex/trainable cell classes powered by RatInABox. It's mostly there but will stay as a contrib for now until its mature enough to go in main.
v1.8.0
Bug fixes and implementation of independent head_direction
variable for the Agent
class which (by default) is a smoothed version of the velocity vector. The head direction is what is used by HeadDirectionCells
and BoundaryVectorCells
(egocentric) etc. to determine firing rate and smoothing can aid stability of processes which rely heavily on these classes.
What's Changed
- Doc file fix by @SynapticSage in #51
- Possible fix for issue #52 by @SynapticSage in #53
- New RewardCache setting, Verbosity changes, Test functions/scripts by @SynapticSage in #59
- env changes, add_hole etc. by @TomGeorge1234 in #61
- Merge pull request #61 from TomGeorge1234/dev by @TomGeorge1234 in #62
- Moved OVC initialization steps to methods by @colleenjg in #65
- Update FieldOfViewNeurons.py by @Alxec in #67
- TaskEnvironment: option to delay episode terminate by @SynapticSage in #68
- flexible head direction by @mehulrastogi in #72
- fix goal_cache attribute and replenish typos by @kushaangupta in #74
New Contributors
- @Alxec made their first contribution in #67
- @kushaangupta made their first contribution in #74
Full Changelog: v1.7.0...v1.8.0
v1.7.0
Wrapper: RatInABox now supports OpenAI's gymnasium
API
A new wrapper contributed by @SynapticSage allows RatInABox
to natively support OpenAI's gymnasium
API for standardised and multiagent reinforment learning. This can be used to flexibly integrate RatInABox
with other RL libraries such as Stable-Baselines3 etc. and to build non-trivial tasks with objectives and time dependent rewards. Check it out here.
Overhaul of GridCell structure
How GridCells
are initialised has been restructured. This is mostly backwards compatible and is explained in the GridCell docstring.
To initialise grid cells you specify three things: (i) params['gridscale'], (ii) params['orientation'] and (iii) params['phase_offset']. These are all sampled from a distribution (specified as, e.g. params['phase_offset_distribution']) and then used to calculate the firing rate of each grid cell. For each of these there quantities the value you specify parameterises the distribution from which it is sampled. For example params['gridscale':0.45,'gridscale_distribution':'uniform'] will pull gridscales from a uniform distribution between 0 and 0.45m. The 'delta' distribution means a constant will be taken. For all three of these you can optionally just pass an array of length GridCells.n (in which case the corresponding distribution parameter is ignored). This array is set a the value for each grid cell.
Other minor changes
- Changes to how BVCs are initialised (similar to grid cells)
What's Changed
- Distance tuning by @jquinnlee in #47
- TaskEnvironment by @SynapticSage in #49
- TaskEnvironments: flexible observation space and action_space bug by @SynapticSage in #50
New Contributors
- @jquinnlee made their first contribution in #47
- @musicinmybrain made their first contribution in #48
- @SynapticSage made their first contribution in #49
Full Changelog: v1.6.3...v1.7.0
v1.6.3
v1.6.3
-
Minor bug fixes to how figures are made. Some global params (
MOUNTAIN_PLOT_WIDTH_MM
,MOUNTAIN_PLOT_SHIFT_MM
etc.) were created to help make figures more uniform across the package. -
A new function was created to help make the process of extracting saved data between any two timestamps a bit easier. Figure plotting has been updated to use this function.
Agent.get_history_slice(t_start, t_end, framerate)
""" "
Returns a python slice() object which can be used to get a slice of history lists between t_start and t_end with framerate. Use case:
>>> slice = get_history_slice(0,10*60,20)
>>> t = self.history['t'][slice]
>>> pos = self.history['pos'][slice]
t and pos are now lists of times and positions between t_start=0 and t_end=10*60 at 20 frames per second
Args:
• t_start: start time in seconds (default = self.history['t'][0])
• t_end: end time in seconds (default = self.history["t"][-1])
• framerate: frames per second (default = None --> step=0 so, just whatever the data frequency (1/Ag.dt) is)
"""
- Some minor QOL improvement and bug fixes (again, mostly to figure plotting stuff).
Note tiny 1 line bug fix over 1.6.2
Thats about it
v1.6.0
v1.6.0
Official new features
SuccessorFeatures()
: NewNeurons
subclass for SRs and accompanyingsuccessor_features_example.ipynb
demo script.
- Ability to visualise multiple
Agents
withAg.plot_trajectory(plot_all_agents=True)
PlaceCells.remap()
reinitialises place cell locations- Minor bug fixes
What's Changed
- Successor features branch by @TomGeorge1234 in #41
Full Changelog: V1.5.1...v1.6.0
1.5.1
1.5.1
Parameter checking
New feature created by @colleenjg which checks parameters passed by the user in the params
dict. It works as follows:
If I initialise, for example, some GridCells
(a subclass of Neurons
) then at the point of initialisation of the parent Neurons
class a check is performed: starting from the child class (GridCells
) and working upwards to the top-level parent (Neurons
) a dictionary of all valid default params -- the super set of GridCells.default_params
and Neurons.default_params
-- is established. Then, if any of the passed default params is not present in this set a warning is thrown. Example
GCs = GridCells(Ag,{"gridscalee":0.1}) # note typo: "gridscale" --> "gridscalee"
returns:
UserWarning: Found 1 unexpected params key(s) while initializing Environment object: 'boundary_conditcions'.
If you intended to set this parameter, ignore this message. To see all default parameters for this class call Environment.get_all_default_params().
It this parameter is a new intended by the user then they can ignore the warning. If not it will help prevent silent errors where parameters were incorrectly defined.
In order for this to work default_params
now live as a class attribute and are defined in the preamble before __init__()
Users can query the default params of any class, including those inherited from their parents, by runnings:
GridCells.get_all_default_params()
v1.4.1
Just minor changes to plotting stuff e.g. utils.save_figure()
now usefully prints where a figure/animation is saved any time it does so.