def build(self):
        weights = self._create_nn_unit_weights(self.linearsize, self.dimension)

        self.neurons = [
            pynn.Population(1, self.model)
            for _ in range(self.linearsize**self.dimension)
        ]
        self.exsources = pynn.Population(self.nsources,
                                         pynn.SpikeSourcePoisson,
                                         {'rate': self.sourcerate})
        self.insources = pynn.Population(self.nsources,
                                         pynn.SpikeSourcePoisson,
                                         {'rate': self.sourcerate})
        self.biasneurons = pynn.Population(self.nbiasneurons, self.model)

        connector = pynn.FixedNumberPreConnector(n=self.ksources, weights=0.3)
        proj = pynn.Projection(self.exsources,
                               self.neurons,
                               connector,
                               target='excitatory',
                               rng=pynn.NativeRNG(42))
        proj = pynn.Projection(self.exsources,
                               self.neurons,
                               connector,
                               target='inhibitory',
                               rng=pynn.NativeRNG(42))

        connector = pynn.FixedNumberPreConnector(n=self.nbiasneurons,
                                                 weights=0.4)
        proj = pynn.Projection(self.biasneurons,
                               self.neurons,
                               connector,
                               target='inhibitory',
                               rng=pynn.NativeRNG(42))

        for ipre, ipost, w in weights:
            connector = pynn.AllToAllConnector(weights=1)
            proj = pynn.Projection(self.neurons[ipre],
                                   self.neurons[ipost],
                                   connector,
                                   target="excitatory")
Exemple #2
0
    def build(self):
        weights = self._create_nn_unit_weights(self.linearsize, self.dimension)

        self.neurons = [
            pynn.Population(1, self.model)
            for _ in range(self.linearsize**self.dimension)
        ]
        self.noise = pynn.Population(self.nsources, pynn.IF_cond_exp)
        self.biasneurons = pynn.Population(self.nbiasneurons, self.model)

        connector = pynn.FixedNumberPreConnector(n=30,
                                                 weights=0.3,
                                                 allow_self_connections=False)
        pynn.Projection(self.noise, self.noise, connector, target='inhibitory')

        connector = pynn.FixedNumberPreConnector(n=self.ksources, weights=0.3)
        pynn.Projection(self.noise,
                        self.neurons,
                        connector,
                        target='excitatory',
                        rng=pynn.NativeRNG(42))
        pynn.Projection(self.noise,
                        self.neurons,
                        connector,
                        target='inhibitory',
                        rng=pynn.NativeRNG(43))

        connector = pynn.FixedNumberPreConnector(n=self.kbiasneurons,
                                                 weights=0.4)
        pynn.Projection(self.biasneurons,
                        self.neurons,
                        connector,
                        target='inhibitory',
                        rng=pynn.NativeRNG(44))

        for ipre, ipost, w in weights:
            connector = pynn.AllToAllConnector(weights=1)
            pynn.Projection(self.neurons[ipre],
                            self.neurons[ipost],
                            connector,
                            target="excitatory")
    def build(self):

        self.neurons = pynn.Population(self.N, self.model)

        connector = pynn.FixedNumberPreConnector(self.K,
                                                 weights=1,
                                                 allow_self_connections=False)

        pynn.Projection(self.neurons,
                        self.neurons,
                        connector,
                        target='excitatory',
                        rng=pynn.NativeRNG(42))
    def runTest(self):
        pylogging.reset()
        pylogging.default_config(pylogging.LogLevel.INFO)

        marocco = pymarocco.PyMarocco()
        marocco.neuron_placement.default_neuron_size(8)
        marocco.calib_backend = pymarocco.PyMarocco.CalibBackend.Default
        marocco.defects.backend = pymarocco.Defects.Backend.Without
        marocco.hicann_configurator = pysthal.HICANNConfigurator()
        marocco.continue_despite_synapse_loss = True
        marocco.backend = pymarocco.PyMarocco.ESS
        marocco.experiment_time_offset = 5e-7

        n_exc = 100  # Number of excitatory neurons per group

        sim_duration = 200.

        pp_start = 50.  # start = center of pulse-packet

        weight_exc = 0.002  # uS weight for excitatory to excitatory connections
        # (double than in reference paper)

        pynn.setup(
            max_delay=20.,
            marocco=marocco,
        )

        # v_thresh close to v_rest to make sure there are some spikes
        neuron_params = {
            'v_rest': -65.,
            'v_thresh': -62.5,
        }

        exc_pop = pynn.Population(n_exc, pynn.IF_cond_exp, neuron_params)
        exc_pop.record()
        pop_stim = pynn.Population(n_exc, pynn.SpikeSourceArray,
                                   {'spike_times': [pp_start]})
        conn = pynn.FixedNumberPreConnector(60, weights=weight_exc, delays=20.)
        pynn.Projection(pop_stim, exc_pop, conn, target='excitatory')

        pynn.run(sim_duration)
        pynn.end()
Exemple #5
0
import pyhmf as pynn
from pymarocco import PyMarocco

neuron_size = 4

marocco = PyMarocco()
marocco.placement.setDefaultNeuronSize(neuron_size)

pynn.setup(marocco=marocco)

con_alltoall = pynn.AllToAllConnector(weights=0.04)
con_fixednumberpre = pynn.FixedNumberPreConnector(n=6, weights=0.04)

n_neurons = 112
pop = pynn.Population(n_neurons, pynn.IF_cond_exp)
neuron_pool = range(n_neurons)

in_0 = pynn.Population(1, pynn.SpikeSourceArray, {'spike_times': [0]})
for _ in xrange(4):
    pynn.Projection(in_0,
                    pop[neuron_pool[0:4]],
                    con_alltoall,
                    target='excitatory')

n_pops = 6
n_in_pop = 10

for p in xrange(n_pops):

    l_a = neuron_pool[p * n_in_pop:(p + 1) * n_in_pop - 1]
    l_b = neuron_pool[(p + 1) * n_in_pop:(p + 2) * n_in_pop - 1]