nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/lossfunctions/impl/LossMixtureDensity.java
private INDArray negativeLogLikelihood(INDArray labels, INDArray alpha, INDArray mu, INDArray sigma) {
        INDArray labelsMinusMu = labelsMinusMu(labels, mu);
        INDArray diffsquared = labelsMinusMu.mul(labelsMinusMu).sum(2);
        INDArray phitimesalphasum = phi(diffsquared, sigma).muli(alpha).sum(1);

        // result = See Bishop(28,29)
        INDArray result = Transforms.log(phitimesalphasum).negi();
        return result;
    }
private INDArray negativeLogLikelihood(INDArray labels, INDArray alpha, INDArray mu, INDArray sigma) {
        INDArray labelsMinusMu = labelsMinusMu(labels, mu);
        INDArray diffsquared = labelsMinusMu.mul(labelsMinusMu).sum(2);
        INDArray phitimesalphasum = phi(diffsquared, sigma).muli(alpha).sum(1);

        // result = See Bishop(28,29)
        INDArray result = Transforms.log(phitimesalphasum).negi();
        return result;
    }
private INDArray negativeLogLikelihood ( INDArray labels , INDArray alpha , INDArray mu , INDArray sigma ) { INDArray labelsMinusMu = labelsMinusMu ( labels , mu ) ; INDArray diffsquared = labelsMinusMu . mul ( labelsMinusMu ) . sum ( 2 ) ; INDArray phitimesalphasum = phi ( diffsquared , sigma ) . muli ( alpha ) . sum ( 1 ) ; // result = See Bishop(28,29) INDArray result = Transforms . log ( phitimesalphasum ) . negi ( ) ; return result ; }
This method returns an array consisting of each of the training samples,
for each label in each sample, the negative log likelihood of that
value falling within the given gaussian mixtures.
@param alpha
@param mu
@param sigma
@param labels
@return
This method returns an array consisting of each of the training samples for each label in each sample the negative log likelihood of that value falling within the given gaussian mixtures .