Skip to main content

Module class_potential

Module class_potential 

Source
Expand description

Neuron voxels in FEAGI represent spatial locations containing neural activity.

In FEAGI’s visualization (such as Brain Visualizer), neurons are represented as voxels where each voxel can contain one or more neurons. This module provides structures for handling neuron voxel representations in various formats and containers. Class-id encoding for single-layer (W×H×1) class maps.

Object segmentation input, object segmentation output, and classifier detection twins carry one voxel per pixel. The class is the potential: (class_id + 1) / class_count, always in (0, 1]. Zero means unlabeled, so the Misc codec’s [-1, 1] range and near-zero cutoff both hold.

@cursor:ffi-safe - pure arithmetic, no allocation.

Constants§

MAX_CLASS_COUNT
Largest class count the encoding supports. Misc drops |p| <= 1e-4, so the smallest encoded class 1 / class_count must stay above that cutoff.

Functions§

decode_class_potential
Class id carried by potential, or None when it names no class.
encode_class_potential
Potential for class_id in a map of class_count classes.
validate_class_count
Class counts must be in 1..=MAX_CLASS_COUNT.