This repository has been archived by the owner. It is now read-only.
Wrap functions to return DiffResult's with the requested derivatives.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.codecov.yml
.gitignore
.travis.yml
LICENSE.md
README.md
REQUIRE
appveyor.yml
test-script.jl

README.md

Deprecation notice

IMPORTANT: this package is now abandoned, please use LogDensityProblems.jl instead.

DiffWrappers

Lifecycle Project Status: Unsupported – The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired. Build Status Coverage Status codecov.io

Wrap functions so that they return DiffResults with the requested derivatives. Copy values when necessary, so that structure is not shared between evaluations.

Example:

julia> using DiffWrappers

julia> using DiffResults

julia> f(x) = sum(x .* linspace(0, 1, length(x)));

julia> g = ForwardGradientWrapper(f, 4); # will use length 4 vectors

julia> length(g)
4

julia> x = ones(4);

julia> gx = g(x);

julia> DiffResults.value(gx)
2.0

julia> DiffResults.gradient(gx)
4-element Array{Float64,1}:
 0.0
 0.333333
 0.666667
 1.0