Esempio n. 1
0
import brian_no_units
from brian.globalprefs import set_global_preferences

set_global_preferences(useweave=True,
                       usecodegen=True,
                       usecodegenweave=True,
                       usecodegenstateupdate = True,
                       usenewpropagate = True,
                       usecstdp = True,
                       gcc_options = ['-O3', '-ffast-math','-march=core2']
                       )

def run_stdp(NE,NI,v_init,C_e,C_ii,C_ie,mon_bin,dt):
    from brian.neurongroup import NeuronGroup
    from brian.monitor import PopulationRateMonitor
    from brian.stdunits import mV, ms, nS, pF, pA, Hz
    from brian.units import second
    from brian.equations import Equations
    from brian.network import Network
    from brian.connections import Connection
    from brian.stdp import STDP
    from brian.clock import Clock

    runtime = 10*second
   
    eta = 1e-2          # Learning rate
    tau_stdp = 20*ms    # STDP time constant
    alpha = 3*Hz*tau_stdp*2  # Target rate parameter
    gmax = 100               # Maximum inhibitory weight

    eqs_neurons='''
Esempio n. 2
0
            'siemens')
        self._store_array_with_unit(
            outfile, group, 'times',
            np.hstack((self.input_data.root.weights.excitatory.times,
                       self.input_data.root.weights.excitatory.times[-1] +
                       (self.dt * self.weights_timestep +
                        self.m_exc_weights.times) / b.second)),
            'second', "Times of the recorded synaptic weights.")


if __name__ == '__main__':
    import argparse
    import os.path
    import tables
    from brian.globalprefs import set_global_preferences
    set_global_preferences(useweave=True)

    logging.basicConfig()
    logger.setLevel(logging.INFO)

    parser = argparse.ArgumentParser(
        description="Run the Vogels et al. 2011 single cell model.")
    parser.add_argument(
        '-i', '--input', type=str, nargs=1, required=True,
        help="Path to the input file for which to continue the simulation.")
    parser.add_argument(
        '-t', '--time', type=float, nargs=1, required=True,
        help="Additional time to simulate in seconds.")
    parser.add_argument(
        'output', nargs=1, type=str,
        help="Filename of the HDF5 output file.")
Esempio n. 3
0
        pass
    def reset(self):
        pass
    def __len__(self):
        return self._length
    def num_states(self):
        return self._numstates
    def __repr__(self):
        return 'Virtual group of ' + str(len(self)) + ' neurons'


class ServerNetwork(Network):
    '''
    Network class for running a simulation over a cluster.
    The server manages the clients.
    '''
    pass

# Identification
myid = pypar.rank() # id of this process
nproc = pypar.size() # number of processors

if myid > 0: # client
    import sys
    run_client()
    sys.exit(0)

# Server
#Network=ServerNetwork
set_global_preferences(cluster_server=True)