mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-06-10 01:55:59 +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": [
|
||||
"from spatz.metrics import Metric\n",
|
||||
"\n",
|
||||
"metric = Metric()\n",
|
||||
"\n",
|
||||
"logger = simulation.get_logger()\n",
|
||||
"\n",
|
||||
"# Set verbose to False to disable the progress bar\n",
|
||||
@ -183,7 +187,12 @@
|
||||
" # Get the correct altitude data.\n",
|
||||
" alt = altitude()\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