Skip to content

Commit

Permalink
compute ms ssim in test steps
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidtronix committed Jan 21, 2025
1 parent a6f26f2 commit 70363ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ml4h/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ def __init__(self, name="multi_scale_ssim", **kwargs):

def update_state(self, y_true, y_pred, max_val, sample_weight=None):
# Calculate MS-SSIM for the batch
ssim = tf.image.ssim_multiscale(y_true, y_pred, max_val=max_val, power_factors=[0.01, 0.2, 0.5, 0.29])
ssim = tf.image.ssim_multiscale(y_true, y_pred, max_val=max_val, power_factors=[0.0, 0.0, 0.5, 0.5])
if sample_weight is not None:
ssim = tf.multiply(ssim, sample_weight)

Expand Down

0 comments on commit 70363ad

Please sign in to comment.