# Deep learning with Flux.jl and gumbel-softmax trick

**URL:** https://discourse.julialang.org/t/deep-learning-with-flux-jl-and-gumbel-softmax-trick/110810
**Category:** Machine Learning
**Created:** [February 26, 2024, 10:46pm UTC](https://discourse.julialang.org/t/deep-learning-with-flux-jl-and-gumbel-softmax-trick/110810 "2024-02-26T22:46:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Flavio\_Barros](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/flavio_barros/32/45443_2.png) [@Flavio\_Barros](https://discourse.julialang.org/u/Flavio_Barros)
#### Post date: [February 26, 2024, 10:46pm UTC](https://discourse.julialang.org/t/deep-learning-with-flux-jl-and-gumbel-softmax-trick/110810/1 "2024-02-26T22:46:34Z")

</div>

I am new to Julia, but I’m evaluating Flux.jl as an option to implement a Variational Autoencoder (VAE). But, unfortunately, I’m not finding an example using the gumbel-softmax trick. I found on Pytorch, but I wonder how could I make it work with Flux.jl. Could someone give me a direction on this?

---

<div class="post-metadata">

### Author: ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)
#### Post date: [February 27, 2024, 1:42am UTC](https://discourse.julialang.org/t/deep-learning-with-flux-jl-and-gumbel-softmax-trick/110810/2 "2024-02-27T01:42:24Z")

</div>

I’ve never heard of a Julia library called Flow.jl. Can you link the one you’re evaluating and the examples you’ve looked through which are relevant but don’t include gumbel softmax?

---

<div class="post-metadata">

### Author: ![Flavio\_Barros](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/flavio_barros/32/45443_2.png) [@Flavio\_Barros](https://discourse.julialang.org/u/Flavio_Barros)
#### Post date: [February 27, 2024, 12:48pm UTC](https://discourse.julialang.org/t/deep-learning-with-flux-jl-and-gumbel-softmax-trick/110810/3 "2024-02-27T12:48:05Z")

</div>

I am running this example with Fashion MNIST dataset: [Convolutional VAE in Flux | Aleco Kastanos](https://alecokas.github.io/julia/flux/vae/2020/07/22/convolutional-vae-in-flux.html)

But in this case is a classical VAE with the Normal distribution. I don’t know how could I adapt it to use the gumbel-softmax trick.
