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:
15
spatz/metrics/mse.py
Normal file
15
spatz/metrics/mse.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from numpy.typing import ArrayLike
|
||||
from spatz.metrics import Metric
|
||||
|
||||
|
||||
class MSEMetric(Metric):
|
||||
def __init__(self) -> None:
|
||||
"""Mean squared error
|
||||
"""
|
||||
super().__init__()
|
||||
|
||||
def _update(self, x: ArrayLike, y: ArrayLike):
|
||||
if self._score is None:
|
||||
self._score = 0.5 * (x - y)**2
|
||||
else:
|
||||
self._score += 0.5 * (x - y)**2
|
Reference in New Issue
Block a user