*/
public static double printToFileAverageSDRScoreFor1RetinaTo1RegionModelForAllDigitsInMNIST(
double percentMinimumOverlapScore, double desiredLocalActivity,
double desiredPercentageOfActiveColumns,
String locationOfFileWithFileNameToSaveScore) throws IOException {
MnistManager mnistManager = new MnistManager(
"./images/digits/MNIST/t10k-images.idx3-ubyte",
"./images/digits/MNIST/t10k-labels.idx1-ubyte");
// all images in MNIST dataset are 28 x 28 pixels
Retina retina = new Retina(28, 28);
Region region = new Region("Region", 8, 8, 1,
percentMinimumOverlapScore, (int) desiredLocalActivity);
AbstractSensorCellsToRegionConnect retinaToRegion = new SensorCellsToRegionRectangleConnect();
retinaToRegion.connect(retina.getVisionCells(), region, 0, 0);
SpatialPooler spatialPooler = new SpatialPooler(region);
spatialPooler.setLearningState(true);
int numberOfImagesToSee = 1000;
double totalSDRScore = 0.0;
for (int i = 1; i < (numberOfImagesToSee + 1); i++) {
mnistManager.setCurrent(i);
int[][] image = mnistManager.readImage();
retina.see2DIntArray(image);
spatialPooler.performPooling();
Set<ColumnPosition> columnActivityAfterSeeingCurrentMNISTImage = spatialPooler
.getActiveColumnPositions();