Coder Social home page Coder Social logo

Use of numerical gradient about roptim HOT 5 CLOSED

ypan1988 avatar ypan1988 commented on August 16, 2024
Use of numerical gradient

from roptim.

Comments (5)

ypan1988 avatar ypan1988 commented on August 16, 2024

from roptim.

teng-gao avatar teng-gao commented on August 16, 2024

Hi Yi,

Thanks for the reply. To be more precise, I'm trying to replicate the behavior of the below code in R, where L-BFGS-B is used, but no gradient function is provided.

optim(
    start, 
    function(x) {f(x)},
    method = 'L-BFGS-B',
    lower = lower,
    upper = upper,
    hessian = TRUE
)

Thanks,
Teng

from roptim.

ypan1988 avatar ypan1988 commented on August 16, 2024

Yes, it is possible and please check the following paper:
https://cran.r-project.org/web/packages/roptim/vignettes/article.pdf

Yi

from roptim.

teng-gao avatar teng-gao commented on August 16, 2024

Got it - this is super useful for our work! I'm trying to parallelize many individual optim calls using RcppParallel. Do you think Roptim would be thread-safe enough to do so?

from roptim.

ypan1988 avatar ypan1988 commented on August 16, 2024

Sorry, I am not very sure about this. But my understanding is that if you are calling optim in parallel, that means you are calling the underlying C functions of optim in parallel. Roptim is simply a wrapper of the C functions to make it easier to write code in C++, so maybe create a separate Roptim object for each thread?! Do consult someone with more experience with parallel programming.

from roptim.

Related Issues (8)

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.