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

Method __init__

bindsnet/models/models.py:465–584  ·  view source on GitHub ↗

Constructor for class ``LocallyConnectedNetwork``. Uses ``DiehlAndCookNodes`` to avoid multiple spikes per timestep in the output layer population. :param n_inpt: Number of input neurons. Matches the 1D size of the input data. :param input_shape: Two-dimensional sha

(
        self,
        n_inpt: int,
        input_shape: List[int],
        kernel_size: Union[int, Tuple[int, int]],
        stride: Union[int, Tuple[int, int]],
        n_filters: int,
        inh: float = 25.0,
        dt: float = 1.0,
        nu: Optional[Union[float, Sequence[float]]] = (1e-4, 1e-2),
        reduction: Optional[callable] = None,
        theta_plus: float = 0.05,
        tc_theta_decay: float = 1e7,
        wmin: float = 0.0,
        wmax: float = 1.0,
        norm: Optional[float] = 0.2,
        exc_thresh: float = -52.0,
    )

Source from the content-addressed store, hash-verified

463 """
464
465 def __init__(
466 self,
467 n_inpt: int,
468 input_shape: List[int],
469 kernel_size: Union[int, Tuple[int, int]],
470 stride: Union[int, Tuple[int, int]],
471 n_filters: int,
472 inh: float = 25.0,
473 dt: float = 1.0,
474 nu: Optional[Union[float, Sequence[float]]] = (1e-4, 1e-2),
475 reduction: Optional[callable] = None,
476 theta_plus: float = 0.05,
477 tc_theta_decay: float = 1e7,
478 wmin: float = 0.0,
479 wmax: float = 1.0,
480 norm: Optional[float] = 0.2,
481 exc_thresh: float = -52.0,
482 ) -> None:
483 # language=rst
484 """
485 Constructor for class ``LocallyConnectedNetwork``. Uses ``DiehlAndCookNodes`` to
486 avoid multiple spikes per timestep in the output layer population.
487
488 :param n_inpt: Number of input neurons. Matches the 1D size of the input data.
489 :param input_shape: Two-dimensional shape of input population.
490 :param kernel_size: Size of input windows. Integer or two-tuple of integers.
491 :param stride: Length of horizontal, vertical stride across input space. Integer
492 or two-tuple of integers.
493 :param n_filters: Number of locally connected filters per input region. Integer
494 or two-tuple of integers.
495 :param inh: Strength of synapse weights from output layer back onto itself.
496 :param dt: Simulation time step.
497 :param nu: Single or pair of learning rates for pre- and post-synaptic events,
498 respectively.
499 :param reduction: Method for reducing parameter updates along the minibatch
500 dimension.
501 :param wmin: Minimum allowed weight on ``Input`` to ``DiehlAndCookNodes``
502 synapses.
503 :param wmax: Maximum allowed weight on ``Input`` to ``DiehlAndCookNodes``
504 synapses.
505 :param theta_plus: On-spike increment of ``DiehlAndCookNodes`` membrane
506 threshold potential.
507 :param tc_theta_decay: Time constant of ``DiehlAndCookNodes`` threshold
508 potential decay.
509 :param norm: ``Input`` to ``DiehlAndCookNodes`` layer connection weights
510 normalization constant.
511 """
512 super().__init__(dt=dt)
513
514 kernel_size = _pair(kernel_size)
515 stride = _pair(stride)
516
517 self.n_inpt = n_inpt
518 self.input_shape = input_shape
519 self.kernel_size = kernel_size
520 self.stride = stride
521 self.n_filters = n_filters
522 self.inh = inh

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected