Giter Site home page Giter Site logo

fwdlap's People

Contributors

y1xiaoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fwdlap's Issues

API that takes only a function

Currently the lap function is somehow more like the jvp function, which takes not only the function, but also a list of primals, jacobians and laplacians.

One may expect the laplace transformation to take only a function and return a transformed function that shares the same input space of the original function. For example, like the jax.jacfwd.

Is there occasions that we want to manually specify primals, jacobians and laplacians? Or is it due to technical difficulty?

apply `lap` to vmap'ed function with custom jvp will fail

Currently lap support normal custom jvp calls, but they cannot be vmap'ed. For example, the following code would throw an error

with jax.softmax_custom_jvp(True):
    o0, o1, o2 = jax.jit(lap, static_argnums=0)(jax.vmap(jax.nn.softmax), (x[None],), 
                                                (jnp.eye(x.size)[:, None],), (jnp.zeros_like(x)[None],))

Instead, if possible, move vmap outside of lap should work.
Or, one may need to manually separate the function with custom jvp and do the forward rule for that function by hand.

This is because the current implementation handles custom_jvp calls in a very hacky way. To avoid an error from post_process_custom_jvp_call in ad.jvp, I have to remove the process_env_traces_fwd transformation in the wrapped custom jvp function. (Search unwrap in the code to see it.) I do not know how to fix this for now. Any advice or help is greatly appreciated!

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.