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

What's a good way to deal with matrices containing Infs or NANs? #180

Open
AraujoH opened this issue Nov 14, 2023 · 5 comments
Open

What's a good way to deal with matrices containing Infs or NANs? #180

AraujoH opened this issue Nov 14, 2023 · 5 comments

Comments

@AraujoH
Copy link

AraujoH commented Nov 14, 2023

I have been using ReservoirComputing.jl for a while a now, and one error I get sometimes is the one about a matrix containing Infs and NaNs. This happens, as far as I know, when the random matrix of ESN can't be decomposed/factored. I have run ENS successfully just to have it crash when I increased/decreased the reservoir size (without changing anything else).

Is there a way to deal with this issue? Is there a known/common work around?

@MartinuzziFrancesco
Copy link
Member

In what reservoir initializer does this happen? I have a (somewhat primitive) workaround here, because this usually happens for specific corner cases like low reservoir size or low sparsity

@AraujoH
Copy link
Author

AraujoH commented Nov 14, 2023

Hello, @MartinuzziFrancesco. Thank you for such a prompt reply. At the moment, I'm building off a reservoir I get from one of the examples in the ReservoirComputing.jl page. The specs are:

    res_size = reservoirsize
    res_radius = 1.2
    res_sparsity = 6 / 300
    input_scaling = 0.1

    ### Build ESN structure
    esn = ESN(
        input_data;
        variation=Default(),
        reservoir=RandSparseReservoir(res_size, radius=res_radius, sparsity=res_sparsity),
        input_layer=WeightedLayer(scaling=input_scaling),
        reservoir_driver=RNN(),
        nla_type=NLADefault(),
        states_type=StandardStates()
        )

I'm trying to vary the reservoirsize variable from 100 to 1000 in increments of 100.

@MartinuzziFrancesco
Copy link
Member

ok I see, the matrices probably get too sparse towards the end of the range. I'll play around a little and try to push a small fix

@AraujoH
Copy link
Author

AraujoH commented Nov 14, 2023

Thanks a lot, @MartinuzziFrancesco

@MartinuzziFrancesco
Copy link
Member

Anytime! thank you for pointing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants