summaryrefslogtreecommitdiff
path: root/text_recognizer/model/base.py
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-03 01:14:41 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-03 01:14:41 +0200
commit53cfc21cffa4e877ad0959170b47b690d2fdb40f (patch)
tree88eaabb75a5ca6fba3c43655ccb754a9f0c5d649 /text_recognizer/model/base.py
parentd020059f2f71fe7c25765dde9d535195c09ece01 (diff)
Update lit models
Diffstat (limited to 'text_recognizer/model/base.py')
-rw-r--r--text_recognizer/model/base.py7
1 files changed, 0 insertions, 7 deletions
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("<p>"))
- # 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,