This repository has been archived on 2025-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2025ML-project-neural_compr.../src/trainers/trainer.py
2025-12-13 17:53:01 +01:00

20 lines
476 B
Python

from abc import ABC, abstractmethod
import torch.nn as nn
from torch.utils.data import DataLoader
class Trainer(ABC):
"""Abstract class for trainers."""
@abstractmethod
def execute(
self,
model: nn.Module | type[nn.Module] | None,
context_length: int,
train_loader: DataLoader,
validation_loader: DataLoader,
n_epochs: int | None,
device: str
) -> nn.Module:
pass