Exemplo n.º 1
0
 /**
  * Return the overlap to connected counts ratio for a given column
  *
  * @param c
  * @param overlaps
  * @return
  */
 public double[] calculateOverlapPct(Connections c, int[] overlaps) {
   return ArrayUtils.divide(overlaps, c.getConnectedCounts().getTrueCounts());
 }
Exemplo n.º 2
0
 /**
  * This function determines each column's overlap with the current input vector. The overlap of a
  * column is the number of synapses for that column that are connected (permanence value is
  * greater than '_synPermConnected') to input bits which are turned on. Overlap values that are
  * lower than the 'stimulusThreshold' are ignored. The implementation takes advantage of the
  * SpraseBinaryMatrix class to perform this calculation efficiently.
  *
  * @param c the {@link Connections} memory encapsulation
  * @param inputVector an input array of 0's and 1's that comprises the input to the spatial
  *     pooler.
  * @return
  */
 public int[] calculateOverlap(Connections c, int[] inputVector) {
   int[] overlaps = new int[c.getNumColumns()];
   c.getConnectedCounts().rightVecSumAtNZ(inputVector, overlaps, c.getStimulusThreshold());
   return overlaps;
 }