本文整理汇总了Python中config.Configurable类的典型用法代码示例。如果您正苦于以下问题:Python Configurable类的具体用法?Python Configurable怎么用?Python Configurable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Configurable类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, input_data, model):
config = input_data.getNodeAttr('/', 'config')
Configurable.__init__(self, config['recording'])
self._add_config_value('recording_duration', quantity)
self._add_config_value('rate_bin_size', quantity)
self._add_config_value('store_times', quantity_list)
self._add_config_value('current_timestep', int)
self._add_config_value('weights_timestep', int)
self.input_data = input_data
self.dt = quantity(config['dt'])
self.model = model
self.m_spikes = b.SpikeMonitor(model.neuron)
self.m_rates = b.PopulationRateMonitor(model.neuron, self.rate_bin_size)
self.m_exc_syn_currents = b.RecentStateMonitor(
model.neuron, 'I_exc', self.recording_duration,
timestep=self.current_timestep)
self.m_inh_syn_currents = b.RecentStateMonitor(
model.neuron, 'I_inh', self.recording_duration,
timestep=self.current_timestep)
self.m_exc_weights = b.StateMonitor(
model.exc_synapses, 'w', record=True,
timestep=self.weights_timestep)
self.m_inh_weights = b.StateMonitor(
model.inh_synapses, 'w', record=True,
timestep=self.weights_timestep)
self.model.add(
self.m_spikes, self.m_rates, self.m_exc_syn_currents,
self.m_inh_syn_currents, self.m_exc_weights, self.m_inh_weights)
示例2: __init__
def __init__(self):
Interface.__init__(self, "RSC")
Configurable.__init__(self)
LOG("Created")
self.toCheck = [ 'TM', 'TC' ]
self.rscStatus = {}
self.rscCallbacks = []
示例3: __init__
def __init__(self, config):
Configurable.__init__(self, config)
self._add_config_value('tau', quantity) # membrane time constant
self._add_config_value('V_rest', quantity) # resting membrane potential
self._add_config_value('threshold', quantity) # spiking threshold
self._add_config_value('g_leak', quantity) # leak conductance
self._add_config_value('refractory_period', quantity)
self._add_config_value('V_exc', quantity) # excitatory reversal potential
self._add_config_value('V_inh', quantity) # inhibitory reversal potential
self._add_config_value('I_b', quantity) # additional current
self._add_config_value('g_exc_bar', quantity)
self._add_config_value('g_inh_bar', quantity)
self._add_config_value('init_inh_w', quantity)
self._add_config_value('tau_exc', quantity) # excitat. syn. time constant
self._add_config_value('tau_inh', quantity) # inhibit. syn. time constant
self._add_config_value('tau_stdp', quantity)
self._add_config_value('tau_w', quantity)
self._add_config_value('eta', float)
self._add_config_value('rho', quantity)
self.alpha = 2 * self.rho * self.tau_stdp
self.eqs = b.Equations('''
dg_exc/dt = -g_exc / self.tau_exc : siemens
I_exc = g_exc * (self.V_exc - V) : amp
dg_inh/dt = -g_inh / self.tau_inh : siemens
I_inh = g_inh * (self.V_inh - V) : amp
dV/dt = ((self.V_rest - V) + (I_exc + I_inh + self.I_b) / \
self.g_leak) / self.tau : volt
dx/dt = -x / self.tau_stdp : 1
''')
示例4: __init__
def __init__(self):
Interface.__init__(self, "TC")
Configurable.__init__(self)
self.__lastStatus = None
self.__lastElement = None
self.__useConfig = {}
LOG("Created")
示例5: __init__
def __init__(self, config, model):
Configurable.__init__(self, config)
self._add_config_value('stimulus_duration', quantity)
self._add_config_value('num_trials', int)
self.model = model
self.m_spikes = b.SpikeMonitor(model.neuron)
self.model.add(self.m_spikes)
示例6: __init__
def __init__(self):
Interface.__init__(self, "TM")
Configurable.__init__(self)
self.__tmParameters = {}
self.__verifiers = []
self.__verifTable = []
self.__verifMutex = thread.allocate_lock()
self.__ctxName = None
LOG("Created")
示例7: __init__
def __init__(self, tcClass, cmd, description = ""):
Configurable.__init__(self)
self.__tcClass = tcClass
self.__cmdName = cmd
self.__cmdDescription = description
self.__parameters= []
self.__completed = [False]
self.__success = [False]
self.__elements = [ self.__cmdName ]
self.__executionStage = ['UKN']
self.__executionStatus = ['UKN']
self.__comment = [" "]
self.__updateTime = [" "]
示例8: __init__
def __init__(self, config, duration=None):
Configurable.__init__(self, config)
self._add_config_value('peak_firing_rate', quantity)
self._add_config_value('background_activity', quantity)
self._add_config_value('sparseness', int)
self._add_config_value('approximate_normalization', float)
self._add_config_value('filter_time_constant', quantity)
self._add_config_value('dt', quantity)
self.current_raw_value = 0.0
self.current_time = 0.0 * brian.second
self.sparsification_start = 1
self.signal = None
self.duration = duration
示例9: __init__
def __init__(self, tmClass, name, description=None):
# Super constructor
Configurable.__init__(self)
# Initialize basics
self._tmClass = tmClass
self._name = name
self._description = description
self._rawValue = None
self._engValue = None
self._status = None
# Default item configuration is given by the TM interface
# TM interface shall be a Configurable as well
self.setConfig(tmClass)
示例10: __init__
def __init__(self, config, outfile):
Configurable.__init__(self, config)
self._add_config_value('epoch_duration', quantity)
self._add_config_value('num_tunings', int)
self._add_config_value('num_epochs', int)
self._add_config_value('eta', float)
self._add_config_value('rho', quantity)
self.outfile = outfile
self.exc_weights = 0.5 * (0.35 + 1.1 / (
1.0 + (np.arange(self.num_tunings) - 4) ** 4))
self.inh_weights = np.empty(self.num_tunings)
self.inh_weights.fill(0.05)
self.signal_gens = [InputSignalGenerator(
self._config['raw_signals'], self.epoch_duration)
for i in xrange(self.num_tunings)]
示例11: __init__
def __init__(self):
Interface.__init__(self, "USR")
Configurable.__init__(self)
LOG("Created")
示例12: __init__
def __init__(self):
Interface.__init__(self, "MEM")
Configurable.__init__(self)
self.__ctxName = None
LOG("Created")
示例13: __init__
def __init__(self, config):
Configurable.__init__(self, config)
self._add_config_value('equations', EquationString('\n'))
self._add_config_value('pre', EquationString('; '))
self._add_config_value('post', EquationString('; '))
示例14: __init__
def __init__(self, config, model):
Configurable.__init__(self, config)
self._add_config_value('store_times', quantity_list)
self.model = model
self.m_spike_count = b.PopulationSpikeCounter(model.neuron)