MCPcopy Create free account
hub / github.com/BindsNET/bindsnet / __init__

Method __init__

bindsnet/models/models.py:256–346  ·  view source on GitHub ↗

Constructor for class ``DiehlAndCook2015v2``. :param n_inpt: Number of input neurons. Matches the 1D size of the input data. :param n_neurons: Number of excitatory, inhibitory neurons. :param inh: Strength of synapse weights from inhibitory to excitatory layer.

(
        self,
        n_inpt: int,
        n_neurons: int = 100,
        inh: float = 17.5,
        dt: float = 1.0,
        nu: Optional[Union[float, Sequence[float]]] = (1e-4, 1e-2),
        reduction: Optional[callable] = None,
        wmin: Optional[float] = 0.0,
        wmax: Optional[float] = 1.0,
        norm: float = 78.4,
        theta_plus: float = 0.05,
        tc_theta_decay: float = 1e7,
        inpt_shape: Optional[Iterable[int]] = None,
        exc_thresh: float = -52.0,
    )

Source from the content-addressed store, hash-verified

254 """
255
256 def __init__(
257 self,
258 n_inpt: int,
259 n_neurons: int = 100,
260 inh: float = 17.5,
261 dt: float = 1.0,
262 nu: Optional[Union[float, Sequence[float]]] = (1e-4, 1e-2),
263 reduction: Optional[callable] = None,
264 wmin: Optional[float] = 0.0,
265 wmax: Optional[float] = 1.0,
266 norm: float = 78.4,
267 theta_plus: float = 0.05,
268 tc_theta_decay: float = 1e7,
269 inpt_shape: Optional[Iterable[int]] = None,
270 exc_thresh: float = -52.0,
271 ) -> None:
272 # language=rst
273 """
274 Constructor for class ``DiehlAndCook2015v2``.
275
276 :param n_inpt: Number of input neurons. Matches the 1D size of the input data.
277 :param n_neurons: Number of excitatory, inhibitory neurons.
278 :param inh: Strength of synapse weights from inhibitory to excitatory layer.
279 :param dt: Simulation time step.
280 :param nu: Single or pair of learning rates for pre- and post-synaptic events,
281 respectively.
282 :param reduction: Method for reducing parameter updates along the minibatch
283 dimension.
284 :param wmin: Minimum allowed weight on input to excitatory synapses.
285 :param wmax: Maximum allowed weight on input to excitatory synapses.
286 :param norm: Input to excitatory layer connection weights normalization
287 constant.
288 :param theta_plus: On-spike increment of ``DiehlAndCookNodes`` membrane
289 threshold potential.
290 :param tc_theta_decay: Time constant of ``DiehlAndCookNodes`` threshold
291 potential decay.
292 :param inpt_shape: The dimensionality of the input layer.
293 """
294 super().__init__(dt=dt)
295
296 self.n_inpt = n_inpt
297 self.inpt_shape = inpt_shape
298 self.n_neurons = n_neurons
299 self.inh = inh
300 self.dt = dt
301
302 input_layer = Input(
303 n=self.n_inpt, shape=self.inpt_shape, traces=True, tc_trace=20.0
304 )
305 self.add_layer(input_layer, name="X")
306
307 output_layer = DiehlAndCookNodes(
308 n=self.n_neurons,
309 traces=True,
310 rest=-65.0,
311 reset=-60.0,
312 thresh=exc_thresh,
313 refrac=5,

Callers

nothing calls this directly

Calls 6

InputClass · 0.90
DiehlAndCookNodesClass · 0.90
ConnectionClass · 0.90
add_layerMethod · 0.80
add_connectionMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected