GetActiveSynapses() 공개 메소드

public GetActiveSynapses ( int t, bool learning, bool connectedOnly ) : List
t int
learning bool
connectedOnly bool
리턴 List
예제 #1
0
        // Return a segmentUpdate data structure containing a list of proposed changes to segment.
        // Let activeSynapses be the list of active synapses where the originating cells have
        // their activeState output = 1 at time step t.
        // (This list is empty if s = -1 since the segment doesn't exist.) newSynapses is an optional argument
        // that defaults to false. If newSynapses is true, then newSynapseCount - count(activeSynapses) synapses
        // are added to activeSynapses. These synapses are randomly chosen from the set of cells that have
        // learnState output = 1 at time step t.
        public SegmentUpdate GetSegmentActiveSynapses(int t, HTMSegment segment = null, bool newSynapses = false)
        {
            SegmentUpdate segmentUpdate = new SegmentUpdate();

            segmentUpdate.ActiveSynapses = new List <HTMSynapse>();
            segmentUpdate.NewSynapses    = new List <HTMCell>();
            segmentUpdate.AddNewSynapses = newSynapses;
            segmentUpdate.Segment        = segment;

            if (segmentUpdate.Segment != null)
            {
                segmentUpdate.ActiveSynapses = segment.GetActiveSynapses(t, false, false);
            }

            if (!newSynapses)
            {
                return(segmentUpdate);
            }

            int newSynapseCount = Math.Max(0, _newSynapseCount - segmentUpdate.ActiveSynapses.Count);

            //List<HTMCell> learningCells = GetRandomActiveCells(t);
            List <HTMCell> learningCells = GetRandomLearningCells(t);

            newSynapseCount = Math.Min(newSynapseCount, learningCells.Count);

            // Truncate the array of learning cells. To do : get a random sample of the array.
            for (int i = 0; i < newSynapseCount; i++)
            {
                segmentUpdate.NewSynapses.Add(learningCells[i]);
            }

            return(segmentUpdate);
        }
예제 #2
0
파일: HTMColumn.cs 프로젝트: avogab/dooHTM
 public void ComputeOverlap()
 {
     _overlap = _proximalSegment.GetActiveSynapses(0, false, false).Count;
     if (_overlap < _region.MinOverlap)
     {
         _overlap = 0;
     }
     else
     {
         _overlap *= _boost;
     }
 }
예제 #3
0
파일: HTMCell.cs 프로젝트: avogab/dooHTM
        // Return a segmentUpdate data structure containing a list of proposed changes to segment.
        // Let activeSynapses be the list of active synapses where the originating cells have
        // their activeState output = 1 at time step t.
        // (This list is empty if s = -1 since the segment doesn't exist.) newSynapses is an optional argument
        // that defaults to false. If newSynapses is true, then newSynapseCount - count(activeSynapses) synapses
        // are added to activeSynapses. These synapses are randomly chosen from the set of cells that have
        // learnState output = 1 at time step t.
        public SegmentUpdate GetSegmentActiveSynapses(int t, HTMSegment segment = null, bool newSynapses = false)
        {
            SegmentUpdate segmentUpdate = new SegmentUpdate();
            segmentUpdate.ActiveSynapses = new List<HTMSynapse>();
            segmentUpdate.NewSynapses = new List<HTMCell>();
            segmentUpdate.AddNewSynapses = newSynapses;
            segmentUpdate.Segment = segment;

            if (segmentUpdate.Segment != null)
                segmentUpdate.ActiveSynapses = segment.GetActiveSynapses(t, false, false);

            if (!newSynapses)
                return segmentUpdate;

            int newSynapseCount = Math.Max(0, _newSynapseCount - segmentUpdate.ActiveSynapses.Count);

            //List<HTMCell> learningCells = GetRandomActiveCells(t);
            List<HTMCell> learningCells = GetRandomLearningCells(t);

            newSynapseCount = Math.Min(newSynapseCount, learningCells.Count);

            // Truncate the array of learning cells. To do : get a random sample of the array.
            for (int i = 0 ; i < newSynapseCount; i++)
                segmentUpdate.NewSynapses.Add(learningCells[i]);

            return segmentUpdate;
        }