Skip to content

Commit 2cdcee1

Browse files
author
cogmission
committed
Ported new duty cycle, and new mapPotential methods and tests
1 parent bd3677c commit 2cdcee1

File tree

4 files changed

+604
-488
lines changed

4 files changed

+604
-488
lines changed

src/main/java/org/numenta/nupic/Connections.java

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import org.numenta.nupic.util.FlatMatrix;
5757
import org.numenta.nupic.util.SparseMatrix;
5858
import org.numenta.nupic.util.SparseObjectMatrix;
59+
import org.numenta.nupic.util.Topology;
5960
import org.numenta.nupic.util.Tuple;
6061
import org.numenta.nupic.util.UniversalRandom;
6162

@@ -112,7 +113,11 @@ public class Connections implements Persistable {
112113

113114
public double[] boostedOverlaps;
114115
public int[] overlaps;
115-
116+
117+
/** Manages input neighborhood transformations */
118+
private Topology inputTopology;
119+
/** Manages column neighborhood transformations */
120+
private Topology columnTopology;
116121
/** A matrix representing the shape of the input. */
117122
protected SparseMatrix<?> inputMatrix;
118123
/**
@@ -153,8 +158,8 @@ public class Connections implements Persistable {
153158

154159
private double[] overlapDutyCycles;
155160
private double[] activeDutyCycles;
156-
private double[] minOverlapDutyCycles;
157-
private double[] minActiveDutyCycles;
161+
private volatile double[] minOverlapDutyCycles;
162+
private volatile double[] minActiveDutyCycles;
158163
private double[] boostFactors;
159164

160165
/////////////////////////////////////// Temporal Memory Vars ///////////////////////////////////////////
@@ -380,6 +385,44 @@ public void setMemory(SparseObjectMatrix<Column> mem) {
380385
public SparseObjectMatrix<Column> getMemory() {
381386
return memory;
382387
}
388+
389+
/**
390+
* Returns the {@link Topology} overseeing input
391+
* neighborhoods.
392+
* @return
393+
*/
394+
public Topology getInputTopology() {
395+
return inputTopology;
396+
}
397+
398+
/**
399+
* Sets the {@link Topology} overseeing input
400+
* neighborhoods.
401+
*
402+
* @param topology the input Topology
403+
*/
404+
public void setInputTopology(Topology topology) {
405+
this.inputTopology = topology;
406+
}
407+
408+
/**
409+
* Returns the {@link Topology} overseeing {@link Column}
410+
* neighborhoods.
411+
* @return
412+
*/
413+
public Topology getColumnTopology() {
414+
return columnTopology;
415+
}
416+
417+
/**
418+
* Sets the {@link Topology} overseeing {@link Column}
419+
* neighborhoods.
420+
*
421+
* @param topology the column Topology
422+
*/
423+
public void setColumnTopology(Topology topology) {
424+
this.columnTopology = topology;
425+
}
383426

384427
/**
385428
* Returns the input column mapping
@@ -1071,6 +1114,10 @@ public double[] getOverlapDutyCycles() {
10711114
return overlapDutyCycles;
10721115
}
10731116

1117+
/**
1118+
* Sets the overlap duty cycles
1119+
* @param overlapDutyCycles
1120+
*/
10741121
public void setOverlapDutyCycles(double[] overlapDutyCycles) {
10751122
this.overlapDutyCycles = overlapDutyCycles;
10761123
}

0 commit comments

Comments
 (0)