public void SynapseBasalCtorTest() { for (int testNum = 0; testNum < Global.Tests.TestNumLoops; testNum++) { Column col = new Column(0, 0, 1); SynapseBasal syn = new SynapseBasal(col); Assert.AreSame(syn.ColumnConnected, col); Assert.IsTrue(syn.Permanence >= 0.0); Assert.IsTrue(syn.Permanence <= 1.0); Assert.IsFalse(syn.IsActive); } }
public void SynapseBasalOverrideTest() { for (int testNum = 0; testNum < Global.Tests.TestNumLoops; testNum++) { Column col = new Column(0, 0, 3); SynapseBasal syn = new SynapseBasal(col); syn.OverridePermanence(1.0); //test override active syn.Override(true, 0); Assert.IsTrue(syn.IsActive); Assert.IsTrue(col.Cells[0].IsPredicting); Assert.IsTrue(col.Cells[1].IsPredicting); Assert.IsTrue(col.Cells[2].IsPredicting); syn.Override(false, 0); Assert.IsFalse(syn.IsActive); Assert.IsFalse(col.Cells[0].IsPredicting); Assert.IsFalse(col.Cells[1].IsPredicting); Assert.IsFalse(col.Cells[2].IsPredicting); //test override permanence syn.OverridePermanence(-0.5); Assert.IsTrue(syn.Permanence == 0); syn.OverridePermanence(9999.99); Assert.IsTrue(syn.Permanence == 1.0); syn.OverridePermanence(NetConfigData.SynapsePermanenceThreshold + 0.01); Assert.IsTrue(syn.Permanence > NetConfigData.SynapsePermanenceThreshold); Assert.IsTrue(syn.Permanence <= 1.0); //test override of connected column syn.Override(true, 0); Assert.IsTrue(col.IsPredicting); syn.Override(false, 0); Assert.IsFalse(col.IsPredicting); } }
public void SynapseBasalUpdateTest() { Random rnd = Global.rnd; NetConfigData.SetDefaults(); for (int testNum = 0; testNum < Global.Tests.TestNumLoops; testNum++) { Column col = new Column(0, 0, rnd.Next(1, 10)); SynapseBasal syn = new SynapseBasal(col); //predicting column col.OverridePredicting(true, 0); syn.OverridePermanence(NetConfigData.SynapsePermanenceThreshold + NetConfigData.SynapsePermanenceIncrease); syn.Update(); Assert.IsTrue(syn.IsActive); //drop permanence col.OverridePredicting(true, 0); syn.OverridePermanence(NetConfigData.SynapsePermanenceThreshold - 2 * NetConfigData.SynapsePermanenceIncrease); syn.Update(); Assert.IsFalse(syn.IsActive); //false on first update syn.Update(); Assert.IsTrue(syn.IsActive); //true on second update //column not predicting col.OverridePredicting(false, 0); syn.OverridePermanence(NetConfigData.SynapsePermanenceThreshold + NetConfigData.SynapsePermanenceIncrease); syn.Update(); Assert.IsFalse(syn.IsActive); //column predicting col.OverridePredicting(true, 0); syn.OverridePermanence(NetConfigData.SynapsePermanenceThreshold + NetConfigData.SynapsePermanenceIncrease); syn.Update(); Assert.IsTrue(syn.IsActive); //random permanence, column active col.OverridePredicting(true, 0); syn.OverridePermanence(rnd.NextDouble()); syn.Update(); if (syn.Permanence >= NetConfigData.SynapsePermanenceThreshold) { Assert.IsTrue(syn.IsActive); } else { Assert.IsFalse(syn.IsActive); } //random permanence, column not active col.OverridePredicting(false, 0); syn.OverridePermanence(rnd.NextDouble()); syn.Update(); if (syn.Permanence >= NetConfigData.SynapsePermanenceThreshold) { Assert.IsFalse(syn.IsActive); } else { Assert.IsFalse(syn.IsActive); } } }
public void CellUpdateTest() { Random rnd = Global.rnd; NetConfigData.SetDefaults(); //override global params NetConfigData.ColumnsTopPercentile = 0; NetConfigData.ColumnStimulusThreshold = 1; NetConfigData.SynapsePermanenceIncrease = 0.0; NetConfigData.SynapsePermanenceDecrease = 0.0; for (int testNum = 0; testNum < Global.Tests.TestNumLoops; testNum++) { Debug.WriteLine("CellUpdateTest testNum=" + testNum.ToString()); //Layer int layerColumnsX = rnd.Next(1, 10); int layerColumnsY = layerColumnsX > 1 ? rnd.Next(1, 10) : rnd.Next(2, 10); int layerNumCellsInColumn = rnd.Next(1, 5); Layer lr = new Layer(layerColumnsX, layerColumnsY, layerNumCellsInColumn); int lrNumColumns = lr.NumColumnsX * lr.NumColumnsY; // create synapses //lr.ConnectBasal(1, 1); lr.ConnectColumns(null); lr.Override(false, false); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsFalse(col.IsPredicting); } } } lr.Override(false, true); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsTrue(col.IsPredicting); } } } lr.Override(true, false); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsFalse(col.IsPredicting); } } } lr.Override(true, true); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsTrue(col.IsPredicting); } } } //decrease Basal permanences lr.Override(false, false); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold - 2 * NetConfigData.SynapsePermanenceIncrease); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after second update } } } NetConfigData.SynapsePermanenceIncrease = 0.01; NetConfigData.SynapsePermanenceDecrease = 0.01; lr.Override(false, true); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold - 2 * NetConfigData.SynapsePermanenceIncrease); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsTrue(cell.IsPredicting); //true after second update } } } lr.Override(true, false); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold - 2 * NetConfigData.SynapsePermanenceIncrease); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after second update } } } lr.Override(true, true); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold - 2 * NetConfigData.SynapsePermanenceIncrease); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsTrue(cell.IsPredicting); //true after second update } } } //increase Basal permanences lr.Override(false, false); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after second update } } } lr.Override(false, true); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsTrue(cell.IsPredicting); //true after first update cell.Update(); Assert.IsTrue(cell.IsPredicting); //true after second update } } } lr.Override(true, false); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after second update } } } lr.Override(true, true); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.Update(); Assert.IsTrue(cell.IsPredicting); //true after first update cell.Update(); Assert.IsTrue(cell.IsPredicting); //true after second update } } } //need to implement following tests: // //1. col Active 0 Predicting 0 //2. col Active 0 Predicting 1 //3. col Active 1 Predicting 0 //4. col Active 1 Predicting 1 // //with following variants: // //a. due to EXTERNAL factors // // Predicting - own Layer Predicting 0 // //b. due to INTERNAL factors // // // Predicting - BasalDendrite // - due to number of BasalSynapses to own Layer columns // - due to BasalSynapses Permanence values // Predicting - own Layer Predicting 0 lr.OverrideActive(true); lr.OverridePredicting(true); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.BasalDendrite.OverrideActivationThreshold(Global.DENDRITE_INITIAL_ACTIVATION_THRESHOLD + 1); foreach (SynapseBasal syn in cell.BasalDendrite.Synapses) { syn.ColumnConnected.OverridePredicting(false, 0); } cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after second update } } } lr.OverrideBasalDendriteActivationThreshold(1); // Predicting - BasalDendrite // - due to number of BasalSynapses to own Layer columns lr.OverrideActive(true); lr.OverridePredicting(true); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { //require X synapses active to activate cell.BasalDendrite.OverrideActivationThreshold(cell.BasalDendrite.Synapses.Count - rnd.Next(1, 10)); //remove snapses until less than threshold while (cell.BasalDendrite.Synapses.Count >= cell.BasalDendrite.ActivationThreshold) { SynapseBasal syn = cell.BasalDendrite.Synapses[0]; cell.BasalDendrite.Synapses.Remove(syn); } cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after second update } } } //lr.ConnectBasal(1, 1); lr.ConnectColumns(null); lr.OverrideBasalDendriteActivationThreshold(1); // Predicting - BasalDendrite // - due to BasalSynapses Permanence values lr.OverrideActive(true); lr.OverridePredicting(true); for (int x = 0; x < lr.NumColumnsX; x++) { for (int y = 0; y < lr.NumColumnsY; y++) { Column col = lr.Columns[x][y]; foreach (Cell cell in col.Cells) { cell.BasalDendrite.OverridePermanence(NetConfigData.SynapsePermanenceThreshold - 2 * NetConfigData.SynapsePermanenceIncrease); cell.Update(); Assert.IsFalse(cell.IsPredicting); //false after first update cell.Update(); Assert.IsTrue(cell.IsPredicting); //true after second update } } } } //restore global params NetConfigData.SetDefaults(); }
public void ColumnUpdate_ColumnLevelTest() { Random rnd = Global.rnd; NetConfigData.SetDefaults(); for (int testNum = 0; testNum < Global.Tests.TestNumLoops; testNum++) { Debug.WriteLine("ColumnUpdateBasalTest testNum=" + testNum.ToString()); //Layer int layerColumnsX = rnd.Next(1, 10); int layerColumnsY = layerColumnsX > 1 ? rnd.Next(1, 10) : rnd.Next(2, 10); int layerNumCellsInColumn = rnd.Next(1, 5); //layerColumnsX = 2; //layerColumnsY = 4; //layerNumCellsInColumn = 2; Layer lr = new Layer(layerColumnsX, layerColumnsY, layerNumCellsInColumn); //InputPlane int ipColumnsX = rnd.Next(1, 20); int ipColumnsY = rnd.Next(1, 20); //ipColumnsX = 4; //ipColumnsY = 12; InputPlane ip = new InputPlane(ipColumnsX, ipColumnsY); // create synapses //lr.ConnectProximal(ip, 1, 1); //lr.ConnectBasal(1, 1); lr.ZoneSizePercProximal = 1.0; lr.ZoneCoveragePercProximal = 1.0; lr.ZoneSizePercBasal = 1.0; lr.ZoneCoveragePercBasal = 1.0; lr.ConnectColumns(ip); //uses Leyer.ZoneSizePercProximal, ZoneCoveragePercProximal, Basal lr.OverrideBasalPermanences(1.0); lr.OverrideProximalPermanences(1.0); lr.OverrideProximalDendriteActivationThreshold(Global.DENDRITE_INITIAL_ACTIVATION_THRESHOLD); lr.OverrideBasalDendriteActivationThreshold(Global.DENDRITE_INITIAL_ACTIVATION_THRESHOLD); lr.InhibitionEnabled = false; int lrNumColumns = lr.NumColumnsX * lr.NumColumnsY; int ipNumColumns = ip.NumColumnsX * ip.NumColumnsY; foreach (List <Column> colRow in lr.Columns) { foreach (Column col in colRow) { col.CreateProximalSynapses(lr, ip, double.MaxValue, 1); col.CreateBasalSynapses(lr, double.MaxValue, 1); Assert.AreEqual(col.ProximalDendrite.Synapses.Count, ipNumColumns); //need to implement following tests: // //1. col Active 0 Predicting 0 //2. col Active 0 Predicting 1 //3. col Active 1 Predicting 0 //4. col Active 1 Predicting 1 // //with following variants: // //a. due to EXTERNAL factors // // Active - InputPlane Activations 0 // Predicting - own Layer Predicting 0 // //b. due to INTERNAL factors // // Active - ProximalDendrite // - due number of ProximalSynapses to InputPlane columns // - due to ProximalSynapses Permanence values // // Predicting - BasalDendrite // - due to number of BasalSynapses to own Layer columns // - due to BasalSynapses Permanence values lr.Override(false, false); lr.OverrideProximalInputOverlap(0); Assert.IsFalse(col.IsActive); Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 0); col.Update_Basal(); Assert.IsFalse(col.IsActive); Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 0); lr.Override(true, false); lr.OverrideProximalInputOverlap(1); Assert.IsTrue(col.IsActive); Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 1); col.Update_Proximal(); List <Column> neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 1); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsTrue(col.IsActive); Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, col.ProximalDendrite.Synapses.Count); lr.Override(false, true); lr.OverrideProximalInputOverlap(1); Assert.IsFalse(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 1); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 1); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsFalse(col.IsActive); Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 0); lr.Override(true, true); lr.OverrideProximalInputOverlap(1); Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 1); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 1); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, col.ProximalDendrite.Synapses.Count); //IsActive - Proximal Synapses Active OFF lr.Override(true, true); lr.OverrideProximalInputOverlap(1); foreach (SynapseProximal syn in col.ProximalDendrite.Synapses) { syn.ColumnConnected.OverrideActive(false, 2); } Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 1); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 1); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsFalse(col.IsActive); Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 0); //IsPredicting - Basal ConnectedCells Active OFF lr.Override(true, true); lr.OverrideProximalInputOverlap(1); foreach (Cell cell in col.Cells) { foreach (SynapseBasal syn in cell.BasalDendrite.Synapses) { syn.ColumnConnected.OverridePredicting(false, 2); } } Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 1); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 1); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsTrue(col.IsActive); Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, col.ProximalDendrite.Synapses.Count); // Active - ProximalDendrite // - due number of ProximalSynapses to InputPlane lr.Override(true, true); lr.OverrideProximalInputOverlap(1); col.ProximalDendrite.OverrideActivationThreshold(col.ProximalDendrite.Synapses.Count - rnd.Next(0, 5)); while (col.ProximalDendrite.Synapses.Count >= col.ProximalDendrite.ActivationThreshold && col.ProximalDendrite.Synapses.Count > 1) //leave at least 1 synapse { SynapseProximal syn = col.ProximalDendrite.Synapses[0]; col.ProximalDendrite.Synapses.Remove(syn); } Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 1); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 1); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, col.ProximalDendrite.Synapses.Count); //all remaining synapses //lr.ConnectProximal(ip, 1, 1); //lr.ConnectBasal(1, 1); lr.ZoneSizePercProximal = 1.0; lr.ZoneCoveragePercProximal = 1.0; lr.ZoneSizePercBasal = 1.0; lr.ZoneCoveragePercBasal = 1.0; lr.ConnectColumns(ip); lr.OverrideProximalPermanences(NetConfigData.SynapsePermanenceThreshold); lr.OverrideProximalDendriteActivationThreshold(Global.DENDRITE_INITIAL_ACTIVATION_THRESHOLD); // Active - ProximalDendrite // - due to ProximalSynapses Permanence values lr.Override(true, true); lr.OverrideProximalInputOverlap(0); lr.InhibitionEnabled = false; col.ProximalDendrite.OverridePermanence(NetConfigData.SynapsePermanenceThreshold - 2 * NetConfigData.SynapsePermanenceIncrease); Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 0); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 0); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsFalse(col.IsActive); //first update - false Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 0); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 0); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsTrue(col.IsActive); //second update - true //*********************** FAILS HERE Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, col.ProximalDendrite.Synapses.Count); lr.OverrideProximalPermanences(NetConfigData.SynapsePermanenceThreshold); // Predicting - BasalDendrite // - due to number of BasalSynapses to own Layer columns lr.Override(true, true); lr.OverrideProximalInputOverlap(0); foreach (Cell cell in col.Cells) { cell.BasalDendrite.OverrideActivationThreshold(cell.BasalDendrite.Synapses.Count - rnd.Next(0, 5)); while (cell.BasalDendrite.Synapses.Count >= cell.BasalDendrite.ActivationThreshold) { SynapseBasal syn = cell.BasalDendrite.Synapses[0]; cell.BasalDendrite.Synapses.Remove(syn); } } Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 0); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 0); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsTrue(col.IsActive); Assert.IsFalse(col.IsPredicting); Assert.AreEqual(col.InputOverlap, col.ProximalDendrite.Synapses.Count); //lr.ConnectBasal(1, 1); //lr.ConnectProximal(ip, 1, 1); lr.ZoneSizePercProximal = 1.0; lr.ZoneCoveragePercProximal = 1.0; lr.ZoneSizePercBasal = 1.0; lr.ZoneCoveragePercBasal = 1.0; lr.ConnectColumns(ip); lr.OverrideBasalPermanences(NetConfigData.SynapsePermanenceThreshold); lr.OverrideBasalDendriteActivationThreshold(Global.DENDRITE_INITIAL_ACTIVATION_THRESHOLD); // Predicting - BasalDendrite // - due to BasalSynapses Permanence values lr.Override(true, true); lr.OverrideProximalInputOverlap(0); foreach (Cell cell in col.Cells) { cell.BasalDendrite.OverridePermanence(NetConfigData.SynapsePermanenceThreshold - 2 * NetConfigData.SynapsePermanenceIncrease); } Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); Assert.AreEqual(col.InputOverlap, 0); col.Update_Proximal(); neighbours = lr.GetColumnsFromCentre_WithThreshold(col.X, col.Y, double.MaxValue, true, 0); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsTrue(col.IsActive); Assert.IsFalse(col.IsPredicting); //first update - false Assert.AreEqual(col.InputOverlap, col.ProximalDendrite.Synapses.Count); col.Update_Proximal(); col.Update_Activation(neighbours, false); col.Update_Basal(); Assert.IsTrue(col.IsActive); Assert.IsTrue(col.IsPredicting); //second update - true Assert.AreEqual(col.InputOverlap, col.ProximalDendrite.Synapses.Count); } } } }