def loss_func(recon_x, x, mu, logvar, pre_, label_):
    mse = torch.nn.MSELoss()
    binary_cross_entropy = f.binary_cross_entropy(recon_x, x, size_average=False)
    k_l_divergence = ((- 0.5) * torch.sum((((1 + logvar) - mu.pow(2)) - logvar.exp())))
    mse_loss = mse(pre_, label_)
    return ((binary_cross_entropy + k_l_divergence) + mse_loss)
def loss_func(recon_x, x, mu, logvar, pre_, label_):
    mse = torch.nn.MSELoss()
    binary_cross_entropy = f.binary_cross_entropy(recon_x, x, size_average=False)
    k_l_divergence = ((- 0.5) * torch.sum((((1 + logvar) - mu.pow(2)) - logvar.exp())))
    mse_loss = mse(pre_, label_)
    return ((binary_cross_entropy + k_l_divergence) + mse_loss)