@@ -93,7 +93,13 @@ function nla(::NLADefault, x)
93
93
return x
94
94
end
95
95
96
- function nla (nla_type, x_old)
96
+ struct NLAT1 <: NonLinearAlgorithm end
97
+
98
+ struct NLAT2 <: NonLinearAlgorithm end
99
+
100
+ struct NLAT3 <: NonLinearAlgorithm end
101
+
102
+ function nla (nla_type:: Union{NLAT1, NLAT2, NLAT3} , x_old)
97
103
x_new = similar (x_old)
98
104
nla! (nla_type, x_old, x_new)
99
105
return x_new
@@ -111,7 +117,6 @@ ANN, and RNN-LSTM._" (2019).
111
117
systems from data: A reservoir computing approach._"
112
118
Physical review letters 120.2 (2018): 024102.
113
119
"""
114
- struct NLAT1 <: NonLinearAlgorithm end
115
120
116
121
function nla! (:: NLAT1 , x_old, x_new)
117
122
x_new[2 : 2 : end , :] = x_old[2 : 2 : end , :]
@@ -126,10 +131,12 @@ Apply the \$ \\text{T}_2 \$ transformation algorithm, as defined in [1].
126
131
chaotic system using a hierarchy of deep learning methods: Reservoir computing, ANN,
127
132
and RNN-LSTM._" (2019).
128
133
"""
129
- struct NLAT2 <: NonLinearAlgorithm end
130
134
131
135
function nla! (:: NLAT2 , x_old, x_new)
132
136
x_new[1 , :] = x_old[1 , :]
137
+ if mod (size (x_new, 1 ), 2 ) != 0
138
+ x_new[end , :] = x_old[end , :]
139
+ end
133
140
x_new[2 : 2 : end , :] = x_old[2 : 2 : end , :]
134
141
x_new[3 : 2 : end - 1 , :] = x_old[2 : 2 : end - 2 , :]. * x_old[1 : 2 : end - 3 , :]
135
142
end
@@ -142,10 +149,12 @@ Apply the \$ \\text{T}_3 \$ transformation algorithm, as defined in [1].
142
149
chaotic system using a hierarchy of deep learning methods: Reservoir computing, ANN,
143
150
and RNN-LSTM._" (2019).
144
151
"""
145
- struct NLAT3 <: NonLinearAlgorithm end
146
152
147
153
function nla! (:: NLAT3 , x_old, x_new)
148
- x_new[1 ,:]= x_old[1 , :]
154
+ x_new[1 , :] = x_old[1 , :]
155
+ if mod (size (x_new, 1 ), 2 ) != 0
156
+ x_new[end , :] = x_old[end , :]
157
+ end
149
158
x_new[2 : 2 : end , :]= x_old[2 : 2 : end , :]
150
159
x_new[3 : 2 : end - 1 , :]= x_old[2 : 2 : end - 2 , :]. * x_old[4 : 2 : end , :]
151
160
end
0 commit comments