(means_N_D, stdevs_N_D, x_N_D)
return logprobs_B
Log density of a Gaussian distribution with diagonal covariance (specified as standard deviations).
Log density of a Gaussian distribution with diagonal covariance (specified as standard deviations).
Log density of a Gaussian distribution with diagonal covariance ( specified as standard deviations ) .
def gaussian_log_density(means_N_D, stdevs_N_D, x_N_D):
    '''Log density of a Gaussian distribution with diagonal covariance (specified as standard deviations).'''
    D = tensor.shape(means_N_D)[1]
    lognormconsts_B = -.5*(D*np.log(2.*np.pi) + 2.*tensor.log(stdevs_N_D).sum(axis=1)) # log normalization constants
    logprobs_B = -.5*tensor.sqr((x_N_D - means_N_D)/stdevs_N_D).sum(axis=1) + lognormconsts_B
    return logprobs_B
def gaussian_log_density ( means_N_D , stdevs_N_D , x_N_D ) : D = tensor . shape ( means_N_D ) [ 1 ] lognormconsts_B = - .5 * ( D * np . log ( 2. * np . pi ) + 2. * tensor . log ( stdevs_N_D ) . sum ( axis = 1 ) ) # log normalization constants logprobs_B = - .5 * tensor . sqr ( ( x_N_D - means_N_D ) / stdevs_N_D ) . sum ( axis = 1 ) + lognormconsts_B return logprobs_B