BaseDecoder

class pyraug.models.nn.BaseDecoder[source]

This is a base class for Decoders neural networks.

forward(x)[source]

This function must be implemented in a child class. It takes the latent data and returns (mu). If you decide to provide your own decoder network you must make your model inherit from this class by setting and the define your forward function as such:

class My_decoder(BaseDecoder):

    def __init__(self):
        BaseDecoder.__init__(self)
        # your code

    def forward(self, z):
        # your code
        return mu
Parameters

z (torch.Tensor) – The latent data that must be decoded

Returns

The mean of the conditional distribution \(p_{\theta}(x|z)\)

Return type

(torch.Tensor)

Note

By convention, the output tensors \(\mu\) should be in [0, 1]