MCPcopy Create free account
hub / github.com/MichSchli/AVeriTeC / __init__

Method __init__

models/NaiveSeqClassModule.py:16–30  ·  view source on GitHub ↗
(self, tokenizer, model, use_question_stance_approach=True, learning_rate=1e-3)

Source from the content-addressed store, hash-verified

14class NaiveSeqClassModule(pl.LightningModule):
15 # Instantiate the model
16 def __init__(self, tokenizer, model, use_question_stance_approach=True, learning_rate=1e-3):
17 super().__init__()
18 self.tokenizer = tokenizer
19 self.model = model
20 self.learning_rate = learning_rate
21
22 self.train_acc = torchmetrics.Accuracy()
23 self.val_acc = torchmetrics.Accuracy()
24 self.test_acc = torchmetrics.Accuracy()
25
26 self.train_f1 = F1Score(num_classes=4, average="macro")
27 self.val_f1 = F1Score(num_classes=4, average=None)
28 self.test_f1 = F1Score(num_classes=4, average=None)
29
30 self.use_question_stance_approach = use_question_stance_approach
31
32
33 # Do a forward pass through the model

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected