Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/esn/esn_inits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ function informed_init(rng::AbstractRNG, ::Type{T}, dims::Integer...;
idxs = findall(Bool[zero_connections .== input_matrix[jdx, :]
for jdx in axes(input_matrix, 1)])
random_row_idx = idxs[DeviceAgnostic.rand(rng, T, 1:end)]
random_clm_idx = range(1, state_size; step = 1)[DeviceAgnostic.rand(rng, T, 1:end)]
random_clm_idx = range(1, state_size; step = 1)[DeviceAgnostic.rand(
rng, T, 1:end)]
input_matrix[random_row_idx, random_clm_idx] = (DeviceAgnostic.rand(rng, T) -
T(0.5)) .* (T(2) * T(scaling))
end
Expand Down Expand Up @@ -943,6 +944,7 @@ function digital_chaotic_adjacency(rng::AbstractRNG, bit_precision::Integer;
end
adjacency_matrix[matrix_order, 1] = 1
for row_index in 1:matrix_order, column_index in 1:matrix_order

if row_index != column_index && rand(rng) < extra_edge_probability
adjacency_matrix[row_index, column_index] = 1
end
Expand Down
6 changes: 4 additions & 2 deletions src/esn/esn_predict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function obtain_esn_prediction(esn,
x_new = esn.states_type(esn.nla_type, x, out_pad)

for i in 1:prediction_len
x, x_new = next_state_prediction!(esn, x, x_new, out, out_pad, i, tmp_array,
x,
x_new = next_state_prediction!(esn, x, x_new, out, out_pad, i, tmp_array,
args...)
out_tmp = get_prediction(output_layer.training_method, output_layer, x_new)
out = store_results!(output_layer.training_method, out_tmp, output, i)
Expand Down Expand Up @@ -48,7 +49,8 @@ function obtain_esn_prediction(esn,
x_new = esn.states_type(esn.nla_type, x, out_pad)

for i in 1:prediction_len
x, x_new = next_state_prediction!(esn, x, x_new, prediction.prediction_data[:, i],
x,
x_new = next_state_prediction!(esn, x, x_new, prediction.prediction_data[:, i],
out_pad, i, tmp_array, args...)
out_tmp = get_prediction(training_method, output_layer, x_new)
out = store_results!(training_method, out_tmp, output, i)
Expand Down
2 changes: 1 addition & 1 deletion src/reca/reca_input_encodings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function encoding(rm::RandomMaps, input_vector, tot_encoded_vector)
input_vector,
new_tot_enc_vec[((i - 1) * rm.expansion_size + 1):(i * rm.expansion_size)],
rm.maps[i,
:])
:])
end

return new_tot_enc_vec
Expand Down
Loading