Git Product home page Git Product logo

Comments (2)

Patryk27 avatar Patryk27 commented on August 26, 2024

Hi!

In this model you can imagine birds as vehicles with two motors - kinda like:

image

... where r0 determines the speed of the "left motor" and r1 determines speed of the "right motor", making:

  • rotation = r0 - r1, since you just rotate away from whichever side is moving faster,
  • speed = r0 + r1; although - now that I look at it - this one is probably kinda wrong (should be (r0 + r1) / 2?), because if we imagine both r0 and r1 going at 10 units per second, then in reality the entire bird would be moving at 10 units per second as well; fortunately, it shouldn't affect the computations much either way 😇

As for "but why" - if I recall correctly, modeling it this way has gotten me a bit better results (i.e. better-flying, faster-learning birds) than the simpler approach where you'd just extract speed & rotation directly from the network, like so:

crate fn propagate(&self, vision: Vec<f32>) -> (f32, f32) {
    let response = self.nn.propagate(vision);

    let speed = response[0].clamp(0.0, 1.0) - 0.5;
    let rotation = response[1].clamp(0.0, 1.0) - 0.5;

    (speed, rotation)
}

Lemme know if it makes sense now! 🙂

from shorelark.

Patryk27 avatar Patryk27 commented on August 26, 2024

Hi, to keep the issue tracker tidy, I'm going to close this issue - if you have any more questions, feel free to ask them here 🙂

from shorelark.

Related Issues (11)

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.