Skip to content
Snippets Groups Projects
Commit 63761554 authored by Hammouda Elbez's avatar Hammouda Elbez :computer:
Browse files

Mongodb issues fixed

parent 66d53da9
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ class ConnectionIndex(inputLayer : NeuronGroupRef, outputLayer : NeuronGroupRef) ...@@ -18,6 +18,7 @@ class ConnectionIndex(inputLayer : NeuronGroupRef, outputLayer : NeuronGroupRef)
} }
}.toMap }.toMap
def getConnectionsBetween(input : NetworkEntityPath, output : NetworkEntityPath) : Seq[ConnectionPath] = { def getConnectionsBetween(input : NetworkEntityPath, output : NetworkEntityPath) : Seq[ConnectionPath] = {
index.getOrElse(output, Map()).getOrElse(input, Seq()) index.getOrElse(output, Map()).getOrElse(input, Seq())
} }
......
...@@ -101,18 +101,20 @@ object ExampleMnist2 extends App { ...@@ -101,18 +101,20 @@ object ExampleMnist2 extends App {
val unsupervisedLayer1 = n2s3.createNeuronGroup() val unsupervisedLayer1 = n2s3.createNeuronGroup()
.setIdentifier("Layer1") .setIdentifier("Layer1")
.setNumberOfNeurons(5) .setNumberOfNeurons(20)
.setNeuronModel(LIF, Seq( .setNeuronModel(LIF, Seq(
(MembranePotentialThreshold, 35 millivolts))) (MembranePotentialThreshold, 15 millivolts)))
val unsupervisedLayer2 = n2s3.createNeuronGroup() val unsupervisedLayer2 = n2s3.createNeuronGroup()
.setIdentifier("Layer2") .setIdentifier("Layer2")
.setNumberOfNeurons(5) .setNumberOfNeurons(10)
.setNeuronModel(LIF, Seq( .setNeuronModel(LIF, Seq(
(MembranePotentialThreshold, 5 millivolts))) (MembranePotentialThreshold, 5 millivolts)))
inputLayer.connectTo(unsupervisedLayer1, new FullConnection(() => new SimplifiedSTDP())) inputLayer.connectTo(unsupervisedLayer1, new FullConnection(() => new SimplifiedSTDP()))
var Layer1WTAconnection = unsupervisedLayer1.connectTo(unsupervisedLayer1, new FullConnection(() => new InhibitorySynapse())) var Layer1WTAconnection = unsupervisedLayer1.connectTo(unsupervisedLayer1, new FullConnection(() => new InhibitorySynapse()))
unsupervisedLayer1.connectTo(unsupervisedLayer2, new FullConnection(() => new SimplifiedSTDP()))
var Layer2WTAconnection = unsupervisedLayer2.connectTo(unsupervisedLayer2, new FullConnection(() => new InhibitorySynapse()))
n2s3.create() n2s3.create()
...@@ -161,7 +163,6 @@ object ExampleMnist2 extends App { ...@@ -161,7 +163,6 @@ object ExampleMnist2 extends App {
simTime = "Train L1" simTime = "Train L1"
n2s3.runAndWait() n2s3.runAndWait()
println(System.currentTimeMillis() - globalTime)
simTime = simTime + " | " + (System.currentTimeMillis() - globalTime) + "\n" simTime = simTime + " | " + (System.currentTimeMillis() - globalTime) + "\n"
if (log) { if (log) {
...@@ -172,8 +173,6 @@ object ExampleMnist2 extends App { ...@@ -172,8 +173,6 @@ object ExampleMnist2 extends App {
unsupervisedLayer1.fixNeurons() unsupervisedLayer1.fixNeurons()
Layer1WTAconnection.disconnect() Layer1WTAconnection.disconnect()
unsupervisedLayer1.connectTo(unsupervisedLayer2, new FullConnection(() => new SimplifiedSTDP()))
var Layer2WTAconnection = unsupervisedLayer2.connectTo(unsupervisedLayer2, new FullConnection(() => new InhibitorySynapse()))
n2s3.first = false n2s3.first = false
stream = InputMnist.DataParts(dataFile, labelFile, sizeChunk, sizeChunk) stream = InputMnist.DataParts(dataFile, labelFile, sizeChunk, sizeChunk)
inputStream.append(stream) inputStream.append(stream)
...@@ -181,7 +180,7 @@ object ExampleMnist2 extends App { ...@@ -181,7 +180,7 @@ object ExampleMnist2 extends App {
println("Start Training L2") println("Start Training L2")
var layerTolayerIndex = new ConnectionIndex(unsupervisedLayer1, unsupervisedLayer2) var layerTolayerIndex = new ConnectionIndex(unsupervisedLayer1, unsupervisedLayer2)
print(layerTolayerIndex)
var listOfConnexions2 = for (outputIndex <- 0 until unsupervisedLayer2.shape.getNumberOfPoints) yield { var listOfConnexions2 = for (outputIndex <- 0 until unsupervisedLayer2.shape.getNumberOfPoints) yield {
for (_ <- 0 until 1) yield { for (_ <- 0 until 1) yield {
for { for {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment