diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-08-06 14:19:37 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-08-06 14:19:37 +0200 |
commit | 263f2b7158d76bc0adad45309625910c0fa7b1fe (patch) | |
tree | 6af1782e39812c8d7ff8a853195adc32f67f56c2 /text_recognizer/models/vqvae.py | |
parent | 3ab82ad36bce6fa698a13a029a0694b75a5947b7 (diff) |
Remove lr args from model, add Cosine lr, fix to vqvae stack
Diffstat (limited to 'text_recognizer/models/vqvae.py')
-rw-r--r-- | text_recognizer/models/vqvae.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/text_recognizer/models/vqvae.py b/text_recognizer/models/vqvae.py index 7f79b78..76b7ba6 100644 --- a/text_recognizer/models/vqvae.py +++ b/text_recognizer/models/vqvae.py @@ -23,6 +23,7 @@ class VQVAELitModel(BaseLitModel): reconstructions, vq_loss = self(data) loss = self.loss_fn(reconstructions, data) loss = loss + self.latent_loss_weight * vq_loss + self.log("train/vq_loss", vq_loss) self.log("train/loss", loss) return loss @@ -32,6 +33,7 @@ class VQVAELitModel(BaseLitModel): reconstructions, vq_loss = self(data) loss = self.loss_fn(reconstructions, data) loss = loss + self.latent_loss_weight * vq_loss + self.log("val/vq_loss", vq_loss) self.log("val/loss", loss, prog_bar=True) def test_step(self, batch: Tuple[Tensor, Tensor], batch_idx: int) -> None: @@ -40,4 +42,5 @@ class VQVAELitModel(BaseLitModel): reconstructions, vq_loss = self(data) loss = self.loss_fn(reconstructions, data) loss = loss + self.latent_loss_weight * vq_loss + self.log("test/vq_loss", vq_loss) self.log("test/loss", loss) |