Skip to content

Commit

Permalink
Added IS to model evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
sana committed Jan 17, 2025
1 parent 1f00de9 commit 248487d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ml4h/models/diffusion_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from keras import layers

from ml4h.defines import IMAGE_EXT
from ml4h.metrics import KernelInceptionDistance
from ml4h.metrics import KernelInceptionDistance, InceptionScore
from ml4h.models.Block import Block
from ml4h.TensorMap import TensorMap

Expand Down Expand Up @@ -308,6 +308,7 @@ def compile(self, **kwargs):
self.mae_metric = tf.keras.metrics.MeanAbsoluteError(name="mae")
if self.tensor_map.axes() == 3 and self.inspect_model:
self.kid = KernelInceptionDistance(name = "kid", input_shape = self.tensor_map.shape, kernel_image_size=299)
self.inception_score = InceptionScore(name = "is", input_shape = self.tensor_map.shape, kernel_image_size=299)

@property
def metrics(self):
Expand Down Expand Up @@ -666,6 +667,7 @@ def compile(self, **kwargs):
self.supervised_loss_tracker = keras.metrics.Mean(name="supervised_loss")
if self.input_map.axes() == 3 and self.inspect_model:
self.kid = KernelInceptionDistance(name = "kid", input_shape = self.input_map.shape, kernel_image_size=299)
self.inception_score = InceptionScore(name = "is", input_shape = self.input_map.shape, kernel_image_size=299)

@property
def metrics(self):
Expand Down

0 comments on commit 248487d

Please sign in to comment.