mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-08-06 18:37:34 +00:00
Added a few metrics for measuring performance
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
from abc import abstractmethod
|
||||
|
||||
|
||||
from numpy.typing import ArrayLike
|
||||
from typing import Any
|
||||
|
||||
|
||||
class Metric:
|
||||
def __init__(self) -> None:
|
||||
self.__sum = 0
|
||||
self._score = None
|
||||
|
||||
def get_score():
|
||||
pass
|
||||
def get_score(self):
|
||||
return self._score
|
||||
|
||||
def __call__(self, *args) -> Any:
|
||||
self.__sum += abs(x - y)
|
||||
@abstractmethod
|
||||
def _update(self, x: ArrayLike, y: ArrayLike):
|
||||
raise NotImplementedError()
|
||||
|
||||
def __call__(self, x: ArrayLike, y: ArrayLike) -> Any:
|
||||
self._update(x, y)
|
Reference in New Issue
Block a user