File size: 454 Bytes
27ca8b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Tuple, Union

from omegaconf import DictConfig


class BaseAlgo(ABC):
    """
    A base class for generic algorithms.
    """

    def __init__(self, cfg: DictConfig):
        super().__init__()
        self.cfg = cfg

    @abstractmethod
    def run(*args: Any, **kwargs: Any) -> Any:
        """
        Run the algorithm.
        """
        raise NotImplementedError