engine.ensemble.analog

Analog ensemble variants.

Currently, AnalogNeuron or OscillatorNeuron can be used as base classes. Analog neurons simply add the input to the state stored in voltage, while oscillators are capable of generating an arbitrary combination of sine waves, with basic support for phase-amplitude coupling via component amplitude oscillations.

Ensembles can be initialized programmatically or from a configuration YAML containing neuron parameters and their generation method (fixed, zipped, grid, or from distribution). Forward calls invoke the parent neuron class method.

class engine.ensemble.analog.AnalogEnsemble(**kwargs)

Ensemble of generic analog neurons.

class engine.ensemble.analog.OscillatorEnsemble(num_wave_comps: int = 1, **kwargs)

Ensemble of oscillators.

Parameters:

num_wave_comps (int) – Number of components in each composite sinusoidal.

Note

To initialize an ensemble where the number of frequency components differs across elements, set num_wave_comps to the maximal number and unnecessary elements to 0.

For instance, frequencies: [[34.0, 41.0, 50.0], [30.0, 0.0, 0.0]] would yield a 2-ensemble where the first element is the sum of three sine components and the second element is a simple 30Hz wave.

Sapicore does not currently support the configuration syntax [[34.0, 41.0, 50.0], [30.0]] due to the inconvenience of dealing with variable-length tensors.

heterogenize(num_combinations: int, unravel: bool = True)

Ensures that calling an oscillator’s heterogenize() will result in a correct row-wise treatment of tensor attributes and update the waveform iterators.

Note

This is necessary, as heterogenize is sometimes invoked from ambiguous ensemble classes (e.g., in Network, when ensembles are initialized from file and dynamically imported).