@@ -1281,15 +1281,27 @@ function double_cycle(rng::AbstractRNG, ::Type{T}, dims::Integer...;
12811281 return return_init_as (Val (return_sparse), reservoir_matrix)
12821282end
12831283
1284- """
1285- self_loop_cycle ([rng], [T], dims...;
1284+ @doc raw """
1285+ selfloop_cycle ([rng], [T], dims...;
12861286 cycle_weight=0.1, selfloop_weight=0.1,
12871287 return_sparse=false)
12881288
12891289Creates a simple cycle reservoir with the addition of self loops [^elsarraj2019].
12901290
12911291This architecture is referred to as TP1 in the original paper.
12921292
1293+ # Equations
1294+
1295+ ```math
1296+ W_{i,j} =
1297+ \b egin{cases}
1298+ ll, & \t ext{if } i = j \\
1299+ r, & \t ext{if } j = i - 1 \t ext{ for } i = 2 \d ots N \\
1300+ r, & \t ext{if } i = 1, j = N \\
1301+ 0, & \t ext{otherwise}
1302+ \e nd{cases}
1303+ ```
1304+
12931305# Arguments
12941306
12951307 - `rng`: Random number generator. Default is `Utils.default_rng()`
@@ -1309,15 +1321,15 @@ This architecture is referred to as TP1 in the original paper.
13091321# Examples
13101322
13111323```jldoctest
1312- julia> reservoir_matrix = self_loop_cycle (5, 5)
1324+ julia> reservoir_matrix = selfloop_cycle (5, 5)
131313255×5 Matrix{Float32}:
13141326 0.1 0.0 0.0 0.0 0.1
13151327 0.1 0.1 0.0 0.0 0.0
13161328 0.0 0.1 0.1 0.0 0.0
13171329 0.0 0.0 0.1 0.1 0.0
13181330 0.0 0.0 0.0 0.1 0.1
13191331
1320- julia> reservoir_matrix = self_loop_cycle (5, 5; weight=0.2, selfloop_weight=0.5)
1332+ julia> reservoir_matrix = selfloop_cycle (5, 5; weight=0.2, selfloop_weight=0.5)
132113335×5 Matrix{Float32}:
13221334 0.5 0.0 0.0 0.0 0.2
13231335 0.2 0.5 0.0 0.0 0.0
@@ -1330,7 +1342,7 @@ julia> reservoir_matrix = self_loop_cycle(5, 5; weight=0.2, selfloop_weight=0.5)
13301342 "Demystifying echo state network with deterministic simple topologies."
13311343 International Journal of Computational Science and Engineering 19.3 (2019): 407-417.
13321344"""
1333- function self_loop_cycle (rng:: AbstractRNG , :: Type{T} , dims:: Integer... ;
1345+ function selfloop_cycle (rng:: AbstractRNG , :: Type{T} , dims:: Integer... ;
13341346 cycle_weight= T (0.1f0 ), selfloop_weight= T (0.1f0 ),
13351347 return_sparse:: Bool = false ) where {T <: Number }
13361348 throw_sparse_error (return_sparse)
@@ -1340,7 +1352,7 @@ function self_loop_cycle(rng::AbstractRNG, ::Type{T}, dims::Integer...;
13401352 return return_init_as (Val (return_sparse), reservoir_matrix)
13411353end
13421354
1343- """
1355+ @doc raw """
13441356 selfloop_feedback_cycle([rng], [T], dims...;
13451357 cycle_weight=0.1, selfloop_weight=0.1,
13461358 return_sparse=false)
@@ -1350,6 +1362,19 @@ self loops on odd neurons [^elsarraj2019].
13501362
13511363This architecture is referred to as TP2 in the original paper.
13521364
1365+ # Equations
1366+
1367+ ```math
1368+ W_{i,j} =
1369+ \b egin{cases}
1370+ r, & \t ext{if } j = i - 1 \t ext{ for } i = 2 \d ots N \\
1371+ r, & \t ext{if } i = 1, j = N \\
1372+ ll, & \t ext{if } i = j \t ext{ and } i \t ext{ is odd} \\
1373+ r, & \t ext{if } j = i + 1 \t ext{ and } i \t ext{ is even}, i \n eq N \\
1374+ 0, & \t ext{otherwise}
1375+ \e nd{cases}
1376+ ```
1377+
13531378# Arguments
13541379
13551380 - `rng`: Random number generator. Default is `Utils.default_rng()`
@@ -1409,7 +1434,7 @@ function selfloop_feedback_cycle(rng::AbstractRNG, ::Type{T}, dims::Integer...;
14091434 return return_init_as (Val (return_sparse), reservoir_matrix)
14101435end
14111436
1412- """
1437+ @doc raw """
14131438 selfloop_delayline_backward([rng], [T], dims...;
14141439 weight=0.1, selfloop_weight=0.1,
14151440 return_sparse=false)
@@ -1419,6 +1444,18 @@ backward connections shifted by one [^elsarraj2019].
14191444
14201445This architecture is referred to as TP3 in the original paper.
14211446
1447+ # Equations
1448+
1449+ ```math
1450+ W_{i,j} =
1451+ \b egin{cases}
1452+ ll, & \t ext{if } i = j \t ext{ for } i = 1 \d ots N \\
1453+ r, & \t ext{if } j = i - 1 \t ext{ for } i = 2 \d ots N \\
1454+ r, & \t ext{if } j = i - 2 \t ext{ for } i = 3 \d ots N \\
1455+ 0, & \t ext{otherwise}
1456+ \e nd{cases}
1457+ ```
1458+
14221459# Arguments
14231460
14241461 - `rng`: Random number generator. Default is `Utils.default_rng()`
@@ -1474,7 +1511,7 @@ function selfloop_delayline_backward(rng::AbstractRNG, ::Type{T}, dims::Integer.
14741511 return return_init_as (Val (return_sparse), reservoir_matrix)
14751512end
14761513
1477- """
1514+ @doc raw """
14781515 selfloop_forward_connection([rng], [T], dims...;
14791516 weight=0.1, selfloop_weight=0.1,
14801517 return_sparse=false)
@@ -1484,6 +1521,17 @@ with the addition of self loops [^elsarraj2019].
14841521
14851522This architecture is referred to as TP4 in the original paper.
14861523
1524+ # Equations
1525+
1526+ ```math
1527+ W_{i,j} =
1528+ \b egin{cases}
1529+ ll, & \t ext{if } i = j \t ext{ for } i = 1 \d ots N \\
1530+ r, & \t ext{if } j = i - 2 \t ext{ for } i = 3 \d ots N \\
1531+ 0, & \t ext{otherwise}
1532+ \e nd{cases}
1533+ ```
1534+
14871535# Arguments
14881536
14891537 - `rng`: Random number generator. Default is `Utils.default_rng()`
@@ -1536,7 +1584,7 @@ function selfloop_forward_connection(rng::AbstractRNG, ::Type{T}, dims::Integer.
15361584 return return_init_as (Val (return_sparse), reservoir_matrix)
15371585end
15381586
1539- """
1587+ @doc raw """
15401588 forward_connection([rng], [T], dims...;
15411589 weight=0.1, selfloop_weight=0.1,
15421590 return_sparse=false)
@@ -1545,6 +1593,16 @@ Creates a reservoir based on a forward connection of weights [^elsarraj2019].
15451593
15461594This architecture is referred to as TP5 in the original paper.
15471595
1596+ # Equations
1597+
1598+ ```math
1599+ W_{i,j} =
1600+ \b egin{cases}
1601+ r, & \t ext{if } j = i - 2 \t ext{ for } i = 3 \d ots N \\
1602+ 0, & \t ext{otherwise}
1603+ \e nd{cases}
1604+ ```
1605+
15481606# Arguments
15491607
15501608 - `rng`: Random number generator. Default is `Utils.default_rng()`
@@ -1598,7 +1656,7 @@ end
15981656for initializer in (:rand_sparse , :delay_line , :delay_line_backward , :cycle_jumps ,
15991657 :simple_cycle , :pseudo_svd , :chaotic_init ,
16001658 :scaled_rand , :weighted_init , :informed_init , :minimal_init , :chebyshev_mapping ,
1601- :logistic_mapping , :modified_lm , :low_connectivity , :double_cycle , :self_loop_cycle ,
1659+ :logistic_mapping , :modified_lm , :low_connectivity , :double_cycle , :selfloop_cycle ,
16021660 :selfloop_feedback_cycle , :selfloop_delayline_backward , :selfloop_forward_connection ,
16031661 :forward_connection )
16041662 @eval begin
0 commit comments