-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFeedbackSynapses.cs
67 lines (60 loc) · 1.51 KB
/
FeedbackSynapses.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
namespace SLN
{
/// <summary>
/// Feedback synapses created between the two SOSLs.
/// Used only in phase B and from the 2nd simulation.
/// </summary>
[Serializable]
internal class FeedbackSynapses : List<Synapse>
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="win1old">The winner of SOSL #1 at t-1</param>
/// <param name="win1curr">The winner of SOSL #1 at t</param>
/// <param name="win2">The winner of SOSL #2</param>
internal FeedbackSynapses(WinnerCluster win1old, WinnerCluster win1curr, WinnerCluster win2)
: base()
{
#region SOSL #1 -> SOSL #2
foreach (Neuron start in win1old)
foreach (Neuron dest in win2)
{
Synapse s = new Synapse(
start,
dest,
Constants.FEEDBACK_W,
Constants.FEEDBACK_TAU,
Constants.FEEDBACK_DELAY_STEP,
Constants.FEEDBACK_SYNAPTIC_GAIN);
this.Add(s);
}
#endregion
#region SOSL #2 -> SOSL #1
foreach (Neuron start in win2)
foreach (Neuron dest in win1curr)
{
Synapse s = new Synapse(
start,
dest,
Constants.FEEDBACK_W,
Constants.FEEDBACK_TAU,
Constants.FEEDBACK_DELAY_STEP,
Constants.FEEDBACK_SYNAPTIC_GAIN);
this.Add(s);
}
#endregion
}
/// <summary>
/// Simulate the feedback synapses
/// </summary>
/// <param name="step">the simulation step</param>
internal void simulate(int step)
{
foreach (Synapse s in this)
s.simulate(step);
}
}
}