Code Monkey home page Code Monkey logo

Comments (6)

AlexanderFabisch avatar AlexanderFabisch commented on July 30, 2024

the K (or alpha_y*beta_y) term is missing from the code as specified by equation 6 in Learning and Generalization of Motor Skills by Learning from Demonstration, is there a reason for this?

Where exactly is it missing? For the forcing term? That doesn't make a big difference. It is just a constant scaling factor for the weights of the forcing term. If you are interested, you can play around with it and look at this example script: https://github.com/dfki-ric/movement_primitives/blob/main/examples/plot_dmp_scaling.py

(Relevant PR: #33)

from movement_primitives.

jqloh avatar jqloh commented on July 30, 2024

Hi Alex, thanks for the reply

Yes, I meant the forcing term. According to Learning and Generalization of Motor Skills by Learning from Demonstration Equation 6, the equation for acceleration and the forcing terms (during imitation) is as such
image

However, in the _dmp.py file, I believe _dmp_acc function and the determine forces function seems to have missed considering the K constant from the equation.

I've tried to follow the paper and did some modifications to the _dmp.py file as shown below to include the K term from the forces

determine_forces
image
_dmp_acc
image

However, when I ran the modification, I got this plot
image

was wondering if you could take a look at it

from movement_primitives.

AlexanderFabisch avatar AlexanderFabisch commented on July 30, 2024

If you got a matching pair of step function and "determine forces" function, it should work. Are you sure that indentation is correct?

But as I said before, it does not make a difference whether you scale by K or not. This will only change the scale of the weights in the end. The behavior should be exactly the same.

from movement_primitives.

jqloh avatar jqloh commented on July 30, 2024

I've doubled checked the step function and determine forces function several times, however, it still gave me the exact results. Are there any locations that I'm missing other than the _dmp_acc function used by the step function and the "determine forces" function?

I plan to employ this library for my PhD hence why I'm trying to map what I'm reading from this godsent library with the literature.

from movement_primitives.

AlexanderFabisch avatar AlexanderFabisch commented on July 30, 2024

The default DMP has four implementations of the step function: Python, Cython, Euler integration, RK4 integration and combinations of these. RK4 integration in Cython is used by default. If you changed the Python function, make sure that it is also used, e.g. with

_, Y_dmp = dmp.open_loop(step_function="rk4")

If you changed the Cython version, you also have to recompile it.

But you should definitely check which function is used.

from movement_primitives.

jqloh avatar jqloh commented on July 30, 2024

Ahh, it was indeed an issue with the Cython package, I did not change the dmp_fast.pyx, hence it was using the _dmp_acc from dmp_fast.pyx and the determine_forces from python, thus the weird results. It was working as required when I changed both Cython and Python.

Side note, when I reverted the smoothing_scaling == False case to the original equation (by including the (goal-start)*force ) set by Ijspeert, once I resolved the Cython and Python issue.

Thank you so much, and have a great day!

from movement_primitives.

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.