I’m new to Julia and Flux.jl and I’m trying to implement a Variational Autoencoder (VAE). My decoder has a single layer mapping to the output, but I need to apply different weights to each example.
Instead of a dense layer, I want to interact the weights with a matrix that indicates which weights should be non-zero for each example. Essentially, I’m looking for a way to implement a sparse decoder layer.
Is this possible in Flux? Could someone provide an example or point me to relevant documentation?
Define encoder
encoder(x) = Chain(
Dense(40, 20, relu),
Dense(20, 20)
)(x)Decoder 1 layer
decoder(z) = Dense(20, 7, sigmoid)