Skip to content

Instantly share code, notes, and snippets.

@charlesbmi
Created December 11, 2020 19:09
Show Gist options
  • Save charlesbmi/0e778e16f6d652454dc32bfc547595fd to your computer and use it in GitHub Desktop.
Save charlesbmi/0e778e16f6d652454dc32bfc547595fd to your computer and use it in GitHub Desktop.
# 1. Reconstruction loss: x0 = x0_recon
reconstruction_loss = tf.keras.losses.mean_squared_error(x0, x0_reconstructed)
model.add_loss(reconstruction_loss)
# 2. Future state prediction loss: x1 = x1_pred
state_prediction_loss = tf.keras.losses.mean_squared_error(x1, x1_pred)
model.add_loss(state_prediction_loss)
# 3. Linear dynamics loss: y1 = K * y0
linear_dynamics_loss = tf.keras.losses.mean_squared_error(code1, code1_pred)
model.add_loss(linear_dynamics_loss)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment