2 from moisture_rnn
import staircase_spatial
6 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 # Testing for a single Functions:
9 # 1. Helper function to create data objects, eg X & y
10 # 2. Function to print X & y in human readable way
11 # 3. Call target function eg staircase_spatial to create XX, yy, n_seqs
12 # 4. Print previous output in human readable way (as similar to images in Overleaf FMDA w Recurrent Notebooks - Example 4)
13 # 5. Compare to expectations* (eg see Overleaf FMDA w Recurrent Notebooks - Example 4) human or code
17 def staircase_spatial_test(total_time_steps
, features
, batch_size
, timesteps
, n_locs
= 10):
24 Run staircase_spatial with:
26 X : list of numpy arrays of length n_locs
27 A list where each element is a numpy array containing features for a specific location. The shape of each array is `(total_time_steps, features)`.
29 y : list of numpy arrays of length n_locs
30 A list where each element is a numpy array containing the target values for a specific location. The shape of each array is `(total_time_steps,)`.
40 print("staircase_spatial_test inputs")
41 print(f
"total_time_steps: {total_time_steps}")
42 print(f
"features: {features}")
43 print(f
"batch_size: {batch_size}")
44 print(f
"timesteps: {timesteps}")
45 print(f
"n_locs: {n_locs}")
52 for i
in range(0, n_locs
):
53 Xi
= np
.arange(i
, i
+total_time_steps
)
54 yi
= np
.arange(i
, i
+total_time_steps
)