Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/chemperium/training/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ def masked_binary_crossentropy(y_true, y_pred):
mask = ~tf.math.is_nan(y_true) # Create a mask where True if y_true is not NaN
masked_y_true = tf.boolean_mask(y_true, mask) # Apply mask to ground truth
masked_y_pred = tf.boolean_mask(y_pred, mask) # Apply mask to predictions
return tf.reduce_mean(BinaryCrossentropy(masked_y_true - masked_y_pred)) # Compute MSE
bce = BinaryCrossentropy() # Instantiate loss function
return bce(masked_y_true, masked_y_pred) # Compute BCE


def masked_mean_squared_error(y_true, y_pred):
Expand Down