optimizer = tf.keras.optimizers.Adam()

# Define your loss function (e.g., Mean Squared Error)
mse_loss_fn = tf.keras.losses.MeanSquaredError()

# Compile the model
cvae_model.compile(optimizer=optimizer, loss=mse_loss_fn)

# Train the model
cvae_model.fit([data, clusters], data, epochs=10, batch_size=32)