mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-06-11 02:26:00 +00:00
Added dummy metric
This commit is contained in:
parent
63d609d4cf
commit
751887e6d8
11
demo.ipynb
11
demo.ipynb
@ -171,6 +171,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
|
"from spatz.metrics import Metric\n",
|
||||||
|
"\n",
|
||||||
|
"metric = Metric()\n",
|
||||||
|
"\n",
|
||||||
"logger = simulation.get_logger()\n",
|
"logger = simulation.get_logger()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# Set verbose to False to disable the progress bar\n",
|
"# Set verbose to False to disable the progress bar\n",
|
||||||
@ -183,7 +187,12 @@
|
|||||||
" # Get the correct altitude data.\n",
|
" # Get the correct altitude data.\n",
|
||||||
" alt = altitude()\n",
|
" alt = altitude()\n",
|
||||||
"\n",
|
"\n",
|
||||||
" # TODO: Add your computation here."
|
" pred_alt = ...\n",
|
||||||
|
" metric(alt, pred_alt)\n",
|
||||||
|
"\n",
|
||||||
|
" # TODO: Add your computation here.\n",
|
||||||
|
"\n",
|
||||||
|
"print('Score was:', metric.get_score())"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
1
spatz/metrics/__init__.py
Normal file
1
spatz/metrics/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from spatz.metrics.metric import Metric
|
14
spatz/metrics/metric.py
Normal file
14
spatz/metrics/metric.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
|
|
||||||
|
class Metric:
|
||||||
|
def __init__(self) -> None:
|
||||||
|
self.__sum = 0
|
||||||
|
|
||||||
|
def get_score():
|
||||||
|
pass
|
||||||
|
|
||||||
|
def __call__(self, *args) -> Any:
|
||||||
|
self.__sum += abs(x - y)
|
Loading…
x
Reference in New Issue
Block a user