Git Product home page Git Product logo

Comments (5)

s-kuberski avatar s-kuberski commented on July 28, 2024

Also, when I fix this issue and provide a list of Obs, as suggested by the documentation, I get the error

Exception: Multi mode currently not supported for numerical derivative

This exception is not thrown, if I provide a plain Obs, but there is no way for the user to guess that. Also, if the function itself returns an array, even if it is 0-dimensional, the method fails.

from pyerrors.

s-kuberski avatar s-kuberski commented on July 28, 2024

In general, I think that one or two additional examples how to construct derived observables could make it easier for users. The minimal example with the lambda function in the description might not be sufficient for more complex applications.

from pyerrors.

fjosw avatar fjosw commented on July 28, 2024

One easy solution to circumvent this issue is to wrap the function in a lambda function:

pe.derived_observable(lambda x, **kwargs: np.exp(x), pe.cov_Obs(1, .1, 'test'), num_grad=True)

we could add this as another example to the documentation.
I haven't looked at the numerical derivative for quite some time, I think it is only used in tests as of now. We could of course think about exposing a better interface for numerical derivatives if you think that this is useful.

from pyerrors.

s-kuberski avatar s-kuberski commented on July 28, 2024

That is indeed a good solution! I have tested some cases where numerical derivatives, or at least a cross-check of explicitly provided man_grad derivatives would be useful. I don't know if someone should use this feature in production code, but it could help in cases where special functions enter in iterative procedures and analytical derivatives are not easily known.

from pyerrors.

fjosw avatar fjosw commented on July 28, 2024

I will close this issue for now. We can think about an improved interface for numerical derivatives at a later stage.

from pyerrors.

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.