-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (30 loc) · 1.89 KB
/
Copy pathProgram.cs
File metadata and controls
36 lines (30 loc) · 1.89 KB
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
using DynamicEngramSimulator;
var started = new DateTimeOffset(2026, 7, 16, 12, 0, 0, TimeSpan.Zero);
var options = new DynamicEngramOptions
{
NeuronCount = 300,
DefaultEngramSize = 30,
DriftFractionPerDay = 0.05,
RecallIterations = 6,
RecurrentGain = 1.5,
PairInhibitionRate = 1,
RandomSeed = 20260716,
};
var simulation = new EngramSimulation(started, options);
MemoryStimulus station = StimulusFactory.Sparse(options.NeuronCount, activeChannels: 120, seed: 10);
MemoryStimulus similarStation = StimulusFactory.Related(station, retainedFraction: 0.70, seed: 11);
EngramSnapshot original = simulation.Encode(new("morning train", station), started);
EngramSnapshot competitor = simulation.Encode(new("evening train", similarStation), started);
simulation.TrainInhibitorySeparation(original.MemoryId, competitor.MemoryId, amount: 1);
RecallCue firstCue = simulation.CreatePartialCue(original.MemoryId, memberFraction: 0.20, seed: 12);
RecallResult firstRecall = simulation.Recall(firstCue, started);
simulation.AdvanceTo(started.AddDays(30));
EngramSnapshot drifted = simulation.GetEngram(original.MemoryId);
RecallCue laterCue = simulation.CreatePartialCue(original.MemoryId, memberFraction: 0.20, seed: 12);
RecallResult laterRecall = simulation.Recall(laterCue, started.AddDays(30));
EngramComparison comparison = EngramMetrics.Compare(original, drifted, firstRecall, laterRecall);
Console.WriteLine($"Initial recall: success={firstRecall.Success}, margin={firstRecall.SelectivityMargin:F4}");
Console.WriteLine($"Day 30 recall: success={laterRecall.Success}, margin={laterRecall.SelectivityMargin:F4}");
Console.WriteLine($"Population identity: {comparison.PopulationIdentity:P1}");
Console.WriteLine($"Behavioral stability: {comparison.BehavioralStability:P1}");
Console.WriteLine($"Members retained/added/removed: {comparison.RetainedNeurons}/{comparison.AddedNeurons}/{comparison.RemovedNeurons}");