Comments (11)
#15 may help
the code in that version was
erf1 = lift1 erf $ \x -> (fromInteger1 2 /! sqrt1 pi1) *! exp1 (negate1 x *! x)
https://github.com/ekmett/ad/blob/master/src/Numeric/AD/Jacobian.hs
hass the class which is used to facilitate that
from ad.
point being i believe this answers your question, though please chime in if you want more examples or links / hit a new problem.
but closing for now :)
from ad.
Thanks! I have a nice minimal example working like this:
λ> import Numeric.AD
λ> import Numeric.AD.Jacobian
λ> import Numeric.AD.Internal.Forward
λ> (lift1 (\x -> x^2) (\x -> 2 * x)) (Forward 3 1)
Forward 9 6
However, the Jacobian module only seems to provide primitives for defining derivatives for scalar or two-argument functions. I'd like to define a custom gradient for a function f : R^n -> R
, for example something like
liftN (\[x, y, z] -> x * y * z) (\[x, y, z] -> [y * z, x * z, x * y])
Any thoughts on how I could do this? It doesn't seem efficient to try and hack this functionality in terms of lift1
.
from ad.
from ad.
@hypotext it is a gap, and its currently not quite possible to do gradients etc with "custom rules", which is a problem i think we'd both agree
from ad.
from ad.
ok, lets start with several sub questions
- what should/would this api look like?
- how should/would this interact with calculating higher derivatives etc?
what types would you expect/hope the interfaces to have?
from ad.
from ad.
ok, :)
from ad.
I'm honestly thinking about experimenting with writing a ghc core plugin to support better optimization for autodiff computations on ghc core level sometime this jan/feb
from ad.
Hi! May I ask about the status of this issue? I am in a similar situation as the author. Thank you!
from ad.
Related Issues (20)
- Build failure with GHC 9.6.1-alpha1
- Not building with GHC 9.6.1-alpha3 HOT 1
- `ReverseDouble` with `+ffi` produces different result for square root of product HOT 17
- Implement `fast-math` Version of `ReverseDouble` with `+ffi` HOT 4
- Avoid uses of `head` and `tail`
- Incorrect Results for Extra Floating Functions HOT 19
- Discrepancies Between Different Modes HOT 1
- Tape is only exported by Internal modules
- Fix test suite on `x86_64-darwin` HOT 1
- 5
- Nesting Benchmark HOT 1
- Test suite floating point accuracy failure when building with non-glibc-libc
- Jacobian fails when function is a parameter HOT 10
- Feasibility finder often loops on Newton constrainedDescent
- doctest failure with data-reify-0.6.2 (but not with data-reify-0.6.1) HOT 2
- docspec fails with GHC-7.4.2 HOT 2
- Performance of `Numeric.AD.Mode.Reverse.Double` HOT 2
- Discrepancy between `Reverse` and `ReverseDouble` when using flag `+ffi` HOT 4
- Difference between `auto` and `realToFrac` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ad.