pub struct Classifier {Show 17 fields
pub classifier_id: String,
pub name: String,
pub parent_region_id: String,
pub coordinates_3d: [i32; 3],
pub sample_area_ids: Vec<String>,
pub class_bindings: Vec<ClassifierClassBinding>,
pub sample_memory_id: String,
pub class_memory_id: String,
pub error_area_id: String,
pub correct_area_id: String,
pub reward_training: bool,
pub answer_feedback_area_id: Option<String>,
pub reward_modulator_ids: Vec<String>,
pub answer_latency_bursts: u32,
pub learn_area_id: Option<String>,
pub confidence_area_id: Option<String>,
pub properties: HashMap<String, Value>,
}Expand description
First-class classifier record persisted in the genome.
Fields§
§classifier_id: StringUUID string, genome map key.
name: String§parent_region_id: StringCircuit region that contains this assembly.
That region is a child of the region the user added the classifier to, and that parent may be root. The memory and error areas belong to this circuit, not to root.
coordinates_3d: [i32; 3]§sample_area_ids: Vec<String>Episodic sample inputs on the sample memory. Order is not significant.
class_bindings: Vec<ClassifierClassBinding>Episodic class inputs and the output created for each one.
sample_memory_id: StringOwned sample memory. Deleting it deletes the classifier.
class_memory_id: StringOwned class memory. Deleting it deletes the classifier.
error_area_id: StringOwned 1x1x1 area. Fires when any class output mismatches its class input or has more than one firing neuron.
correct_area_id: StringOwned 1x1x1 area. Fires when every firing class input is answered by its class output and no output raises the error. Empty on classifiers created before it existed.
reward_training: boolPer-pattern pain and pleasure on the associative mapping.
answer_feedback_area_id: Option<String>Correct-answer area. Empty until the user selects one.
reward_modulator_ids: Vec<String>synaptic.reward modulators the associative mapping learns from (R-STDP).
The classifier’s own right-answer and wrong-answer modulators are listed here
like any other source.
answer_latency_bursts: u32Bursts between a decision and the answer that grades it. Zero grades the same burst.
learn_area_id: Option<String>When set, pain and pleasure run only on bursts this area fires.
confidence_area_id: Option<String>OPU that receives one surplus value per class channel.
properties: HashMap<String, Value>Implementations§
Source§impl Classifier
impl Classifier
Sourcepub fn assembly_core_ids(&self) -> Vec<String>
pub fn assembly_core_ids(&self) -> Vec<String>
Sample memory and class memory. Deleting either deletes the assembly.
Sourcepub fn owned_area_ids(&self) -> Vec<String>
pub fn owned_area_ids(&self) -> Vec<String>
Owned internals deleted with the classifier.
Sourcepub fn input_area_ids(&self) -> Vec<String>
pub fn input_area_ids(&self) -> Vec<String>
Referenced input areas that may be cleared independently.
Sourcepub fn clear_answer_area(&mut self, area_id: &str) -> bool
pub fn clear_answer_area(&mut self, area_id: &str) -> bool
Forget a deleted error or correct area. Returns true when area_id was one of them.
The next reward update creates the area again.
pub fn owns_assembly_core(&self, area_id: &str) -> bool
Sourcepub fn owns_area(&self, area_id: &str) -> bool
pub fn owns_area(&self, area_id: &str) -> bool
True when area_id is sample memory, class memory, the error area, or a class output.
pub fn binding_for_class( &self, class_area_id: &str, ) -> Option<&ClassifierClassBinding>
pub fn binding_for_output( &self, output_area_id: &str, ) -> Option<&ClassifierClassBinding>
Sourcepub fn references_input(&self, area_id: &str) -> bool
pub fn references_input(&self, area_id: &str) -> bool
True when area_id is a referenced sample or class input of this classifier.
Sourcepub fn apply_metadata_update(
&mut self,
name: Option<String>,
coordinates_3d: Option<[i32; 3]>,
) -> Result<(), String>
pub fn apply_metadata_update( &mut self, name: Option<String>, coordinates_3d: Option<[i32; 3]>, ) -> Result<(), String>
Apply classifier-level metadata. Does not change owned internals or inputs.
Sourcepub fn apply_assembly_update(
&mut self,
name: Option<String>,
coordinates_3d: Option<[i32; 3]>,
parent_region_id: Option<String>,
) -> Result<(), String>
pub fn apply_assembly_update( &mut self, name: Option<String>, coordinates_3d: Option<[i32; 3]>, parent_region_id: Option<String>, ) -> Result<(), String>
Apply classifier-level edit. Does not replace owned internals or input bindings.
Sourcepub fn required_mappings(&self) -> Vec<ClassifierMapping>
pub fn required_mappings(&self) -> Vec<ClassifierMapping>
Mappings this classifier requires given its current inputs.
Sourcepub fn clear_input(&mut self, area_id: &str) -> Option<String>
pub fn clear_input(&mut self, area_id: &str) -> Option<String>
Drop an input reference when that area is deleted.
Returns the class output id that must be deleted with a removed class input.
Sourcepub fn attach_sample(&mut self, sample_area_id: String) -> Result<(), String>
pub fn attach_sample(&mut self, sample_area_id: String) -> Result<(), String>
Record one sample input. A second call for the same area is a no-op success.
Sourcepub fn detach_sample(&mut self, sample_area_id: &str) -> bool
pub fn detach_sample(&mut self, sample_area_id: &str) -> bool
Remove one sample input.
Sourcepub fn attach_class(
&mut self,
class_area_id: String,
class_output_area_id: String,
) -> Result<(), String>
pub fn attach_class( &mut self, class_area_id: String, class_output_area_id: String, ) -> Result<(), String>
Record one class input and its output. The output id may be filled after the area exists.
Sourcepub fn set_class_output(
&mut self,
class_area_id: &str,
class_output_area_id: String,
) -> Result<(), String>
pub fn set_class_output( &mut self, class_area_id: &str, class_output_area_id: String, ) -> Result<(), String>
Fill the output id for a class input that was recorded before the area existed.
Sourcepub fn detach_class(&mut self, class_area_id: &str) -> Option<String>
pub fn detach_class(&mut self, class_area_id: &str) -> Option<String>
Remove one class binding. Returns the output area id when one was recorded.
Sourcepub fn apply_mapping_change(
&mut self,
src_area_id: &str,
dst_area_id: &str,
morphology_id: &str,
removed: bool,
) -> Result<ClassifierMappingEffect, String>
pub fn apply_mapping_change( &mut self, src_area_id: &str, dst_area_id: &str, morphology_id: &str, removed: bool, ) -> Result<ClassifierMappingEffect, String>
Bind or clear sample and class inputs from a mapping change.
applied is false when the edge does not belong to this classifier.
removed_output_id is set when a class input mapping is removed.
Trait Implementations§
Source§impl Clone for Classifier
impl Clone for Classifier
Source§impl Debug for Classifier
impl Debug for Classifier
Source§impl<'de> Deserialize<'de> for Classifier
impl<'de> Deserialize<'de> for Classifier
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Classifier
impl PartialEq for Classifier
Source§impl Serialize for Classifier
impl Serialize for Classifier
impl StructuralPartialEq for Classifier
Auto Trait Implementations§
impl Freeze for Classifier
impl RefUnwindSafe for Classifier
impl Send for Classifier
impl Sync for Classifier
impl Unpin for Classifier
impl UnsafeUnpin for Classifier
impl UnwindSafe for Classifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more