当前位置: 首页>>代码示例>>Python>>正文


Python config.Configurable类代码示例

本文整理汇总了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)
开发者ID:jgosmann,项目名称:iebalance,代码行数:30,代码来源:singlecell-continue.py

示例2: __init__

 def __init__(self):
     Interface.__init__(self, "RSC")
     Configurable.__init__(self)
     LOG("Created")
     self.toCheck = [ 'TM', 'TC' ]
     self.rscStatus = {}
     self.rscCallbacks = []
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:7,代码来源:resources.py

示例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
            ''')
开发者ID:jgosmann,项目名称:iebalance,代码行数:33,代码来源:singlecell-trained.py

示例4: __init__

 def __init__(self):
     Interface.__init__(self, "TC")
     Configurable.__init__(self)
     self.__lastStatus = None
     self.__lastElement = None
     self.__useConfig = {}
     LOG("Created")
开发者ID:unnch,项目名称:spell-sat,代码行数:7,代码来源:tc.py

示例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)
开发者ID:jgosmann,项目名称:iebalance,代码行数:8,代码来源:singlecell-trained-learning.py

示例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")
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:9,代码来源:tm.py

示例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      = [" "]
开发者ID:unnch,项目名称:spell-sat,代码行数:13,代码来源:tc_item.py

示例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
开发者ID:jgosmann,项目名称:iebalance,代码行数:13,代码来源:inputs.py

示例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)
开发者ID:unnch,项目名称:spell-sat,代码行数:14,代码来源:tm_item.py

示例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)]
开发者ID:jgosmann,项目名称:iebalance,代码行数:17,代码来源:ratebased.py

示例11: __init__

 def __init__(self):
     Interface.__init__(self, "USR")
     Configurable.__init__(self)
     LOG("Created")
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:4,代码来源:usr.py

示例12: __init__

 def __init__(self):
     Interface.__init__(self, "MEM")
     Configurable.__init__(self)
     self.__ctxName = None
     LOG("Created")
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:5,代码来源:memory.py

示例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('; '))
开发者ID:jgosmann,项目名称:iebalance,代码行数:5,代码来源:singlecell.py

示例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)
开发者ID:jgosmann,项目名称:iebalance,代码行数:6,代码来源:firingrates.py


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