-
-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
initsinitializers for internal matricesinitializers for internal matrices
Description
The deterministic initializers have a lot of structures in common. I think we can reduce code reuse by building functions such as
function delay_line!(reservoir_matrix::AbstractMatrix, weight::Number)
for idx in first(axes(reservoir_matrix, 1)):(last(axes(reservoir_matrix, 1)) - 1)
reservoir_matrix[idx + 1, idx] = weight
end
return reservoir_matrix
endThis way we can even have more control over the weights by having a dispatch over a vector of values
function delay_line!(reservoir_matrix::AbstractMatrix, weight::AbstractVector)
for idx in first(axes(reservoir_matrix, 1)):(last(axes(reservoir_matrix, 1)) - 1)
reservoir_matrix[idx + 1, idx] = weight[idx]
end
return reservoir_matrix
endMetadata
Metadata
Assignees
Labels
initsinitializers for internal matricesinitializers for internal matrices