Giter Club home page Giter Club logo

Comments (1)

TomGeorge1234 avatar TomGeorge1234 commented on August 21, 2024

To clarify for @mehulrastogi:

  • Head direction should be a variable called Agent.head_direction.

  • It should be saved to the history dictionary each timestep, just like Ag.pos and Ag.velocity

  • Inside the Agent params dictionary there should be a new param called head_direction_smoothing_timescale : float (in the equation below this is $\tau$). This defaults to $0.0$.

  • Update the doc string to clarify what this param does

  • Within Agent.update() there should be a call to a function called self.update_head_direction(dt)

  • The update rule should be as follows (where $\hat{v}$ is the normalised velocity vector):
    $$hd = (1 - \frac{dt}{\tau}) \cdot hd + \frac{dt}{\tau} \hat{v}$$
    then normalise it
    $$hd = \frac{hd}{|hd|}$$
    Note: you'll need a catch for if $\tau==0$ when the update should just be $hd = \hat{v}$ or else you'll get divide by zero error. Even better would be an additional warning if $\tau$ is non-zero but smaller than $dt$ as this is when the equation breaks down. This warning should strongly advise then to increase $\tau$ or decrease $dt$ to avoid numerical problems but otherwise probably let them go ahead.

  • This change should then reflected in the following Neurons classes which use head direction:

  • ObjectVectorCells
  • BoundaryVectorCells
  • HeadDirectionCells
  • It would be nice to keep support for 1D too even though here head direction is trivial, just a 1D array either [1.0] (forward) or [-1.0] (backwards).

Thanks! Let me know if you run into any troubles

from ratinabox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.