def log_gaussian_error_nll(mu_values, log_sigma_values, true_values):
    """ log_sigma should come from a linear layer """
    nll = 0.5 * (mu_values - true_values) ** 2 / tensor.exp(
        log_sigma_values) ** 2 + tensor.log(2 * np.pi) + 2 * log_sigma_values
    return nll
dataset/ETHPy150Open kastnerkyle/SciPy2015/graphics_code/cvae/kdl_template.py/log_gaussian_error_nll/original