test(monitor): add test case for Monitor1D
@@ -2,7 +2,7 @@ import numpy as np
import pytest
from neurodiffeq.conditions import NoCondition
from neurodiffeq.networks import FCNN
-from neurodiffeq.monitors import Monitor2D, MetricsMonitor
+from neurodiffeq.monitors import Monitor2D, MetricsMonitor, Monitor1D
N_FUNCTIONS = 2
EMPTY_HISTORY = dict(train_loss=[], valid_loss=[])
@@ -14,7 +14,7 @@ HISTORY_10 = dict(
@pytest.mark.parametrize(argnames='history', argvalues=[EMPTY_HISTORY, HISTORY_10])
@pytest.mark.parametrize(argnames='solution_style', argvalues=['curves', 'heatmap'])
-def test_monitor2d(solution_style, history):
+def test_monitor_2d(solution_style, history):
monitor = Monitor2D((0, 0), (1, 1), check_every=100, solution_style=solution_style)
nets = [FCNN(2, 1) for _ in range(N_FUNCTIONS)]
conditions = [NoCondition() for _ in range(N_FUNCTIONS)]
@@ -27,3 +27,11 @@ def test_metrics_mointor(history):
nets = [FCNN(2, 1) for _ in range(N_FUNCTIONS)]
conditions = [NoCondition() for _ in range(N_FUNCTIONS)]
monitor.check(nets, conditions, history)
+
+
+@pytest.mark.parametrize(argnames='history', argvalues=[EMPTY_HISTORY, HISTORY_10])
+def test_monitor_1d(history):
+ monitor = Monitor1D(0, 1)
+ nets = [FCNN() for _ in range(N_FUNCTIONS)]
+ conditions = [NoCondition() for _ in range(N_FUNCTIONS)]
+ monitor.check(nets, conditions, history=history)
