Machine Learning, Data Science, Deep Learning, Artificial Intelligence, Towards Data Science.
the average MSE error, then scale it up, ie. simply sum on all axes reconstruction_loss = 2 * metrics.mse(K.flatten(X), K.flatten(output)) # compute the KL loss kl_loss = - 0.5 * K.sum(1 + E_logsigma - K.square(E_mean) - K.exp(E_logsigma), axis=-1) total_loss = K.mean(reconstruction_loss + kl_loss)