31
31
"""
32
32
Sets u_prev to the initial parameter values
33
33
"""
34
- function set_ICs! (accelerator:: NesterovAccelerator{FT} , u:: MA ) where {FT <: AbstractFloat , MA <: AbstractMatrix{FT} }
34
+ function set_ICs! (accelerator:: NesterovAccelerator{FT} , u:: MA ) where {FT <: AbstractFloat , MA <: AbstractMatrix }
35
35
accelerator. u_prev = u
36
36
end
37
37
@@ -42,7 +42,7 @@ Performs traditional state update with no momentum.
42
42
function accelerate! (
43
43
ekp:: EnsembleKalmanProcess{FT, IT, P, LRS, DefaultAccelerator} ,
44
44
u:: MA ,
45
- ) where {FT <: AbstractFloat , IT <: Int , P <: Process , LRS <: LearningRateScheduler , MA <: AbstractMatrix{FT} }
45
+ ) where {FT <: AbstractFloat , IT <: Int , P <: Process , LRS <: LearningRateScheduler , MA <: AbstractMatrix }
46
46
push! (ekp. u, DataContainer (u, data_are_columns = true ))
47
47
end
48
48
@@ -52,7 +52,7 @@ Performs state update with modified Nesterov momentum approach.
52
52
function accelerate! (
53
53
ekp:: EnsembleKalmanProcess{FT, IT, P, LRS, NesterovAccelerator{FT}} ,
54
54
u:: MA ,
55
- ) where {FT <: AbstractFloat , IT <: Int , P <: Process , LRS <: LearningRateScheduler , MA <: AbstractMatrix{FT} }
55
+ ) where {FT <: AbstractFloat , IT <: Int , P <: Process , LRS <: LearningRateScheduler , MA <: AbstractMatrix }
56
56
# # update "v" state:
57
57
k = get_N_iterations (ekp) + 2
58
58
v = u .+ (1 - ekp. accelerator. r / k) * (u .- ekp. accelerator. u_prev)
0 commit comments