Exemplo n.º 1
0
 def uniform_network(cls, size, neuron_model=default_neuron,
                     neuron_param=None, syn_model=default_synapse,
                     syn_param=None):
     '''
     Generate a network containing only one type of neurons.
     
     Parameters
     ----------
     size : int
         Number of neurons in the network.
     neuron_model : string, optional (default: 'aief_cond_alpha')
         Name of the NEST neural model to use when simulating the activity.
     neuron_param : dict, optional (default: {})
         Dictionary containing the neural parameters; the default value will
         make NEST use the default parameters of the model.
     syn_model : string, optional (default: 'static_synapse')
         NEST synaptic model to use when simulating the activity.
     syn_param : dict, optional (default: {})
         Dictionary containing the synaptic parameters; the default value
         will make NEST use the default parameters of the model.
     
     Returns
     -------
     net : :class:`~nngt.Network` or subclass
         Uniform network of disconnected neurons.
     '''
     if neuron_param is None:
         neuron_param = {}
     if syn_param is None:
         syn_param = {}
     pop = NeuralPop.uniform_population(size, None, neuron_model,
                                        neuron_param, syn_model, syn_param)
     net = cls(population=pop)
     return net
Exemplo n.º 2
0
 def ei_network(cls, size, ei_ratio=0.2, en_model=default_neuron,
         en_param=None, es_model=default_synapse, es_param=None,
         in_model=default_neuron, in_param=None, is_model=default_synapse,
         is_param=None):
     '''
     Generate a network containing a population of two neural groups:
     inhibitory and excitatory neurons.
     
     Parameters
     ----------
     size : int
         Number of neurons in the network.
     ei_ratio : double, optional (default: 0.2)
         Ratio of inhibitory neurons: :math:`\\frac{N_i}{N_e+N_i}`.
     en_model : string, optional (default: 'aeif_cond_alpha')
        Nest model for the excitatory neuron.
     en_param : dict, optional (default: {})
         Dictionary of parameters for the the excitatory neuron.
     es_model : string, optional (default: 'static_synapse')
         NEST model for the excitatory synapse.
     es_param : dict, optional (default: {})
         Dictionary containing the excitatory synaptic parameters.
     in_model : string, optional (default: 'aeif_cond_alpha')
        Nest model for the inhibitory neuron.
     in_param : dict, optional (default: {})
         Dictionary of parameters for the the inhibitory neuron.
     is_model : string, optional (default: 'static_synapse')
         NEST model for the inhibitory synapse.
     is_param : dict, optional (default: {})
         Dictionary containing the inhibitory synaptic parameters.
     
     Returns
     -------
     net : :class:`~nngt.Network` or subclass
         Network of disconnected excitatory and inhibitory neurons.
     '''
     if en_param is None:
         en_param = {}
     if es_param is None:
         es_param = {}
     if in_param is None:
         in_param = {}
     if is_param is None:
         is_param = {}
     pop = NeuralPop.exc_and_inhib(size, ei_ratio, None, en_model, en_param,
                 es_model, es_param, in_model, in_param, is_model, is_param)
     net = cls(population=pop)
     return net