Deep Learning for PyTorch
Project description
Stochastic Deep Learning for Pytorch
About
Storchastic is a PyTorch library for stochastic gradient estimation in Deep Learning [1]. Many state of the art deep learning models use gradient estimation, in particular within the fields of Variational Inference and Reinforcement Learning. While PyTorch computes gradients of deterministic computation graphs automatically, it will not estimate gradients on stochastic computation graphs [2].
With Storchastic, you can easily define any stochastic deep learning model and let it estimate the gradients for you. Storchastic provides a large range of gradient estimation methods that you can plug and play, to figure out which one works best for your problem. Storchastic provides automatic broadcasting of sampled batch dimensions, which increases code readability and allows implementing complex models with ease.
When dealing with continuous random variables and differentiable functions, the popular reparameterization method [3] is usually very effective. However, this method is not applicable when dealing with discrete random variables or non-differentiable functions. This is why Storchastic has a focus on gradient estimators for discrete random variables, non-differentiable functions and sequence models.
Documentation (under construction) on Read the Docs.
Example: Discrete Variational Auto-Encoder
Installation
Pip is going to be set up soon. Requires Pyro for now. Build on Python 3.7 and PyTorch 1.4.
Implemented Algorithms
Feel free to create an issue if an estimator is missing here.
- Reparameterization [1, 3]
- Score Function (REINFORCE) with Moving Average baseline [1, 4]
- Score Function with Batch Average Baseline [5, 6]
- Expected value for enumerable distributions
- (Straight through) Gumbel Softmax [7, 8]
- LAX, RELAX [9]
- REBAR [10]
In development
- Memory Augmented Policy Optimization [11]
- Rao-Blackwellized REINFORCE [12]
- Unordered Set Estimator [13]
Planned
- Measure valued derivatives [1, 14]
- ARM [15]
- ...
References
- [1] Monte Carlo Gradient Estimation in Machine Learning, Mohamed et al, 2019
- [2] Gradient Estimation Using Stochastic Computation Graphs, Schulman et al, NeurIPS 2015
- [3] Auto-Encoding Variational Bayes, Kingma and Welling, ICLR 2014
- [4] Simple statistical gradient-following algorithms for connectionist reinforcement learning, Williams, Machine Learning 1992
- [5] Variational inference for Monte Carlo objectives, Mnih and Rezende, ICML 2016
- [6] Buy 4 REINFORCE Samples, Get a Baseline for Free!, Kool et al, ICLR Workshop dlStructPred 2019
- [7] Categorical Reparameterization with Gumbel-Softmax, Jang et al, ICLR 2017
- [8] The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables, Maddison et al, ICLR 2017
- [9] Backpropagation through the Void: Optimizing control variates for black-box gradient estimation, Grathwohl et al, ICLR 2018
- [10] REBAR: Low-variance, unbiased gradient estimates for discrete latent variable models, Tucker et al, NeurIPS 2017
- [11] Memory Augmented Policy Optimization for Program Synthesis and Semantic Parsing, Liang et al, NeurIPS 2018
- [12] Rao-Blackwellized Stochastic Gradients for Discrete Distributions, Liu et al, ICML 2019
- [13] Estimating Gradients for Discrete Random Variables by Sampling without Replacement, Kool et al, ICLR 2020
- [14] Measure-Valued Derivatives for Approximate Bayesian Inference, Rosca et al, Workshop on Bayesian Deep Learning (NeurIPS 2019)
- [15] ARM: Augment-REINFORCE-Merge Gradient for Stochastic Binary Networks, Yin and Zhou, ICLR 2019
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file storchastic-0.0.1.tar.gz
.
File metadata
- Download URL: storchastic-0.0.1.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017ffdbab4eab8850099eb15506455de5721e49c5bdb12f032eb7d191266c89b |
|
MD5 | b9f13a973f802585a88cf54ca98238ad |
|
BLAKE2b-256 | 727986d0f75fb145f3c2d4a0a3a7a9a7d9a74ad31aa3d8a167db5f192444b7f6 |
File details
Details for the file storchastic-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: storchastic-0.0.1-py3-none-any.whl
- Upload date:
- Size: 58.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 755f91e3e1d734cda1b9bccc7dc4ab1e5c65d51223da1f26680b4cdced7e8d84 |
|
MD5 | 7cf5ec546e06818cf3ebb3d5e525f90e |
|
BLAKE2b-256 | d81bf352e13bf73a07ec12e2515e1c5c81397f7788caf003b0dc95621df25157 |