-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hessian computation/Compatibility with dual numbers #570
Comments
Thanks, I was not aware of the Anyway seems it is not compatible with num_dual! Regarding hessians implementations, I would say we are always open to contributions. |
Sorry-I introduced a typo in the reproducer while I was trying to pare it down. Fixed now. |
I had to change the code of 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 |
That looks like it may well be a bug in |
Feature Request
Many of the surrogate models provided in the package are$C^2$ and hence their Hessians can in principle be computed. This would be an excellent feature to have; and indeed might be doable via dual numbers.
Of course, dual numbers do not require support on your part; I can simply call your API with them. However, my first attempts to extract Hessians in this way have failed:
Error message:
Can Hessians be supported directly?
The text was updated successfully, but these errors were encountered: