braintools.cogtask.von_mises#
- braintools.cogtask.von_mises(key, coherence_key=None, kappa=2.0, base_value=0.5, max_coherence=100.0, as_index=True, num_dirs=None)[source]#
Von Mises (circular-normal) directional encoder.
Output is a normalized von Mises tuning curve in
[base_value, 1].- Parameters:
key (
str) – Context key holding the direction. Whenas_index=True(default) the value is an integer index in[0, num_dirs)and is converted to2π * idx / num_dirs. Whenas_index=Falseit is an angle in radians (matchingcircular).coherence_key (
str|None) – Context key with a coherence in[0, max_coherence]. IfNonethe encoder usesmax_coherence(full strength).kappa (
float) – Concentration parameter; higher values give sharper tuning.base_value (
float) – Floor of the response after normalization.max_coherence (
float) – Coherence normalization constant.as_index (
bool) – Interpretctx[key]as an integer index rather than radians. The default matches the working-memory tasks which passsample_idx.num_dirs (
int|None) – Number of discrete directions whenas_index=True. Defaults tofeature.num.
- Return type:
Examples
>>> inputs={'motion': von_mises('direction', 'coherence', as_index=False)} >>> inputs={'stimulus': von_mises('sample_idx', num_dirs=8)}