hxtorch.spiking.BatchDropout
-
class
hxtorch.spiking.BatchDropout(size: int, dropout: float, experiment: Experiment) Bases:
hxtorch.spiking.modules.hx_module.HXFunctionalModuleBatch dropout layer
Caveat: In-place operations on TensorHandles are not supported. Must be placed after a neuron layer, i.e. AELIF.
-
__init__(size: int, dropout: float, experiment: Experiment) → None Initialize BatchDropout layer. This layer disables spiking neurons in the previous spiking Neuron layer with a probability of dropout. Note, size has to be equal to the size in the corresponding spiking layer. The spiking mask is maintained for the whole batch.
- Parameters
size – Size of the population this dropout layer is applied to.
dropout – Probability that a neuron in the precessing layer gets disabled during training.
experiment – Experiment to append layer to.
Methods
__init__(size, dropout, experiment)Initialize BatchDropout layer.
Add additional information
forward_func(input)set_mask()Creates a new random dropout mask, applied to the spiking neurons in the previous module.
Attributes
Getter for spike mask.
-
extra_repr() → str Add additional information
-
forward_func(input: types.Handle_current_membrane_cadc_membrane_madc_spikes) → types.Handle_current_membrane_cadc_membrane_madc_spikes
-
property
mask Getter for spike mask.
- Returns
Returns the current spike mask.
-
output_type alias of
types.Handle_current_membrane_cadc_membrane_madc_spikes
-
set_mask() → None Creates a new random dropout mask, applied to the spiking neurons in the previous module. If module.eval() dropout will be disabled.
- Returns
Returns a random boolean spike mask of size self.size.
-