Constructor for class ``IncreasingInhibitionNetwork``. :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 la
(
self,
n_input: int,
n_neurons: int = 100,
start_inhib: float = 1.0,
max_inhib: float = 100.0,
dt: float = 1.0,
nu: Optional[Union[float, Sequence[float]]] = (1e-4, 1e-2),
reduction: Optional[callable] = None,
wmin: float = 0.0,
wmax: 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,
)
| 354 | """ |
| 355 | |
| 356 | def __init__( |
| 357 | self, |
| 358 | n_input: int, |
| 359 | n_neurons: int = 100, |
| 360 | start_inhib: float = 1.0, |
| 361 | max_inhib: float = 100.0, |
| 362 | dt: float = 1.0, |
| 363 | nu: Optional[Union[float, Sequence[float]]] = (1e-4, 1e-2), |
| 364 | reduction: Optional[callable] = None, |
| 365 | wmin: float = 0.0, |
| 366 | wmax: float = 1.0, |
| 367 | norm: float = 78.4, |
| 368 | theta_plus: float = 0.05, |
| 369 | tc_theta_decay: float = 1e7, |
| 370 | inpt_shape: Optional[Iterable[int]] = None, |
| 371 | exc_thresh: float = -52.0, |
| 372 | ) -> None: |
| 373 | # language=rst |
| 374 | """ |
| 375 | Constructor for class ``IncreasingInhibitionNetwork``. |
| 376 | |
| 377 | :param n_inpt: Number of input neurons. Matches the 1D size of the input data. |
| 378 | :param n_neurons: Number of excitatory, inhibitory neurons. |
| 379 | :param inh: Strength of synapse weights from inhibitory to excitatory layer. |
| 380 | :param dt: Simulation time step. |
| 381 | :param nu: Single or pair of learning rates for pre- and post-synaptic events, |
| 382 | respectively. |
| 383 | :param reduction: Method for reducing parameter updates along the minibatch |
| 384 | dimension. |
| 385 | :param wmin: Minimum allowed weight on input to excitatory synapses. |
| 386 | :param wmax: Maximum allowed weight on input to excitatory synapses. |
| 387 | :param norm: Input to excitatory layer connection weights normalization |
| 388 | constant. |
| 389 | :param theta_plus: On-spike increment of ``DiehlAndCookNodes`` membrane |
| 390 | threshold potential. |
| 391 | :param tc_theta_decay: Time constant of ``DiehlAndCookNodes`` threshold |
| 392 | potential decay. |
| 393 | :param inpt_shape: The dimensionality of the input layer. |
| 394 | """ |
| 395 | super().__init__(dt=dt) |
| 396 | |
| 397 | self.n_input = n_input |
| 398 | self.n_neurons = n_neurons |
| 399 | self.n_sqrt = int(np.sqrt(n_neurons)) |
| 400 | self.start_inhib = start_inhib |
| 401 | self.max_inhib = max_inhib |
| 402 | self.dt = dt |
| 403 | self.inpt_shape = inpt_shape |
| 404 | |
| 405 | input_layer = Input( |
| 406 | n=self.n_input, shape=self.inpt_shape, traces=True, tc_trace=20.0 |
| 407 | ) |
| 408 | self.add_layer(input_layer, name="X") |
| 409 | |
| 410 | output_layer = DiehlAndCookNodes( |
| 411 | n=self.n_neurons, |
| 412 | traces=True, |
| 413 | rest=-65.0, |
nothing calls this directly
no test coverage detected