pub struct VNode<D, T = f32>{ /* private fields */ }Expand description
This struct manifests the partitions automatically allocated by the runtime as virtualized workspaces responsible for maintaining their plant’s. Their capabilities are defined by the current operator, allowing a node to become an observer, agent, etc
Node’s equip their plants (or drivers) with everything needed to successfully execute a given transaction, providing storage and networking capabilities while abstracting away platform-specific logic. This enables plant’s to retain their topological and mathematical properties and reduces overhead in the process.
VNode’s are rely on a topological memory system to facilitate various operations. This memory system is responsible for storing and managing the topological features of the plant, such as the current state, critical points, and navigational history.
Additionally, each instance is equipped with its own neural network designed to materialize the surface of the node’s headspace. This process specifically speaks to the dynamic configuration of a neural network with respect to a topological entity. This provides the system with an additional degree of freedom when it comes to learning as certain engines are capable of learning the rules of headspace leaving the surface to predict and learn more traditional patterns.
Implementations§
Source§impl<T> VNode<Plant<NeuralEngine<T>>, T>where
T: Float + FromPrimitive + ScalarOperand,
NeuralEngine<T>: ComputationalEngine<usize, [usize; 3], Store = Vec<usize>>,
impl<T> VNode<Plant<NeuralEngine<T>>, T>where
T: Float + FromPrimitive + ScalarOperand,
NeuralEngine<T>: ComputationalEngine<usize, [usize; 3], Store = Vec<usize>>,
pub fn adapt_weights_to_target( &mut self, pattern: Tail<usize, usize>, ) -> Result<(), ActorError>
Sourcepub fn execute_with_stored(&mut self) -> Result<(), ActorError>
pub fn execute_with_stored(&mut self) -> Result<(), ActorError>
execute the driver with the stored data
Source§impl<D, T> VNode<D, T>where
D: RawDriver<Triad>,
T: Float + FromPrimitive + ToPrimitive + NumAssign + ScalarOperand + Sum + FromStr,
impl<D, T> VNode<D, T>where
D: RawDriver<Triad>,
T: Float + FromPrimitive + ToPrimitive + NumAssign + ScalarOperand + Sum + FromStr,
Sourcepub fn adapt_stability_patterns(
&mut self,
source_class: Triads,
) -> Result<(), ActorError>
pub fn adapt_stability_patterns( &mut self, source_class: Triads, ) -> Result<(), ActorError>
Apply learned stability patterns from another triad class to the current one
Sourcepub fn adapt_surface_to_external_patterns<I>(
&mut self,
patterns: I,
) -> Result<(), ActorError>
pub fn adapt_surface_to_external_patterns<I>( &mut self, patterns: I, ) -> Result<(), ActorError>
Adapt the surface network weights based on patterns from another node
Sourcepub fn adjust_surface_parameters(
&mut self,
target: &(T, T, T),
rate: T,
) -> Result<(), ActorError>
pub fn adjust_surface_parameters( &mut self, target: &(T, T, T), rate: T, ) -> Result<(), ActorError>
Adjust surface parameters towards target parameters
Sourcepub fn apply_federated_gradients(
&mut self,
averaged_gradients: &HashMap<String, Vec<Vec<T>>>,
) -> Result<(), ActorError>
pub fn apply_federated_gradients( &mut self, averaged_gradients: &HashMap<String, Vec<Vec<T>>>, ) -> Result<(), ActorError>
Apply federated gradients to local model
Sourcepub fn calculate_adaptive_feature_target(&self) -> usizewhere
T: FromStr,
pub fn calculate_adaptive_feature_target(&self) -> usizewhere
T: FromStr,
Calculate adaptive target for maximum feature count
Sourcepub fn consolidate_similar_patterns(
&mut self,
similarity_threshold: T,
) -> Result<usize, ActorError>
pub fn consolidate_similar_patterns( &mut self, similarity_threshold: T, ) -> Result<usize, ActorError>
Consolidate similar patterns to reduce memory usage
Sourcepub fn contextualize(&mut self) -> Result<ActorContext<T>, ActorError>
pub fn contextualize(&mut self) -> Result<ActorContext<T>, ActorError>
Get contextual information about the current state
Sourcepub fn create_stability_patterns_for_class(
&self,
class: Triads,
) -> Vec<StabilityPattern<T>> ⓘ
pub fn create_stability_patterns_for_class( &self, class: Triads, ) -> Vec<StabilityPattern<T>> ⓘ
Create stability patterns specific to the current headspace
Sourcepub fn distance_to_critical_point(&self, name: &str) -> Option<usize>
pub fn distance_to_critical_point(&self, name: &str) -> Option<usize>
Calculate distance from headspace root to critical point
Sourcepub fn distance_to_point(&self, point: usize) -> usize
pub fn distance_to_point(&self, point: usize) -> usize
Calculate distance to a point
pub fn ensure_surface_network(
&mut self,
) -> Result<&mut SurfaceNetwork<T>, ActorError>where
StandardNormal: Distribution<T>,
Sourcepub fn extract_knowledge_patterns(&self) -> Result<Vec<Vec<usize>>, ActorError>
pub fn extract_knowledge_patterns(&self) -> Result<Vec<Vec<usize>>, ActorError>
Extract knowledge patterns in a discrete form
Sourcepub fn extract_learning_gradients(
&self,
) -> Result<HashMap<String, Vec<T>>, ActorError>
pub fn extract_learning_gradients( &self, ) -> Result<HashMap<String, Vec<T>>, ActorError>
Extract learning gradients for federated learning
Find features related to the current triad
Sourcepub fn find_paths_to_point(&self, target: usize) -> Vec<Vec<LPR>>
pub fn find_paths_to_point(&self, target: usize) -> Vec<Vec<LPR>>
Find paths to a triad containing the target pitch
Sourcepub fn get_frequently_visited_triads(
&self,
min_occurrences: usize,
) -> Vec<Triad>
pub fn get_frequently_visited_triads( &self, min_occurrences: usize, ) -> Vec<Triad>
Get a list of triads that have been frequently visited
Sourcepub fn get_convergence_rate(&self) -> T
pub fn get_convergence_rate(&self) -> T
Get convergence rate for learning
Sourcepub fn get_feature_quality(&self) -> T
pub fn get_feature_quality(&self) -> T
Get feature quality metric
Sourcepub fn get_learning_accuracy(&self) -> Twhere
T: FromStr,
pub fn get_learning_accuracy(&self) -> Twhere
T: FromStr,
Get the current learning accuracy
Sourcepub fn get_memory_statistics(&self) -> MemoryStatistics<T>
pub fn get_memory_statistics(&self) -> MemoryStatistics<T>
Get statistics about the memory state
Sourcepub fn get_stability_patterns(&self) -> Option<Vec<StabilityPattern<T>>>
pub fn get_stability_patterns(&self) -> Option<Vec<StabilityPattern<T>>>
Get learned stability patterns from this node’s surface network
Sourcepub fn get_surface_parameters(&self) -> (T, T, T)
pub fn get_surface_parameters(&self) -> (T, T, T)
Get surface network parameters
Sourcepub fn identify_critical_point(&mut self, name: &str, pitch: usize)
pub fn identify_critical_point(&mut self, name: &str, pitch: usize)
Identify a critical point in the tonal space
pub fn init_surface(&mut self) -> Result<(), ActorError>where
StandardNormal: Distribution<T>,
Sourcepub fn integrate_external_knowledge(
&mut self,
patterns: &[Vec<usize>],
source_id: &EdgeId,
) -> Result<(), ActorError>
pub fn integrate_external_knowledge( &mut self, patterns: &[Vec<usize>], source_id: &EdgeId, ) -> Result<(), ActorError>
Integrate knowledge from another node
Sourcepub fn learn_headspace(&mut self) -> Result<(), ActorError>
pub fn learn_headspace(&mut self) -> Result<(), ActorError>
Learn headspace based on its structure and critical points
Sourcepub fn learn_pattern<X, Y, Z>(
&mut self,
inputs: &X,
targets: &Y,
iterations: usize,
) -> Result<(), ActorError>where
SurfaceModel<T>: Train<X, Y, Output = Z>,
pub fn learn_pattern<X, Y, Z>(
&mut self,
inputs: &X,
targets: &Y,
iterations: usize,
) -> Result<(), ActorError>where
SurfaceModel<T>: Train<X, Y, Output = Z>,
Learn a pattern from inputs within current headspace
Sourcepub fn learn_stability_characteristics(&mut self) -> Result<(), ActorError>where
D: TriadDriver,
pub fn learn_stability_characteristics(&mut self) -> Result<(), ActorError>where
D: TriadDriver,
Learn stability characteristics specific to the current chord class
Sourcepub fn learn_stability_patterns(
&mut self,
_patterns: &[StabilityPattern],
) -> Result<(), ActorError>
pub fn learn_stability_patterns( &mut self, _patterns: &[StabilityPattern], ) -> Result<(), ActorError>
Learn stability patterns from other nodes
Sourcepub fn learn_surface(&mut self) -> Result<(), ActorError>
pub fn learn_surface(&mut self) -> Result<(), ActorError>
Learn the surface defined by critical points
Sourcepub fn learn_transformation_sequence(
&mut self,
transforms: &[LPR],
) -> Result<(), ActorError>
pub fn learn_transformation_sequence( &mut self, transforms: &[LPR], ) -> Result<(), ActorError>
Learn a transformation sequence
Navigate to satisfy a specific critical point
Sourcepub fn optimize_memory(
&mut self,
max_features: usize,
) -> Result<VirtualMemoryAnalysis<T>, ActorError>
pub fn optimize_memory( &mut self, max_features: usize, ) -> Result<VirtualMemoryAnalysis<T>, ActorError>
Optimize memory usage with intelligent feature management
Sourcepub fn predict_next_transformation(&self) -> Option<LPR>
pub fn predict_next_transformation(&self) -> Option<LPR>
Predict the next likely transformation based on patterns in memory
Sourcepub fn process_message(
&mut self,
source: EdgeId,
message: &[u8],
) -> Result<(), ActorError>
pub fn process_message( &mut self, source: EdgeId, message: &[u8], ) -> Result<(), ActorError>
Process a message from another node
Sourcepub fn process_surface<X, Y>(&self, input: &X) -> Result<Y, ActorError>where
SurfaceModel<T>: Predict<X, Output = Y>,
pub fn process_surface<X, Y>(&self, input: &X) -> Result<Y, ActorError>where
SurfaceModel<T>: Predict<X, Output = Y>,
Process an input through the surface network to predict behavior
Sourcepub fn propose_transformation(&self) -> Option<LPR>
pub fn propose_transformation(&self) -> Option<LPR>
Have the active operator propose a transformation (if supported)
Sourcepub fn resource_requirements(&self) -> (usize, usize)
pub fn resource_requirements(&self) -> (usize, usize)
Get the resource requirements for this node
Sourcepub fn prune_low_importance_features(
&mut self,
threshold: T,
) -> Result<(), ActorError>
pub fn prune_low_importance_features( &mut self, threshold: T, ) -> Result<(), ActorError>
Prune low-importance features
Share patterns with another node
Sourcepub fn train_surface<X, Y, Z>(
&mut self,
inputs: &X,
targets: &Y,
) -> Result<Z, ActorError>where
T: Debug + Send + Sync + Signed + FftNum,
SurfaceModel<T>: Train<X, Y, Output = Z>,
StandardNormal: Distribution<T>,
pub fn train_surface<X, Y, Z>(
&mut self,
inputs: &X,
targets: &Y,
) -> Result<Z, ActorError>where
T: Debug + Send + Sync + Signed + FftNum,
SurfaceModel<T>: Train<X, Y, Output = Z>,
StandardNormal: Distribution<T>,
Train the surface network on a pattern
Sourcepub fn transform(&mut self, transform: LPR) -> Result<(), ActorError>where
D: TriadDriver,
pub fn transform(&mut self, transform: LPR) -> Result<(), ActorError>where
D: TriadDriver,
Apply a transformation to the plant and record in memory
Sourcepub fn transform_batch(&mut self, transforms: &[LPR]) -> Result<(), ActorError>where
D: TriadDriver,
pub fn transform_batch(&mut self, transforms: &[LPR]) -> Result<(), ActorError>where
D: TriadDriver,
Efficiently apply multiple transformations in batch
Sourcepub fn update_surface_headspace(&mut self) -> Result<(), ActorError>
pub fn update_surface_headspace(&mut self) -> Result<(), ActorError>
Update the surface network when the headspace changes
Source§impl<D, T> VNode<D, T>
impl<D, T> VNode<D, T>
Sourcepub fn from_driver(plant: D) -> Self
pub fn from_driver(plant: D) -> Self
Create a new virtual node with topological memory
Sourcepub fn from_headspace(headspace: Triad) -> Self
pub fn from_headspace(headspace: Triad) -> Self
initialize a new virtual node from the given headspace
Sourcepub const fn critical_points(&self) -> &HashMap<String, usize>
pub const fn critical_points(&self) -> &HashMap<String, usize>
return an immutable reference to the critical points
Sourcepub const fn critical_points_mut(&mut self) -> &mut HashMap<String, usize>
pub const fn critical_points_mut(&mut self) -> &mut HashMap<String, usize>
return a mutable reference to the critical points
Sourcepub const fn driver_mut(&mut self) -> &mut D
pub const fn driver_mut(&mut self) -> &mut D
return a mutable reference to the plant
Sourcepub fn headspace_mut(&mut self) -> &mut Triad
pub fn headspace_mut(&mut self) -> &mut Triad
returns a mutable reference to the node’s headspace
Sourcepub fn last_context(&self) -> Option<&(ActorContext<T>, Instant)>
pub fn last_context(&self) -> Option<&(ActorContext<T>, Instant)>
returns an immutable reference to the last context
Sourcepub fn last_context_mut(&mut self) -> Option<&mut (ActorContext<T>, Instant)>
pub fn last_context_mut(&mut self) -> Option<&mut (ActorContext<T>, Instant)>
returns a mutable reference to the last context
Sourcepub const fn store(&self) -> &TopoLedger<T>
pub const fn store(&self) -> &TopoLedger<T>
return an immutable reference to the memory system
Sourcepub const fn store_mut(&mut self) -> &mut TopoLedger<T>
pub const fn store_mut(&mut self) -> &mut TopoLedger<T>
return a mutable reference to the memory system
pub const fn memory(&self) -> &TopoLedger<T>
store insteadpub const fn memory_mut(&mut self) -> &mut TopoLedger<T>
store_mut insteadSourcepub const fn operator(&self) -> &Operator<T>
pub const fn operator(&self) -> &Operator<T>
returns an immutable reference to the actor of the node
Sourcepub const fn operator_mut(&mut self) -> &mut Operator<T>
pub const fn operator_mut(&mut self) -> &mut Operator<T>
returns a mutable reference to the actor of the node
Sourcepub fn surface(&self) -> Option<&SurfaceNetwork<T>>
pub fn surface(&self) -> Option<&SurfaceNetwork<T>>
returns an immutable reference to the surface network
Sourcepub fn surface_mut(&mut self) -> Option<&mut SurfaceNetwork<T>>
pub fn surface_mut(&mut self) -> Option<&mut SurfaceNetwork<T>>
returns a mutable reference to the surface network
Sourcepub const fn tonic_history(&self) -> &Vec<usize>
pub const fn tonic_history(&self) -> &Vec<usize>
returns an immutable reference the tonic history
Sourcepub const fn tonic_history_mut(&mut self) -> &mut Vec<usize>
pub const fn tonic_history_mut(&mut self) -> &mut Vec<usize>
returns a mutable reference to the history of the node
Sourcepub fn set_id(&mut self, id: Id) -> &mut Self
pub fn set_id(&mut self, id: Id) -> &mut Self
update the id and return a mutable reference to the node
Sourcepub fn set_critical_points(
&mut self,
critical_points: HashMap<String, usize>,
) -> &mut Self
pub fn set_critical_points( &mut self, critical_points: HashMap<String, usize>, ) -> &mut Self
update the current critical points and return a mutable reference to the node
Sourcepub fn set_driver(&mut self, driver: D) -> &mut Self
pub fn set_driver(&mut self, driver: D) -> &mut Self
update the current driver and return a mutable reference to the node
Sourcepub fn set_operator(&mut self, operator: Operator<T>) -> &mut Self
pub fn set_operator(&mut self, operator: Operator<T>) -> &mut Self
update the current operator and return a mutable reference to the node
Sourcepub fn set_store(&mut self, store: TopoLedger<T>) -> &mut Self
pub fn set_store(&mut self, store: TopoLedger<T>) -> &mut Self
update the current memory system and return a mutable reference to the node
Sourcepub fn set_surface(&mut self, surface: Option<SurfaceNetwork<T>>) -> &mut Self
pub fn set_surface(&mut self, surface: Option<SurfaceNetwork<T>>) -> &mut Self
update the current surface network and return a mutable reference to the node
Sourcepub fn set_tonic_history(&mut self, tonic_history: Vec<usize>) -> &mut Self
pub fn set_tonic_history(&mut self, tonic_history: Vec<usize>) -> &mut Self
update the current tonic history and return a mutable reference to the node
Sourcepub fn with_critical_points(
self,
critical_points: HashMap<String, usize>,
) -> Self
pub fn with_critical_points( self, critical_points: HashMap<String, usize>, ) -> Self
consumes the node to create another with the given critical points
Sourcepub fn with_driver(self, driver: D) -> Self
pub fn with_driver(self, driver: D) -> Self
consumes the node to create another with the given driver
Sourcepub fn with_operator(self, operator: Operator<T>) -> Self
pub fn with_operator(self, operator: Operator<T>) -> Self
consumes the node to create another with the given operator
Sourcepub fn with_store(self, store: TopoLedger<T>) -> Self
pub fn with_store(self, store: TopoLedger<T>) -> Self
consumes the node to create another with the given memory system
Sourcepub fn with_surface(self, surface: Option<SurfaceNetwork<T>>) -> Self
pub fn with_surface(self, surface: Option<SurfaceNetwork<T>>) -> Self
consumes the node to create another with the given surface network
Sourcepub fn with_tonic_history(self, tonic_history: Vec<usize>) -> Self
pub fn with_tonic_history(self, tonic_history: Vec<usize>) -> Self
consumes the node to create another with the given tonic history
Sourcepub fn add_critical_point(
&mut self,
name: PointKind,
pitch_class: usize,
) -> Option<usize>
pub fn add_critical_point( &mut self, name: PointKind, pitch_class: usize, ) -> Option<usize>
consumes the node to create another with the given surface network add a critical point to the plant and return the previous value, if it exists.
Sourcepub fn calculate_centroid(&self) -> Option<[T; 2]>where
T: Float + FromPrimitive,
pub fn calculate_centroid(&self) -> Option<[T; 2]>where
T: Float + FromPrimitive,
compute the centroid of the headspace
Sourcepub const fn kind(&self) -> OperatorKind
pub const fn kind(&self) -> OperatorKind
Get the current operator mode
Record a successful navigation from one point to another
Sourcepub fn remove_critical_point(&mut self, name: PointKind) -> Option<usize>
pub fn remove_critical_point(&mut self, name: PointKind) -> Option<usize>
Remove a critical point from the plant
pub fn critical_point_count(&self) -> usize
total_critical_points insteadpub fn feature_count(&self) -> usize
total_features insteadSourcepub fn total_critical_points(&self) -> usize
pub fn total_critical_points(&self) -> usize
returns the number of critical points
Sourcepub fn total_features(&self) -> usize
pub fn total_features(&self) -> usize
Get the number of features in memory
Sourcepub fn has_surface_network(&self) -> bool
pub fn has_surface_network(&self) -> bool
returns true if the node has initialized a surface network
Sourcepub fn record_state(&mut self) -> usize
pub fn record_state(&mut self) -> usize
Record the current state in memory
Sourcepub fn set_last_context(&mut self, context: ActorContext<T>)
pub fn set_last_context(&mut self, context: ActorContext<T>)
set the last context of the node
Sourcepub fn set_operator_by_kind(&mut self, mode: OperatorKind)
pub fn set_operator_by_kind(&mut self, mode: OperatorKind)
set the operator by kind
Trait Implementations§
impl<D, T> Eq for VNode<D, T>
Auto Trait Implementations§
impl<D, T> Freeze for VNode<D, T>
impl<D, T> RefUnwindSafe for VNode<D, T>where
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<D, T> Send for VNode<D, T>where
T: Send,
impl<D, T> Sync for VNode<D, T>where
T: Sync,
impl<D, T> Unpin for VNode<D, T>
impl<D, T> UnwindSafe for VNode<D, T>
Blanket Implementations§
Source§impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<K, S> Identity<K> for Swhere
S: Borrow<K>,
K: Identifier,
impl<K, S> Identity<K> for Swhere
S: Borrow<K>,
K: Identifier,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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