From 16f710b15d801fe04ca234778222f9726adc6d33 Mon Sep 17 00:00:00 2001 From: "Md. Zahidul Islam" <50579963+JahidHasanCO@users.noreply.github.com> Date: Sun, 13 Aug 2023 20:01:12 +0600 Subject: [PATCH] fixed metrics_tensors errors --- cleanir/cleanir.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/cleanir/cleanir.py b/cleanir/cleanir.py index 1079b22..bdc7726 100644 --- a/cleanir/cleanir.py +++ b/cleanir/cleanir.py @@ -238,18 +238,14 @@ def build_network(self, n_blocks=4, recon_weight=0.3, with_landmark_loss=False): if with_landmark_loss: cleanir_net.add_loss(landmark_loss) - adam = Adam(lr=1e-4, decay=1e-6) - cleanir_net.compile(optimizer=adam) - - cleanir_net.metrics_tensors.append(vae_losses) - cleanir_net.metrics_names.append('vae_loss') - - cleanir_net.metrics_tensors.append(em_loss) - cleanir_net.metrics_names.append('em_loss') + cleanir_net.add_metric(vae_losses, name='vae_loss') + cleanir_net.add_metric(em_loss, name='em_loss') if with_landmark_loss: - cleanir_net.metrics_tensors.append(landmark_loss) - cleanir_net.metrics_names.append('landmark_loss') + cleanir_net.add_metric(landmark_loss, name='landmark_loss') + + adam = Adam(learning_rate=1e-4, decay=1e-6) + cleanir_net.compile(optimizer=adam) self.__encoder = encoder self.__decoder = decoder