Skip to content

Commit 48ff82d

Browse files
making sparsearrays external
1 parent 44fe813 commit 48ff82d

File tree

4 files changed

+74
-52
lines changed

4 files changed

+74
-52
lines changed

Project.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ReservoirComputing"
22
uuid = "7c2d2b1e-3dd4-11ea-355a-8f6a8116e294"
33
authors = ["Francesco Martinuzzi"]
4-
version = "0.10.10"
4+
version = "0.10.11"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -11,17 +11,18 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1111
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
1212
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1313
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
14-
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1514
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1615
WeightInitializers = "d49dbf32-c5c2-4618-8acc-27bb2598ef2d"
1716

1817
[weakdeps]
1918
LIBSVM = "b1bec4e5-fd48-53fe-b0cb-9723c09d164b"
2019
MLJLinearModels = "6ee0df7b-362f-4a72-a706-9e79364fb692"
20+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2121

2222
[extensions]
2323
RCLIBSVMExt = "LIBSVM"
2424
RCMLJLinearModelsExt = "MLJLinearModels"
25+
RCSparseArraysExt = "SparseArrays"
2526

2627
[compat]
2728
Adapt = "4.1.1"
@@ -48,10 +49,11 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
4849
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
4950
LIBSVM = "b1bec4e5-fd48-53fe-b0cb-9723c09d164b"
5051
MLJLinearModels = "6ee0df7b-362f-4a72-a706-9e79364fb692"
52+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
5153
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
5254
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
5355
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5456

5557
[targets]
5658
test = ["Aqua", "Test", "SafeTestsets", "DifferentialEquations",
57-
"MLJLinearModels", "LIBSVM", "Statistics"]
59+
"MLJLinearModels", "LIBSVM", "Statistics", "SparseArrays"]

ext/RCSparseArraysExt.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module RCSparseArraysExt
2+
import ReservoirComputing: return_init_as
3+
using SparseArrays: sparse
4+
5+
function return_init_as(::Val{true}, layer_matrix::AbstractVecOrMat)
6+
return sparse(layer_matrix)
7+
end
8+
9+
end #module

src/ReservoirComputing.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ using LinearAlgebra: eigvals, mul!, I, qr
77
using NNlib: fast_act, sigmoid
88
using Random: Random, AbstractRNG
99
using Reexport: Reexport, @reexport
10-
using SparseArrays: sparse
1110
using StatsBase: sample
1211
using WeightInitializers: DeviceAgnostic, PartialFunction, Utils
1312
@reexport using WeightInitializers

0 commit comments

Comments
 (0)