braintools.cogtask.circular#
- braintools.cogtask.circular(key, coherence_key=None, base_value=0.5, max_coherence=100.0, as_index=False, num_dirs=None)[source]#
Cosine-tuned directional encoder.
The output of unit i (for i in [0, feature.num)) is
base_value + (coh / (2 * max_coherence)) * cos(pref_i - direction), where preferred directionspref_iare uniformly spaced on the circle.- Parameters:
key (
str) – Context key holding the direction. By default this is an angle in radians; ifas_index=True, it is interpreted as an integer index in[0, num_dirs)and converted to2π * idx / num_dirs.coherence_key (
str|None) – Context key with a coherence in[0, max_coherence]. IfNonethe encoder usesmax_coherence(full strength).base_value (
float) – Additive baseline (default0.5).max_coherence (
float) – Coherence normalization constant (default100).as_index (
bool) – Interpretctx[key]as an integer index rather than radians.num_dirs (
int|None) – Number of discrete directions whenas_index=True. Defaults tofeature.num.
- Return type:
Examples
>>> inputs={'motion': circular('direction', 'coherence')} >>> inputs={'stimulus': circular('sample_idx', as_index=True, num_dirs=8)}