utils
Auxiliar functions
check_func_inverse(func, inv_func)
¶
check that func and inv_func are indeed inverse of each other
Source code in echoes/utils.py
25 26 27 28 29 30 31 32 |
|
check_matrices_shapes(W_in, W, W_fb, n_inputs, n_reservoir, n_outputs, feedback)
¶
Check shapes of W, W_in, W_fb
Source code in echoes/utils.py
35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
check_model_params(params)
¶
check consistency of parameters, shapes, sensible warnings
Source code in echoes/utils.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
relu(x)
¶
Numba jitted ReLu (rectified linear unit) function. Return ReLu(x)
Source code in echoes/utils.py
111 112 113 114 |
|
set_spectral_radius(matrix, target_radius)
¶
Return a copy of matrix with rescaled weights to match target spectral radius
Source code in echoes/utils.py
13 14 15 16 17 18 |
|
sigmoid(x, a=1)
¶
Return f(x) = 1 / (1 + np.exp(-x * a)). Numba jitted sigmoid function.
Source code in echoes/utils.py
117 118 119 120 121 122 |
|
tanh(x)
¶
Numba jitted tanh function. Return tanh(x)
Source code in echoes/utils.py
105 106 107 108 |
|