mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-06-10 18:15:59 +00:00
19 lines
412 B
Python
19 lines
412 B
Python
from abc import abstractmethod
|
|
|
|
from numpy.typing import ArrayLike
|
|
from typing import Any
|
|
|
|
|
|
class Metric:
|
|
def __init__(self) -> None:
|
|
self._score = None
|
|
|
|
def get_score(self):
|
|
return self._score
|
|
|
|
@abstractmethod
|
|
def _update(self, x: ArrayLike, y: ArrayLike):
|
|
raise NotImplementedError()
|
|
|
|
def __call__(self, x: ArrayLike, y: ArrayLike) -> Any:
|
|
self._update(x, y) |