Giter VIP home page Giter VIP logo

juliadecisionfocusedlearning / differentiableexpectations.jl Goto Github PK

View Code? Open in Web Editor NEW
12.0 0.0 0.0 189 KB

A Julia package for differentiating through expectations with Monte-Carlo estimates

Home Page: https://juliadecisionfocusedlearning.github.io/DifferentiableExpectations.jl/

License: MIT License

Julia 100.00%
autodiff expectation julia reinforce reparametrization automatic-differentiation monte-carlo

differentiableexpectations.jl's Introduction

DifferentiableExpectations.jl

Stable Dev Build Status Coverage Code Style: Blue

A Julia package for differentiating through expectations with Monte-Carlo estimates.

It allows the computation of approximate derivatives for functions of the form

$$F(\theta) = \mathbb{E}_{p(\theta)}[f(X)]$$

The following estimators are implemented:

Warning: this package is experimental, use at your own risk and expect frequent breaking releases.

differentiableexpectations.jl's People

Contributors

batyleo avatar dependabot[bot] avatar gdalle avatar github-actions[bot] avatar

Stargazers

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

differentiableexpectations.jl's Issues

Optional fixed seed

Add the option to fix the sampling seed such that the Monte-Carlo expectation always gives the same result.

Pushforward

Why was it needed in the first place? Given a differentiable probability distribution constructor $\theta \mapsto p(\theta)$, differentiate through $\theta \mapsto E[c(V)]$ where $V \sim p(\theta)$.

Not directly necessary for Perturbed because we can put $c \circ f$ in the Reinforce, but necessary for regularized because $c \circ f$ is not an LP (not amenable to FW).

struct Pushforward
    fixed_atoms_dist_constructor  # must return a FixedAtomsProbabilityDistribution
    post_processing
end

function (p::Pushforward)(theta)
    dist = p.fixed_atoms_dist_constructor(theta)
    return mean(p.post_processing, dist)
end

Actually it is necessary to define compute_probability_distribution here along with its rrule for Reinforce

https://github.com/JuliaDecisionFocusedLearning/InferOpt.jl/blob/59ab4fe21682e8c0a20bb55d4da3b4cb91f2cc0c/src/perturbed/abstract_perturbed.jl#L118-L153

The Pushforward struct is no longer necessary then

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Fix faulty std test

Differentiating through samples is not defined. Use the square of exp instead

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.