Coder Social home page Coder Social logo

Comments (4)

relf avatar relf commented on September 1, 2024 1

Thanks, I was not aware of the num_dual library. I can not run the code above with the expected error. What is the type/value of query_points[0]?

Anyway seems it is not compatible with num_dual! Regarding hessians implementations, I would say we are always open to contributions.

from smt.

NAThompson avatar NAThompson commented on September 1, 2024

I can not run the code above with the expected error. What is the type/value of query_points[0]?

Sorry-I introduced a typo in the reproducer while I was trying to pare it down. Fixed now.

from smt.

relf avatar relf commented on September 1, 2024

I had to change the code of f to (try to) make it work (missing ] , try to use item() to get a "scalar"):

    def f(x):
        y = rmtb.predict_values(np.array([[0.0, 1.0]])).item()
        print(y, type(y))
        return y

When I run it:

> python test_num_dual.py
-3.949565971416e-06 <class 'float'>
Traceback (most recent call last):
  File "D:\rlafage\test_num_dual.py", line 52, in <module>
    out = num_dual.hessian(f, query_point)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument 'f' must return a scalar.

I do not understand this error and I do not get yours, anyway still not ready to use num_dual 😉

from smt.

NAThompson avatar NAThompson commented on September 1, 2024

That looks like it may well be a bug in num_dual . . . you've made a pretty compelling case that f returns a scalar . . .

from smt.

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.