From 53cfc21cffa4e877ad0959170b47b690d2fdb40f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 3 Sep 2023 01:14:41 +0200 Subject: Update lit models --- text_recognizer/model/base.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'text_recognizer/model/base.py') diff --git a/text_recognizer/model/base.py b/text_recognizer/model/base.py index adcb8da..9a751bf 100644 --- a/text_recognizer/model/base.py +++ b/text_recognizer/model/base.py @@ -7,7 +7,6 @@ from loguru import logger as log from omegaconf import DictConfig import pytorch_lightning as L from torch import nn, Tensor -from torchmetrics import Accuracy from text_recognizer.data.tokenizer import Tokenizer @@ -24,17 +23,11 @@ class LitBase(L.LightningModule): tokenizer: Tokenizer, ) -> None: super().__init__() - self.network = network self.loss_fn = loss_fn self.optimizer_config = optimizer_config self.lr_scheduler_config = lr_scheduler_config self.tokenizer = tokenizer - ignore_index = int(self.tokenizer.get_value("

")) - # Placeholders - self.train_acc = Accuracy(mdmc_reduce="samplewise", ignore_index=ignore_index) - self.val_acc = Accuracy(mdmc_reduce="samplewise", ignore_index=ignore_index) - self.test_acc = Accuracy(mdmc_reduce="samplewise", ignore_index=ignore_index) def optimizer_zero_grad( self, -- cgit v1.2.3-70-g09d2