Class ExponentialReconstructionDistribution

    • Constructor Detail

      • ExponentialReconstructionDistribution

        public ExponentialReconstructionDistribution()
      • ExponentialReconstructionDistribution

        public ExponentialReconstructionDistribution​(Activation activation)
      • ExponentialReconstructionDistribution

        public ExponentialReconstructionDistribution​(IActivation activationFn)
    • Method Detail

      • hasLossFunction

        public boolean hasLossFunction()
        Description copied from interface: ReconstructionDistribution
        Does this reconstruction distribution has a standard neural network loss function (such as mean squared error, which is deterministic) or is it a standard VAE with a probabilistic reconstruction distribution?
        Specified by:
        hasLossFunction in interface ReconstructionDistribution
        Returns:
        true if the reconstruction distribution has a loss function only (and no probabilistic reconstruction distribution)
      • distributionInputSize

        public int distributionInputSize​(int dataSize)
        Description copied from interface: ReconstructionDistribution
        Get the number of distribution parameters for the given input data size. For example, a Gaussian distribution has 2 parameters value (mean and log(variance)) for each data value, whereas a Bernoulli distribution has only 1 parameter value (probability) for each data value.
        Specified by:
        distributionInputSize in interface ReconstructionDistribution
        Parameters:
        dataSize - Size of the data. i.e., nIn value
        Returns:
        Number of distribution parameters for the given reconstruction distribution
      • negLogProbability

        public double negLogProbability​(INDArray x,
                                        INDArray preOutDistributionParams,
                                        boolean average)
        Description copied from interface: ReconstructionDistribution
        Calculate the negative log probability (summed or averaged over each example in the minibatch)
        Specified by:
        negLogProbability in interface ReconstructionDistribution
        Parameters:
        x - Data to be modelled (reconstructions)
        preOutDistributionParams - Distribution parameters used by this reconstruction distribution (for example, mean and log variance values for Gaussian)
        average - Whether the log probability should be averaged over the minibatch, or simply summed.
        Returns:
        Average or sum of negative log probability of the reconstruction given the distribution parameters
      • exampleNegLogProbability

        public INDArray exampleNegLogProbability​(INDArray x,
                                                 INDArray preOutDistributionParams)
        Description copied from interface: ReconstructionDistribution
        Calculate the negative log probability for each example individually
        Specified by:
        exampleNegLogProbability in interface ReconstructionDistribution
        Parameters:
        x - Data to be modelled (reconstructions)
        preOutDistributionParams - Distribution parameters used by this reconstruction distribution (for example, mean and log variance values for Gaussian) - before applying activation function
        Returns:
        Negative log probability of the reconstruction given the distribution parameters, for each example individually. Column vector, shape [numExamples, 1]
      • gradient

        public INDArray gradient​(INDArray x,
                                 INDArray preOutDistributionParams)
        Description copied from interface: ReconstructionDistribution
        Calculate the gradient of the negative log probability with respect to the preOutDistributionParams
        Specified by:
        gradient in interface ReconstructionDistribution
        Parameters:
        x - Data
        preOutDistributionParams - Distribution parameters used by this reconstruction distribution (for example, mean and log variance values for Gaussian) - before applying activation function
        Returns:
        Gradient with respect to the preOutDistributionParams
      • generateRandom

        public INDArray generateRandom​(INDArray preOutDistributionParams)
        Description copied from interface: ReconstructionDistribution
        Randomly sample from P(x|z) using the specified distribution parameters
        Specified by:
        generateRandom in interface ReconstructionDistribution
        Parameters:
        preOutDistributionParams - Distribution parameters used by this reconstruction distribution (for example, mean and log variance values for Gaussian) - before applying activation function
        Returns:
        A random sample of x given the distribution parameters
      • generateAtMean

        public INDArray generateAtMean​(INDArray preOutDistributionParams)
        Description copied from interface: ReconstructionDistribution
        Generate a sample from P(x|z), where x = E[P(x|z)] i.e., return the mean value for the distribution
        Specified by:
        generateAtMean in interface ReconstructionDistribution
        Parameters:
        preOutDistributionParams - Distribution parameters used by this reconstruction distribution (for example, mean and log variance values for Gaussian) - before applying activation function
        Returns:
        A deterministic sample of x (mean/expected value) given the distribution parameters