Git Product home page Git Product logo

Comments (4)

zoq avatar zoq commented on August 31, 2024

Hello, what you want to return is the f(x), so the function f at x, in the example above it's x but without the surrounding {}. You can find another example here - https://github.com/mlpack/ensmallen/blob/master/include/ensmallen_bits/problems/aug_lagrangian_test_functions_impl.hpp#L55-L64

Let me know if you like me to clarify anything further.

from ensmallen.

ZulunZhu avatar ZulunZhu commented on August 31, 2024

Thanks for your reply. I think I might have formulated the code well. But another question is, when the function is too complex, the gradient is almost can not be obtained. So I use the approximation function (f'(x) = (f(x+eps)-f(x))/eps). After the optimization, I found the gradient is not close to zero. It is really strange. Do you have other ideas to get the gradient easily?

from ensmallen.

zoq avatar zoq commented on August 31, 2024

If you have matlab or a similair toolbox you can use that to return the gradient -- https://www.mathworks.com/help/matlab/ref/gradient.html is just one example.

from ensmallen.

mlpack-bot avatar mlpack-bot commented on August 31, 2024

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍

from ensmallen.

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.