https://github.com/arnauqb/gumbelsoftmax.jl

Julia implementation of the Gumbel-Softmax reparametrization trick compatible with Zygote and ForwardDiff

https://github.com/arnauqb/gumbelsoftmax.jl

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Julia implementation of the Gumbel-Softmax reparametrization trick compatible with Zygote and ForwardDiff

Basic Info
  • Host: GitHub
  • Owner: arnauqb
  • License: mit
  • Language: Julia
  • Default Branch: main
  • Homepage:
  • Size: 531 KB
Statistics
  • Stars: 9
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 6
Created over 4 years ago · Last pushed about 2 years ago
Metadata Files
Readme License

README.md

GumbelSoftmax

Build Status Coverage

This package implements: 1. Gumbel-Softmax 2. Rao-Blackwellized Gumbel-Softmax

in the Julia programming language. The package supports both forward-mode automatic differentiation (AD) and reverse-mode AD through Zygote and ForwardDiff respectively.

1. Installation

The easiest way is to get the package directly from the Julia repository

julia using Pkg Pkg.add("GumbelSoftmax")

2. Usage

The expected input shape is (latent_dimension, categorical_dimension, batch_dimension). As an example, let's suppose we have 4 Categorical distributions with 3 classes and we want to sample 10 times. In this case, latent_dimension=4, categorical_dimension=3, and batch_dimension=10.

```julia using GumbelSoftmax, Random logits = randn(4, 3, 10) samples = samplegumbelsoftmax(logits=logits, tau=0.1, hard=true)

or with Rao-Blackwellization

k = 10 # number of Monte-Carlo samples samples = sampleraogumbel_softmax(logits=logits, tau=0.1, k=k) ```

3. Example: Discrete Variational Autoencoder (VAE)

We include an example of using the Gumbel-Softmax trick to implement a discrete VAE. The example can be found in examples/vae.jl and it can be run with

bash julia examples/vae.jl Here are some results:

VAE loss:

loss

VAE reconstructions and generated samples:

Owner

  • Name: Arnau Quera-Bofarull
  • Login: arnauqb
  • Kind: user
  • Location: Oxford

Astrophysicist now doing research on agent-based modeling at Oxford.

GitHub Events

Total
  • Issues event: 1
  • Watch event: 3
Last Year
  • Issues event: 1
  • Watch event: 3

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 3
  • Total pull requests: 3
  • Average time to close issues: less than a minute
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 3.33
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • gdalle (1)
  • flaviobarros (1)
  • JuliaTagBot (1)
Pull Request Authors
  • arnauqb (3)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1 total
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 7
juliahub.com: GumbelSoftmax

Julia implementation of the Gumbel-Softmax reparametrization trick compatible with Zygote and ForwardDiff

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1 Total
Rankings
Dependent repos count: 9.9%
Average: 24.4%
Dependent packages count: 38.9%
Last synced: 10 months ago

Dependencies

.github/workflows/CI.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v2 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/CompatHelper.yml actions
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite