Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Novel minimal reservoir computing #183

Open
MartinuzziFrancesco opened this issue Dec 18, 2023 · 1 comment
Open

Novel minimal reservoir computing #183

MartinuzziFrancesco opened this issue Dec 18, 2023 · 1 comment
Labels
inits initializers for internal matrices states algorithms to modify reservoir states

Comments

@MartinuzziFrancesco
Copy link
Collaborator

What kind of problems is it mostly used for?

Short time series modeling, showing improved results over NGRC (see #108)

Other implementations to know about

No open implementations available at the moment

References

Paper

@MartinuzziFrancesco
Copy link
Collaborator Author

quick sketch of a possible implementation of the proposed W_in

function structured_input(rng::AbstractRNG, ::Type{T}, dims::Integer...; scaling=T(0.1)) where {T <: Number}

    res_size, input_dim = dims
    n_f = 2^input_dim - 2
    if res_size % n_f != 0
        error("res_size must be divisible by 2^input_dim - 2 (got res_size=$res_size, input_dim=$input_dim)")
    end
    b = div(res_size, n_f)  # block size
    base_weights = range(one(T), stop=zero(T), length=b)
    w = sqrt.(collect(base_weights))

    features = Vector{Vector{T}}()
    for k in 1:(input_dim - 1)
        for subset in Iterators.combinations(1:input_dim, k)
            row = zeros(T, input_dim)
            for idx in subset
                row[idx] = one(T)
            end
            push!(features, row)
        end
    end

    A = vcat([reshape(f, 1, :) for f in features]...)
    blocks = [w * reshape(A[i, :], 1, :) for i in 1:size(A, 1)]
    W_in = vcat(blocks...)
    W_in .*= scaling
    return W_in
end

@MartinuzziFrancesco MartinuzziFrancesco added states algorithms to modify reservoir states inits initializers for internal matrices and removed new model labels Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inits initializers for internal matrices states algorithms to modify reservoir states
Projects
None yet
Development

No branches or pull requests

1 participant