Skip to content

Releases: RatInABox-Lab/RatInABox

v1.9.3

18 Sep 14:24
b545df6
Compare
Choose a tag to compare

Very minor change to resume compatibility with python >=3.7 (down from 3.10 in 1.9.2). See issue #79 and PR #81

v1.9.2

08 Sep 10:23
Compare
Choose a tag to compare

Python requirement bumped from >= 3.7 to >= 3.10. Comment on issue #79 if this causes problems to your workflow.

v1.9.1

08 Sep 06:57
ab1cb6b
Compare
Choose a tag to compare

Minor big fix for VectorCells

v1.9.0

21 Aug 20:58
Compare
Choose a tag to compare

Two main changes:

  1. Refactoring of VectorCells (BVCs and OVCs) and FieldOfViewNeurons have been moved from contribs to main file Neurons.py. See #71
  2. 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

15 Aug 10:55
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v1.7.0...v1.8.0

v1.7.0

06 Jun 19:33
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v1.6.3...v1.7.0

v1.6.3

04 May 11:18
Compare
Choose a tag to compare

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

24 Apr 17:11
defaa00
Compare
Choose a tag to compare

v1.6.0

Official new features

  • SuccessorFeatures(): New Neurons subclass for SRs and accompanying successor_features_example.ipynb demo script.
    SF_development
  • Ability to visualise multiple Agents with Ag.plot_trajectory(plot_all_agents=True)
    multi_agents
  • PlaceCells.remap() reinitialises place cell locations
  • Minor bug fixes

What's Changed

1.5.1

21 Apr 16:39
Compare
Choose a tag to compare

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

11 Apr 17:44
Compare
Choose a tag to compare

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.