• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python spiNNaker.setup函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyNN.spiNNaker.setup函数的典型用法代码示例。如果您正苦于以下问题:Python setup函数的具体用法?Python setup怎么用?Python setup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setupModel

def setupModel(settings,params, dt,simTime,populationsInput, populationsNoiseSource, populationsRN,populationsPN,populationsAN,projectionsPNAN):
    
    maxDelay = max([params['MAX_DELAY_RATECODE_TO_CLUSTER_RN'],params['MAX_DELAY_CLASS_ACTIVITY_TO_CLUSTER_AN']])
    spynnaker.setup(timestep=dt,min_delay=1,max_delay=maxDelay)        
    rnSpikeInjectionPort = settings['RN_SPIKE_INJECTION_PORT']
    rnSpikeInjectionPopLabel = settings['RN_SPIKE_INJECTION_POP_LABEL']
    classActivationSpikeInjectionPort = settings['CLASS_ACTIVATION_SPIKE_INJECTION_PORT']
    classActivationSpikeInjectionPopLabel = settings['CLASS_ACTIVATION_SPIKE_INJECTION_POP_LABEL']
    
    learning = settings['LEARNING']
    
    print 'Setting up input layer..'
    numInjectionPops = setupLayerInput(params,rnSpikeInjectionPort,rnSpikeInjectionPopLabel, classActivationSpikeInjectionPort,classActivationSpikeInjectionPopLabel, populationsInput,learning)
    print numInjectionPops , ' spikeInjection populations were needed to accomodate ', params['NUM_VR'], " VRs"
    print 'Setting up noise source layer..'
    setupLayerNoiseSource(params, simTime, populationsNoiseSource)
    print 'Setting up RN layer..'
    numInputPops = len(populationsInput)
    injectionPops = populationsInput[1:len(populationsInput)]
    numInjectionPops = len(injectionPops)
    setupLayerRN(params,neuronModel, cell_params, injectionPops, populationsNoiseSource[0], populationsRN)
    #setupLayerRN(params,neuronModel, cell_params, injectionPops, populationsRN)
    print 'Setting up PN layer..'
    setupLayerPN(params, neuronModel, cell_params, populationsRN, populationsPN)
    print 'Setting up AN layer..'
    setupLayerAN(params, settings, neuronModel, cell_params, populationsInput[0], populationsNoiseSource[0], populationsPN, populationsAN,learning,projectionsPNAN)
    
    printModelConfigurationSummary(params, populationsInput, populationsNoiseSource, populationsRN, populationsPN, populationsAN)
开发者ID:alandiamond,项目名称:spinnaker-neuromorphic-classifier,代码行数:28,代码来源:Classifier_LiveSpikingInput.py


示例2: __init__

    def __init__( self, time, num_neurons ):
        threading.Thread.__init__( self )

        p.setup( timestep=1.0, min_delay=1.0, max_delay=144.0 )

        self.time             = time
        self.num_neurons      = num_neurons
        self.loop_connections = list()
        self.weight_to_spike  = 2.0
        self.delay            = 17

        self.cell_params      = {
                'cm'        : 0.25,
                'i_offset'  : 0.0,
                'tau_m'     : 20.0,
                'tau_refrac': 2.0,
                'tau_syn_E' : 5.0,
                'tau_syn_I' : 5.0,
                'v_reset'   : -70.0,
                'v_rest'    : -65.0,
                'v_thresh'  : -50.0
        }

        self.injector_cell_params = {
            'host_port_number' : 12345,
            'host_ip_address'  : "localhost",
            'virtual_key'      : 458752,
            'prefix'           : 7,
            'prefix_type'      : q.EIEIOPrefixType.UPPER_HALF_WORD
        }
       
        for i in range( 0, self.num_neurons - 1 ):
            single_connection = ( i, ( ( i + 1 ) % self.num_neurons ), self.weight_to_spike, self.delay )
            self.loop_connections.append( single_connection )

        self.injection_connections = {
                'pop1' : [( 0, 0, self.weight_to_spike, 1 )],
                'pop2' : [( 1, 0, self.weight_to_spike, 1 )]
        }

        self.populations = {
        #       pop name                   num neurons       neuron type                    cell parameters            label
                "injector" : p.Population( 2,                q.ReverseIpTagMultiCastSource, self.injector_cell_params, label='spike_injector' ),
                "pop1"     : p.Population( self.num_neurons, p.IF_curr_exp,                 self.cell_params,          label='pop1'           ),
                "pop2"     : p.Population( self.num_neurons, p.IF_curr_exp,                 self.cell_params,          label='pop2'           ),
                "pop3"     : p.Population( self.num_neurons, p.IF_curr_exp,                 self.cell_params,          label='pop3'           )
        }

        self.projections = [
                p.Projection( self.populations['pop1'],      self.populations['pop1'], p.FromListConnector( self.loop_connections              ) ),
                p.Projection( self.populations['pop2'],      self.populations['pop2'], p.FromListConnector( self.loop_connections              ) ),
                p.Projection( self.populations['pop2'],      self.populations['pop3'], p.FromListConnector( self.loop_connections              ) ),
                p.Projection( self.populations['injector'],  self.populations['pop1'], p.FromListConnector( self.injection_connections['pop1'] ) ),
                p.Projection( self.populations['injector'],  self.populations['pop2'], p.FromListConnector( self.injection_connections['pop2'] ) )
        ]
开发者ID:msil,项目名称:spinnaker-workshop,代码行数:55,代码来源:synfire_if_curr_exp6.py


示例3: setupModel

def setupModel(settings,params, dt,simTime,populationsInput, populationsNoiseSource, populationsRN,populationsPN,populationsAN,projectionsPNAN):
    
    maxDelay = max([params['MAX_DELAY_RATECODE_TO_CLUSTER_RN'],params['MAX_DELAY_CLASS_ACTIVITY_TO_CLUSTER_AN']])
    spynnaker.setup(timestep=dt,min_delay=1,max_delay=maxDelay)        
    spikeSourceVrResponsePath = settings['SPIKE_SOURCE_VR_RESPONSE_PATH']
    spikeSourceActiveClassPath = settings['SPIKE_SOURCE_ACTIVE_CLASS_PATH']
    learning = settings['LEARNING']
    
    setupLayerInput(params, spikeSourceVrResponsePath, spikeSourceActiveClassPath, populationsInput,learning)
    setupLayerNoiseSource(params, simTime, populationsNoiseSource)
    setupLayerRN(params,neuronModel, cell_params, populationsInput[0], populationsNoiseSource[0], populationsRN)
    setupLayerPN(params, neuronModel, cell_params, populationsRN, populationsPN)
    setupLayerAN(params, settings, neuronModel, cell_params, populationsInput[1], populationsNoiseSource[0], populationsPN, populationsAN,learning,projectionsPNAN)
    
    printModelConfigurationSummary(params, populationsInput, populationsNoiseSource, populationsRN, populationsPN, populationsAN)
开发者ID:alandiamond,项目名称:spinnaker-neuromorphic-classifier,代码行数:15,代码来源:Classifier.py


示例4: main

def main():
    # setup timestep of simulation and minimum and maximum synaptic delays
    setup(timestep=simulationTimestep, min_delay=minSynapseDelay, max_delay=maxSynapseDelay, threads=4)

    # create a spike sources
    retinaLeft = createSpikeSource("Retina Left")
    retinaRight = createSpikeSource("Retina Right")
    
    # create network and attach the spike sources 
    network = createCooperativeNetwork(retinaLeft=retinaLeft, retinaRight=retinaRight)
    
    # run simulation for time in milliseconds
    print "Simulation started..."
    run(simulationTime)                                            
    print "Simulation ended."
    
    # plot results  
    plotExperiment(retinaLeft, retinaRight, network)
    # finalise program and simulation
    end()
开发者ID:AMFtech,项目名称:StereoMatching,代码行数:20,代码来源:CooperativeNetwork.py


示例5: setupModel

def setupModel(
    params,
    settings,
    dt,
    simTime,
    populationsInput,
    populationsNoiseSource,
    populationsRN,
    populationsPN,
    populationsAN,
    projectionsPNAN,
):

    maxDelay = max([params["MAX_DELAY_RATECODE_TO_CLUSTER_RN"], params["MAX_DELAY_CLASS_ACTIVITY_TO_CLUSTER_AN"]])

    spynnaker.setup(timestep=dt, min_delay=1, max_delay=maxDelay)

    setupLayerInput(params, settings, populationsInput)

    setupLayerNoiseSource(params, simTime, populationsNoiseSource)

    setupLayerRN(params, neuronModel, cell_params, populationsInput[0], populationsNoiseSource[0], populationsRN)

    setupLayerPN(params, neuronModel, cell_params, populationsRN, populationsPN)

    setupLayerAN(
        params,
        settings,
        neuronModel,
        cell_params,
        populationsInput[1],
        populationsNoiseSource[0],
        populationsPN,
        populationsAN,
        projectionsPNAN,
    )

    printModelConfigurationSummary(
        params, populationsInput, populationsNoiseSource, populationsRN, populationsPN, populationsAN
    )
开发者ID:iulialexandra,项目名称:neuromorphic_odour_classifier,代码行数:40,代码来源:Classifier.py


示例6: general_cell

LOGDEBUG = 1
LOGINFO = 2

LOGLEVEL = LOGINFO


#### DEFAULTS
tau_syn = 100                # default value
neurons_per_core = 100       # default value

#### COUNTERS
n_outs = 0                  # output counter for placing NEF_out populations in chip 0,0


# Setting up the connection with the DB and the number of cells
spinn.setup(db_name = os.path.abspath('%s/nengo_model.sqlite' % pacman.BINARIES_DIRECTORY))

spinn.get_db().set_number_of_neurons_per_core('NEF_out_2d', neurons_per_core*2)        # this will set one population per core
#spinn.get_db().set_number_of_neurons_per_core('IF_curr_exp_32', neurons_per_core)        # this will set one population per core
spinn.get_db().set_number_of_neurons_per_core('IF_NEF_input_2d', neurons_per_core*2)        # this will set one population per core


# PACMAN INTERFACES

class general_cell():
    """
    PACMAN Interface class giving a cell type with parameters, class, size, label, id and mapping constraints
    """
    def __init__(self, cellname):
        self.__name__ = cellname
开发者ID:galluppf,项目名称:spackage_conv,代码行数:30,代码来源:compile_nengo_model.py


示例7:

  return spike_times_1, spike_times_2


#millisecond*second*minutes*hour in a day
#runtime = 1000*60*60*24 
runtime  = 1000#*60*10 #10 min
stimtime = 500
weight_to_spike = 8.

timestep = 1.
min_delay = 1.
max_delay = 20.


sim.setup(timestep=timestep, min_delay = min_delay, max_delay = max_delay)

max_weight = 10.
min_weight = 0.0
a_plus = 0.1
a_minus = 0.12
tau_plus = 20.
tau_minus = 20.

num_exc = 800
num_inh = 200
total_neurons = num_exc + num_inh
max_conn_per_neuron = 100
conn_prob = 0.1#float(max_conn_per_neuron)/float(total_neurons)

cell_type = sim.IZK_curr_exp
开发者ID:AlexBoro,项目名称:polychronization,代码行数:30,代码来源:full-paper.py


示例8: range

#!/usr/bin/env python
import IPython
import pyNN.spiNNaker as p
#import pyNN.neuron as p
from pylab import *
from pyNN.utility import init_logging
from pyNN.utility import get_script_args
from pyNN.errors import RecordingError

spin_control = p.setup(timestep=0.1, min_delay=0.1, max_delay=4.0)
#init_logging("logfile", debug=True)

ifcell = p.Population(10, p.IF_cond_exp, {  'i_offset' : 0.1,    'tau_refrac' : 3.0,
                                'v_thresh' : -51.0,  'tau_syn_E'  : 2.0,
                                'tau_syn_I': 5.0,    'v_reset'    : -70.0,
                                'e_rev_E'  : 0.,     'e_rev_I'    : -80.}, label = "myFinalCell_PLOT")

spike_sourceE = p.Population(10, p.SpikeSourceArray, {'spike_times': [float(i) for i in range(0,9000,100)]}, label = "mySourceE_PLOT")
spike_sourceI = p.Population(10, p.SpikeSourceArray, {'spike_times': [float(i) for i in range(1000,5000,50)]}, label = "mySourceI_PLOT")

connE = p.Projection(spike_sourceE, ifcell, p.AllToAllConnector(weights=1.0, delays=0.2), target='excitatory')
connI = p.Projection(spike_sourceI, ifcell, p.AllToAllConnector(weights=3.0, delays=0.2), target='inhibitory')

#p1 = Population(100, IF_curr_alpha, structure=space.Grid2D())

#prepop = p.Population(100 ,p.SpikeSourceArray,{'spike_times':[[i for i in arange(10,duration,100)], [i for i in arange(50,duration,100)]]*(nn/2)})


#prj2_1 = Projection(p2, p1, method=AllToAllConnector(), target='excitatory')

开发者ID:BRML,项目名称:HBP-spinnaker-cerebellum,代码行数:29,代码来源:spielwiese.py


示例9: get_pops

import pyNN.spiNNaker as pynn


# helper function for populations
def get_pops(n_in_pop, n_used_neuronblocks=7):
    l = []
    model_type = pynn.IF_cond_exp

    for _ in xrange(n_used_neuronblocks):
        pop = pynn.Population(n_in_pop, model_type, params)
        pop.record()
        l.append(pop)

    return l

pynn.setup(timestep=1.0)

duration = 1 * 30000  # ms

params = {
    'cm': 0.2,
    'v_reset': -70,
    'v_rest': -50,
    'v_thresh': -47,
    'e_rev_I': -60,
    'e_rev_E': -40,
}


n_in_pop = 12
开发者ID:electronicvisions,项目名称:hbp_platform_demo,代码行数:30,代码来源:run.py


示例10: neurons




Each population has 256 neurons (4 neurons x 64 channels).
Neurons in each population (ear) are numbered from 0 to 255, where::

   id = ( channel * 4 ) + neuron

.. moduleauthor:: Francesco Galluppi, SpiNNaker Project, [email protected]
"""
from pyNN.utility import get_script_args
from pyNN.errors import RecordingError
import pyNN.spiNNaker as p

p.setup(timestep=1.0,min_delay=1.0,max_delay=10.0, db_name='cochlea_example.sqlite')

nNeurons = 4 * 64 # 4 neurons and 64 channels per ear

p.get_db().set_number_of_neurons_per_core('IF_curr_exp', nNeurons)      # this will set 256 neurons per core

cell_params = {     'i_offset' : .1,    'tau_refrac' : 3.0, 'v_rest' : -65.0,
                    'v_thresh' : -51.0,  'tau_syn_E'  : 2.0,
                    'tau_syn_I': 5.0,    'v_reset'    : -70.0,
                    'e_rev_E'  : 0.,     'e_rev_I'    : -80.}

left_cochlea_ear = p.Population(nNeurons, p.ProxyNeuron, {'x_source':254, 'y_source':254}, label='left_cochlea_ear')
left_cochlea_ear.set_mapping_constraint({'x':0, 'y':0})
left_cochlea_ear.record()   #    this should record spikes from the cochlea

开发者ID:galluppf,项目名称:spackage_conv,代码行数:25,代码来源:cochlea_example.py


示例11:

import pyNN.spiNNaker as p
import memory_for_parser as mem
import parse as parser
import get_text as sp

NUMBER_PEOPLE = 10
NUMBER_LOCS = 10
NUMBER_OBJS = 10

max_delay = 100.0

p.setup(timestep=1.0, min_delay = 1.0, max_delay = max_delay)

# parser.parse_no_run('spiNNaker', "daniel went to the bathroom. john went to the hallway. where is john?")

sent1 = sp.getSentence(parser.words, "Say your first assertion now")
sent2 = sp.getSentence(parser.words, "Say your second assertion now")
sent3 = sp.getSentence(parser.words, "Ask your question now")

parser.parse_no_run('spiNNaker', sent1+sent2+sent3)


[input_populations, state_populations, output_populations, projections] = mem.memory(NUMBER_PEOPLE, NUMBER_LOCS, NUMBER_OBJS)

cell_params_lif = {'cm'        : 0.25, # nF
                     'i_offset'  : 0.0,
                     'tau_m'     : 20.0,
                     'tau_refrac': 2.0,
                     'tau_syn_E' : 5.0,
                     'tau_syn_I' : 5.0,
                     'v_reset'   : -70.0,
开发者ID:pmhastings,项目名称:spikeparse,代码行数:31,代码来源:main.py


示例12:

"""
Synfirechain-like example

Expected results in
  .. figure::  ./examples/results/synfire_chain_lif.png

"""
#!/usr/bin/python
import pyNN.spiNNaker as p
import numpy, pylab



p.setup(timestep=1.0, min_delay = 1.0, max_delay = 8.0, db_name='synfire.sqlite')

n_pop = 16    # number of populations
nNeurons = 10  # number of neurons in each population

p.get_db().set_number_of_neurons_per_core('IF_curr_exp', nNeurons)      # this will set one population per core

# random distributions
rng = p.NumpyRNG(seed=28374)
delay_distr = p.RandomDistribution('uniform', [1,10], rng=rng)
weight_distr = p.RandomDistribution('uniform', [0,2], rng=rng)
v_distr = p.RandomDistribution('uniform', [-55,-95], rng)


cell_params_lif_in = { 'tau_m'      : 32,
                'v_init'    : -80,
                'v_rest'     : -75,   
                'v_reset'    : -95,  
开发者ID:galluppf,项目名称:spackage_conv,代码行数:31,代码来源:synfire_chain_lif.py


示例13:

import pyNN.spiNNaker as sim

sim.setup()

p1 = sim.Population(3, sim.SpikeSourceArray, {"spike_times":  [1.0, 2.0, 3.0]})
p2 = sim.Population(3, sim.SpikeSourceArray, {"spike_times":  [[10.0], [20.0], [30.0]]})
p3 = sim.Population(4, sim.IF_cond_exp, {})

sim.Projection(p2, p3, sim.FromListConnector([
    (0, 0, 0.1, 1.0), (1, 1, 0.1, 1.0), (2, 2, 0.1, 1.0)]))
#sim.Projection(p1, p3, sim.FromListConnector([(0, 3, 0.1, 1.0)])) # works if this line is added

sim.run(100.0)
开发者ID:SpikeFrame,项目名称:sPyNNaker,代码行数:13,代码来源:test.py


示例14: get_pops


# helper function for populations
def get_pops(n_in_pop, n_used_neuronblocks=7):
    l = []
    model_type = pynn.IF_curr_exp

    for _ in xrange(n_used_neuronblocks):
        pop = pynn.Population(n_in_pop, model_type, params)
        pop.record()
        l.append(pop)

    return l


pynn.setup(timestep=0.1)

duration = 1 * 3000  # ms

params = {"cm": 0.2, "v_reset": -70, "v_rest": -50, "v_thresh": -47}

n_in_pop = 12

# prepare populations
all_pops = []
all_pops.extend(get_pops(n_in_pop))
all_pops.extend(get_pops(n_in_pop))
# -> makes 14 population

# synaptic weight, must be tuned for spinnaker
w_exc = 0.25
开发者ID:rowleya,项目名称:PyNNSynfireChainExample,代码行数:29,代码来源:run.py


示例15:

   $ ./stdp_example

This example requires that the NeuroTools package is installed
(http://neuralensemble.org/trac/NeuroTools)

Authors : Catherine Wacongne < [email protected] >
          Xavier Lagorce < [email protected] >

April 2013
"""
import pylab
import pyNN.spiNNaker as sim

# SpiNNaker setup
sim.setup(timestep=1.0, min_delay=1.0, max_delay=10.0)

# +-------------------------------------------------------------------+
# | General Parameters                                                |
# +-------------------------------------------------------------------+

# Population parameters
model = sim.IF_curr_exp

cell_params = {'cm': 0.25,
               'i_offset': 0.0,
               'tau_m': 20.0,
               'tau_refrac': 2.0,
               'tau_syn_E': 5.0,
               'tau_syn_I': 5.0,
               'v_reset': -70.0,
开发者ID:AlexBoro,项目名称:polychronization,代码行数:30,代码来源:stdp_example.py


示例16: list

import pyNN.spiNNaker as p
from matplotlib import pylab
p.setup(timestep=1.0)
input_pop = p.Population(1, p.SpikeSourceArray, cellparams={"spike_times": [0]},
        label="input")
cell_params_lif = {'cm'        : 0.25, # nF
                     'i_offset'  : 0.0,
                     'tau_m'     : 20.0,
                     'tau_refrac': 2.0,
                     'tau_syn_E' : 5.0,
                     'tau_syn_I' : 5.0,
                     'v_reset'   : -70.0,
                     'v_rest'    : -65.0,
                     'v_thresh'  : -50.0
                     }
pop = p.Population(2, p.IF_curr_exp, cellparams=cell_params_lif, label="pop")

connections = list()
connections.append(p.Projection(input_pop, pop, p.AllToAllConnector(weights=[0.3, 1.0], delays=[1, 17])))
connections.append(p.Projection(input_pop, pop, p.AllToAllConnector(weights=[1.0, 0.7], delays=[2, 15])))
connections.append(p.Projection(input_pop, pop, p.AllToAllConnector(weights=[0.7, 0.3], delays=[3, 33])))

pre_weights = list()
pre_delays = list()
for connection in connections:
    pre_weights.append(connection.getWeights())
    pre_delays.append(connection.getDelays())

p.run(100)

post_weights = list()
开发者ID:Paul92,项目名称:sPyNNaker,代码行数:31,代码来源:test_multapse.py


示例17: int

# Get the number of cores and use this to make the simulation
n_cores = 0
for chip in machine.chips:
    for processor in chip.processors:
        if not processor.is_monitor:
            n_cores += 1
n_pops = int(math.floor(n_cores / 2.0))
print "n_cores =", n_cores, "n_pops =", n_pops
spike_times = range(0, n_pops * spike_gap, spike_gap)
run_time = (n_pops + 1) * spike_gap + 1

for do_injector_first in [True, False]:

    # Set up for execution
    p.setup(1.0, machine=hostname)

    injectors = list()
    for i in range(n_pops):
        injector = None
        (x1, y1, p1) = cores[i * 2]
        (x2, y2, p2) = cores[(i * 2) + 1]
        if do_injector_first:
            injector = create_injector(i, x1, y1, p1)
        else:
            injector = create_injector(i, x2, y2, p2)
        injectors.append(injector)

    populations = list()
    for i in range(n_pops):
        pop = None
开发者ID:ruthvik92,项目名称:PyNNExamples,代码行数:30,代码来源:board_test.py


示例18:

import pyNN.spiNNaker as p
import retina_lib

input_size = 128  # Size of each population
subsample_size = 32
runtime = 60
# Simulation Setup
p.setup(timestep=1.0, min_delay=1.0, max_delay=11.0)  # Will add some extra parameters for the spinnPredef.ini in here

p.set_number_of_neurons_per_core("IF_curr_exp", 128)  # this will set one population per core

cell_params = {
    "tau_m": 64,
    "i_offset": 0,
    "v_rest": -75,
    "v_reset": -95,
    "v_thresh": -40,
    "tau_syn_E": 15,
    "tau_syn_I": 15,
    "tau_refrac": 2,
}


# external stuff population requiremenets
connected_chip_coords = {"x": 0, "y": 0}
virtual_chip_coords = {"x": 0, "y": 5}
link = 4


print "Creating input population: %d x %d" % (input_size, input_size)
开发者ID:gtrGitHub,项目名称:sPyNNaker,代码行数:30,代码来源:synaptic_split_output.py


示例19: range

tau_m    = 20.    # (ms)
cm       = 1.     # (uF/cm^2)
g_leak   = 5e-5   # (S/cm^2)
E_leak = -60 # (mV)
v_thresh = -50.   # (mV)
v_reset  = -60.   # (mV)
t_refrac = 10.     # (ms) (clamped at v_reset)
tau_exc  = 5.     # (ms)
tau_inh  = 10.    # (ms)
cell_params = {
    'tau_m'      : tau_m,    'tau_syn_E'  : tau_exc,  'tau_syn_I'  : tau_inh,
    'v_rest'     : E_leak,   'v_reset'    : v_reset,  'v_thresh'   : v_thresh,
    'cm'         : cm,       'tau_refrac' : t_refrac}

############################### setup simulation
sim.setup(timestep=dt, min_delay=1.0)

# build populations
cell_type = sim.IF_cond_exp
num_of_cells = 10
layers   = 10
populations = []
for i in range(layers):
    curr_pop = sim.Population(num_of_cells, cell_type, cell_params, label="Population {0}".format(i))
    populations.append(curr_pop)
    curr_pop.initialize('v', v_reset)
if mode == "spikes":
    populations[-1].record()
else:
    populations[0].record_v()
开发者ID:Scaatis,项目名称:SpiNNakerTests,代码行数:30,代码来源:dummy_net_multi_run.py


示例20: int

cm    = cm*area*1000                  # convert to nF
Rm    = 1e-6/(g_leak*area)            # membrane resistance in MΩ
assert tau_m == cm*Rm                 # just to check
n_exc = int(round((n*r_ei/(1+r_ei)))) # number of excitatory cells   
n_inh = n - n_exc                     # number of inhibitory cells
celltype = sim.IF_curr_exp
w_exc = 1e-3*Gexc*(Erev_exc - v_mean) # (nA) weight of excitatory synapses
w_inh = 1e-3*Ginh*(Erev_inh - v_mean) # (nA)
assert w_exc > 0; assert w_inh < 0

# === Build the network ========================================================

extra = {'threads' : threads,
         'label': 'VA'}

node_id = sim.setup(timestep=dt, min_delay=delay, max_delay=delay, **extra)

print "%s Initialising the simulator with %d thread(s)..." % (node_id, extra['threads'])
    
cell_params = {
    'tau_m'      : tau_m,    'tau_syn_E'  : tau_exc,  'tau_syn_I'  : tau_inh,
    'v_rest'     : E_leak,   'v_reset'    : v_reset,  'v_thresh'   : v_thresh,
    'cm'         : cm,       'tau_refrac' : t_refrac}

print "%s Creating cell populations..." % node_id
exc_cells = sim.Population(n_exc, celltype, cell_params,
    label="Excitatory_Cells")
inh_cells = sim.Population(n_inh, celltype, cell_params,
    label="Inhibitory_Cells")

print "%s Initialising membrane potential to random values..." % node_id
开发者ID:Scaatis,项目名称:SpiNNakerTests,代码行数:31,代码来源:va_benchmark_multi_run.py



注:本文中的pyNN.spiNNaker.setup函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utility.assert_arrays_equal函数代码示例发布时间:2022-05-25
下一篇:
Python spiNNaker.run函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap