y1xiaoc / fwdlap Goto Github PK
View Code? Open in Web Editor NEWForward mode laplacian implemented in JAX tracer
Home Page: https://github.com/y1xiaoc/fwdlap
License: Apache License 2.0
Forward mode laplacian implemented in JAX tracer
Home Page: https://github.com/y1xiaoc/fwdlap
License: Apache License 2.0
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?
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.