Skip to content

Make use of SparseArrays.jl #243

@MartinuzziFrancesco

Description

@MartinuzziFrancesco

In a lot of initializers for ESNs the majority of the entries are zero (>90%). An earlier version of ReservoirComputing.jl used SparseArrays to build them, but this has since changed. It would help computation times to make full use of sparse matrices when possible. This could be also be left as a choice to the user, adding something like

#init_reservoir is any reservoir initializer here
julia> reservoir_matrix = init_reservoir(10, 10; return_sparse = true)
10×10 SparseMatrixCSC{Float32, Int64} with 10 stored entries:
          -1.16794                                                  1.03808
                             -1.25129                                  
                                         0.952151                      
                                                                      
                                                                      
                                                                     
                                                  -2.04221             
 0.599564                                                   -1.06445    
                                                                      
                   -0.826278                                           

I think the reason it was removed before had to do with the regression training, so this would need to be tested on it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions