INNER CODE UNIT · Python
training_step
lbcb-sci/RiNALMo · train_ncrna_classification.py:119
def training_step(self, batch, batch_idx):
return self._common_step(batch, batch_idx, split='train')
def validation_step(self, batch, batch_idx):
return self._validation_step(batch, batch_idx, split='val')
def on_validation_epoch_end(self):
self._on_epoch_end(split='val')
def test_step(self, batch, batch_idx):
return self._validation_step(batch, batch_idx, split='test')
def on_test_epoch_end(self):
self._on_epoch_end(split='test')
def configure_optimizers(self):
optimizer = AdamW(
filter(lambda p: p.requires_grad, self.parameters()),