Skip to content

Commit de1859a

Browse files
author
Onno Kampman
committed
add start of inference test
1 parent 90f42c9 commit de1859a

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

tests/fcest/helpers/test_inference.py

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import unittest
2+
3+
import numpy as np
4+
5+
from fcest.helpers.inference import run_adam
6+
7+
8+
class TestInference(unittest.TestCase):
9+
"""
10+
Test functions in inference.py.
11+
"""
12+
13+
def test_run_adam(self):
14+
"""
15+
Test that the function returns a list.
16+
"""
17+
# logf = run_adam(
18+
# "VWP",
19+
# m,
20+
# iterations=100,
21+
# )
22+
logf = []
23+
self.assertEqual(type(logf), list)
24+
25+
@staticmethod
26+
def _simulate_d2_time_series() -> np.array:
27+
"""
28+
Get dummy time series.
29+
30+
:return:
31+
Array of shape (N, D)
32+
"""
33+
N = 200
34+
D = 2
35+
x = np.linspace(0, 1, N).reshape(-1, 1)
36+
y = np.random.random(size=(N, D))
37+
38+
return x, y
39+
40+
41+
if __name__ == '__main__':
42+
unittest.main()

0 commit comments

Comments
 (0)