Example #1
0
    def setupMCToGCSynapseProbes(self):
        """ setup the MC->GC synapse probes """
        prbCond = nx.IntervalProbeCondition(tStart=1, dt=1)
        prbParams = [nx.ProbeParameter.SYNAPSE_WEIGHT,
                     nx.ProbeParameter.SYNAPSE_DELAY,
                     nx.ProbeParameter.PRE_TRACE_X1]
        # nx.ProbeParameter.POST_TRACE_Y1],
        self.exc2InhConnProbes = list()
        for delayIdx in range(self.numMCToGCDelays):
            connGrp = self.mcToGCConnGrpsPerDelay[delayIdx]
            connGrpPrb = connGrp.probe(prbParams,
                                       probeConditions=[prbCond] * len(prbParams))

            self.exc2InhConnProbes.append(connGrpPrb)
Example #2
0
    def setupGCToMCSynapseProbes(self):
        """ setup the GC->MC synapse probes """
        self.inh2ExcConnProbesPos = list()
        self.inh2ExcConnProbesNeg = list()
        prbCond = nx.IntervalProbeCondition(tStart=1, dt=100)
        prbParams = [nx.ProbeParameter.SYNAPSE_WEIGHT,
                     nx.ProbeParameter.SYNAPSE_DELAY,
                     nx.ProbeParameter.PRE_TRACE_X1]
        # nx.ProbeParameter.POST_TRACE_Y1],
        for idx in range(self.numColumns):
            ConnGrp = self.gcToMCConnGrpsPerCore[idx]

            posConnGrpPrb = ConnGrp.posConnGrp.probe(prbParams,
                                                     probeConditions=[prbCond] * len(prbParams))
            negConnGrpPrb = ConnGrp.negConnGrp.probe(prbParams,
                                                     probeConditions=[prbCond] * len(prbParams))
            self.inh2ExcConnProbesPos.append(posConnGrpPrb)
            self.inh2ExcConnProbesNeg.append(negConnGrpPrb)
Example #3
0
def addProbes(self):
    # Add voltage probe for excitatory network
    if self.p.isExVoltageProbe:
        for idx, net in enumerate(self.exReservoirChunks):
            self.exVoltageProbes.append(
                net.probe([nx.ProbeParameter.COMPARTMENT_VOLTAGE])[0])

    # Add voltage probe for inhibitory network
    if self.p.isInVoltageProbe:
        for idx, net in enumerate(self.inReservoirChunks):
            self.inVoltageProbes.append(
                net.probe([nx.ProbeParameter.COMPARTMENT_VOLTAGE])[0])

    # Add voltage probe for output neurons
    if self.p.isOutVoltageProbe:
        for idx, net in enumerate(self.outputLayerChunks):
            self.outVoltageProbes.append(
                net.probe([nx.ProbeParameter.COMPARTMENT_VOLTAGE])[0])

    # Add current probe for excitatory network
    if self.p.isExCurrentProbe:
        for idx, net in enumerate(self.exReservoirChunks):
            self.exCurrentProbes.append(
                net.probe([nx.ProbeParameter.COMPARTMENT_CURRENT])[0])

    # Add current probe for inhibitory network
    if self.p.isInCurrentProbe:
        for idx, net in enumerate(self.inReservoirChunks):
            self.inCurrentProbes.append(
                net.probe([nx.ProbeParameter.COMPARTMENT_CURRENT])[0])

    # Probe weights
    if self.p.isWeightProbe:
        probeCond = nx.IntervalProbeCondition(tStart=self.p.totalSteps - 1,
                                              dt=self.p.totalSteps)
        #probeCond = nx.IntervalProbeCondition(tStart=self.p.stepsPerIteration-1, dt=self.p.stepsPerIteration)
        n, m = np.shape(self.connectionChunks)
        for i in range(n):
            tmp = []
            for j in range(m):
                tmp.append(self.connectionChunks[i][j].probe(
                    [nx.ProbeParameter.SYNAPSE_WEIGHT],
                    probeConditions=[probeCond]))
            self.weightProbes.append(tmp)

    # Add spike probe for excitatory network
    if self.p.isExSpikeProbe:
        #probeCond = nx.SpikeProbeCondition(tStart=1, dt=5)
        for net in self.exReservoirChunks:
            self.exSpikeProbes.append(net.probe([
                nx.ProbeParameter.SPIKE
            ])[0])  #, probeConditions=[probeCond])[0])

    # Add spike probe for excitatory network
    if self.p.isInSpikeProbe:
        #probeCond = nx.SpikeProbeCondition(tStart=1, dt=5)
        for net in self.inReservoirChunks:
            self.inSpikeProbes.append(net.probe([
                nx.ProbeParameter.SPIKE
            ])[0])  #, probeConditions=[probeCond])[0])

    # Add spike probe for output neurons
    if self.p.isOutSpikeProbe:
        for net in self.outputLayerChunks:
            self.outSpikeProbes.append(net.probe([nx.ProbeParameter.SPIKE])[0])

    # Log that probes were added to network
    logging.info('Probes added to Loihi network')