VNode

Struct VNode 

Source
pub struct VNode<D, T = f32>
where D: RawDriver<Triad>,
{ /* 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>

Source

pub fn adapt_weights_to_target( &mut self, pattern: Tail<usize, usize>, ) -> Result<(), ActorError>
where T: Sum + NumAssign,

Source

pub fn execute_with_stored(&mut self) -> Result<(), ActorError>
where T: Sum + NumAssign,

execute the driver with the stored data

Source

pub fn decode_driver_output(&self, outputs: Array1<T>) -> Tail<usize, usize>

use the driver to decode the outputs of the network into a meaningful tail

Source§

impl<D, T> VNode<D, T>

Source

pub fn adapt_stability_patterns( &mut self, source_class: Triads, ) -> Result<(), ActorError>

Apply learned stability patterns from another triad class to the current one

Source

pub fn adapt_surface_to_external_patterns<I>( &mut self, patterns: I, ) -> Result<(), ActorError>
where I: IntoIterator<Item = Vec<usize>>,

Adapt the surface network weights based on patterns from another node

Source

pub fn adjust_surface_parameters( &mut self, target: &(T, T, T), rate: T, ) -> Result<(), ActorError>

Adjust surface parameters towards target parameters

Source

pub fn apply_federated_gradients( &mut self, averaged_gradients: &HashMap<String, Vec<Vec<T>>>, ) -> Result<(), ActorError>

Apply federated gradients to local model

Source

pub fn calculate_adaptive_feature_target(&self) -> usize
where T: FromStr,

Calculate adaptive target for maximum feature count

Source

pub fn consolidate_similar_patterns( &mut self, similarity_threshold: T, ) -> Result<usize, ActorError>

Consolidate similar patterns to reduce memory usage

Source

pub fn contextualize(&mut self) -> Result<ActorContext<T>, ActorError>

Get contextual information about the current state

Source

pub fn create_stability_patterns_for_class( &self, class: Triads, ) -> Vec<StabilityPattern<T>>

Create stability patterns specific to the current headspace

Source

pub fn distance_to_critical_point(&self, name: &str) -> Option<usize>

Calculate distance from headspace root to critical point

Source

pub fn distance_to_point(&self, point: usize) -> usize

Calculate distance to a point

Source

pub fn ensure_surface_network( &mut self, ) -> Result<&mut SurfaceNetwork<T>, ActorError>

Source

pub fn extract_knowledge_patterns(&self) -> Result<Vec<Vec<usize>>, ActorError>

Extract knowledge patterns in a discrete form

Source

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

Source

pub fn find_paths_to_point(&self, target: usize) -> Vec<Vec<LPR>>

Find paths to a triad containing the target pitch

Source

pub fn get_frequently_visited_triads( &self, min_occurrences: usize, ) -> Vec<Triad>

Get a list of triads that have been frequently visited

Source

pub fn get_convergence_rate(&self) -> T

Get convergence rate for learning

Source

pub fn get_feature_quality(&self) -> T

Get feature quality metric

Source

pub fn get_learning_accuracy(&self) -> T
where T: FromStr,

Get the current learning accuracy

Source

pub fn get_memory_statistics(&self) -> MemoryStatistics<T>

Get statistics about the memory state

Source

pub fn get_stability_patterns(&self) -> Option<Vec<StabilityPattern<T>>>
where SurfaceModel<T>: Predict<Array1<T>, Output = Array1<T>>,

Get learned stability patterns from this node’s surface network

Source

pub fn get_surface_parameters(&self) -> (T, T, T)

Get surface network parameters

Source

pub fn identify_critical_point(&mut self, name: &str, pitch: usize)

Identify a critical point in the tonal space

Source

pub fn init_surface(&mut self) -> Result<(), ActorError>

Source

pub fn integrate_external_knowledge( &mut self, patterns: &[Vec<usize>], source_id: &EdgeId, ) -> Result<(), ActorError>
where T: Display + FromStr,

Integrate knowledge from another node

Source

pub fn learn_headspace(&mut self) -> Result<(), ActorError>

Learn headspace based on its structure and critical points

Source

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

Source

pub fn learn_stability_characteristics(&mut self) -> Result<(), ActorError>
where D: TriadDriver,

Learn stability characteristics specific to the current chord class

Source

pub fn learn_stability_patterns( &mut self, _patterns: &[StabilityPattern], ) -> Result<(), ActorError>

Learn stability patterns from other nodes

Source

pub fn learn_surface(&mut self) -> Result<(), ActorError>

Learn the surface defined by critical points

Source

pub fn learn_transformation_sequence( &mut self, transforms: &[LPR], ) -> Result<(), ActorError>

Learn a transformation sequence

Source

pub fn navigate_to_critical_point( &mut self, point_name: &str, ) -> Result<Vec<LPR>, ActorError>
where D: TriadDriver,

Navigate to satisfy a specific critical point

Source

pub fn optimize_memory( &mut self, max_features: usize, ) -> Result<VirtualMemoryAnalysis<T>, ActorError>

Optimize memory usage with intelligent feature management

Source

pub fn predict_next_transformation(&self) -> Option<LPR>

Predict the next likely transformation based on patterns in memory

Source

pub fn process_message( &mut self, source: EdgeId, message: &[u8], ) -> Result<(), ActorError>

Process a message from another node

Source

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

Source

pub fn propose_transformation(&self) -> Option<LPR>

Have the active operator propose a transformation (if supported)

Source

pub fn resource_requirements(&self) -> (usize, usize)

Get the resource requirements for this node

Source

pub fn prune_low_importance_features( &mut self, threshold: T, ) -> Result<(), ActorError>

Prune low-importance features

Source

pub fn set_name(&mut self, name: &str)

Set the name of the node

Source

pub fn share_patterns<E>( &self, target: &mut VNode<E, T>, ) -> Result<(), ActorError>
where E: Driver<Triad>,

Share patterns with another node

Source

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

Source

pub fn transform(&mut self, transform: LPR) -> Result<(), ActorError>
where D: TriadDriver,

Apply a transformation to the plant and record in memory

Source

pub fn transform_batch(&mut self, transforms: &[LPR]) -> Result<(), ActorError>
where D: TriadDriver,

Efficiently apply multiple transformations in batch

Source

pub fn update_surface_headspace(&mut self) -> Result<(), ActorError>

Update the surface network when the headspace changes

Source§

impl<D, T> VNode<D, T>
where D: RawDriver<Triad>,

Source

pub fn new() -> Self

initialize a new virual node with a default driver

Source

pub fn from_driver(plant: D) -> Self

Create a new virtual node with topological memory

Source

pub fn from_headspace(headspace: Triad) -> Self

initialize a new virtual node from the given headspace

Source

pub const fn id(&self) -> Id

returns a copy of the node id

Source

pub fn class(&self) -> Triads

Return the triad class of the underlying plant

Source

pub const fn critical_points(&self) -> &HashMap<String, usize>

return an immutable reference to the critical points

Source

pub const fn critical_points_mut(&mut self) -> &mut HashMap<String, usize>

return a mutable reference to the critical points

Source

pub const fn driver(&self) -> &D

return an immutable reference to the plant

Source

pub const fn driver_mut(&mut self) -> &mut D

return a mutable reference to the plant

Source

pub fn headspace_mut(&mut self) -> &mut Triad

returns a mutable reference to the node’s headspace

Source

pub fn last_context(&self) -> Option<&(ActorContext<T>, Instant)>

returns an immutable reference to the last context

Source

pub fn last_context_mut(&mut self) -> Option<&mut (ActorContext<T>, Instant)>

returns a mutable reference to the last context

Source

pub const fn store(&self) -> &TopoLedger<T>

return an immutable reference to the memory system

Source

pub const fn store_mut(&mut self) -> &mut TopoLedger<T>

return a mutable reference to the memory system

Source

pub const fn memory(&self) -> &TopoLedger<T>

👎Deprecated since 0.3.0: use store instead
Source

pub const fn memory_mut(&mut self) -> &mut TopoLedger<T>

👎Deprecated since 0.3.0: use store_mut instead
Source

pub const fn operator(&self) -> &Operator<T>

returns an immutable reference to the actor of the node

Source

pub const fn operator_mut(&mut self) -> &mut Operator<T>

returns a mutable reference to the actor of the node

Source

pub fn surface(&self) -> Option<&SurfaceNetwork<T>>

returns an immutable reference to the surface network

Source

pub fn surface_mut(&mut self) -> Option<&mut SurfaceNetwork<T>>

returns a mutable reference to the surface network

Source

pub const fn tonic_history(&self) -> &Vec<usize>

returns an immutable reference the tonic history

Source

pub const fn tonic_history_mut(&mut self) -> &mut Vec<usize>

returns a mutable reference to the history of the node

Source

pub fn set_id(&mut self, id: Id) -> &mut Self

update the id and return a mutable reference to the node

Source

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

Source

pub fn set_driver(&mut self, driver: D) -> &mut Self

update the current driver and return a mutable reference to the node

Source

pub fn set_operator(&mut self, operator: Operator<T>) -> &mut Self

update the current operator and return a mutable reference to the node

Source

pub fn set_store(&mut self, store: TopoLedger<T>) -> &mut Self

update the current memory system and return a mutable reference to the node

Source

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

Source

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

Source

pub fn with_critical_points( self, critical_points: HashMap<String, usize>, ) -> Self

consumes the node to create another with the given critical points

Source

pub fn with_driver(self, driver: D) -> Self

consumes the node to create another with the given driver

Source

pub fn with_id(self, id: Id) -> Self

consumes the node to create another with the given id

Source

pub fn with_operator(self, operator: Operator<T>) -> Self

consumes the node to create another with the given operator

Source

pub fn with_store(self, store: TopoLedger<T>) -> Self

consumes the node to create another with the given memory system

Source

pub fn with_surface(self, surface: Option<SurfaceNetwork<T>>) -> Self

consumes the node to create another with the given surface network

Source

pub fn with_tonic_history(self, tonic_history: Vec<usize>) -> Self

consumes the node to create another with the given tonic history

Source

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.

Source

pub fn calculate_centroid(&self) -> Option<[T; 2]>
where T: Float + FromPrimitive,

compute the centroid of the headspace

Source

pub fn headspace(&self) -> &Triad

returns an immutable reference to the node’s headspace

Source

pub const fn kind(&self) -> OperatorKind

Get the current operator mode

Source

pub fn record_navigation(&mut self, origin: &Triad, transforms_used: &[LPR])

Record a successful navigation from one point to another

Source

pub fn remove_critical_point(&mut self, name: PointKind) -> Option<usize>

Remove a critical point from the plant

Source

pub fn critical_point_count(&self) -> usize

👎Deprecated since 0.3.0: use total_critical_points instead
Source

pub fn feature_count(&self) -> usize

👎Deprecated since 0.3.0: use total_features instead
Source

pub fn total_critical_points(&self) -> usize

returns the number of critical points

Source

pub fn total_features(&self) -> usize

Get the number of features in memory

Source

pub fn get_notes(&self) -> [usize; 3]

Return the notes (alphabet) of the underlying plant

Source

pub fn get_tonic(&self) -> Note

get the tonic (root) of the headspace

Source

pub fn has_surface_network(&self) -> bool

returns true if the node has initialized a surface network

Source

pub fn record_state(&mut self) -> usize

Record the current state in memory

Source

pub fn set_last_context(&mut self, context: ActorContext<T>)

set the last context of the node

Source

pub fn set_operator_by_kind(&mut self, mode: OperatorKind)

set the operator by kind

Trait Implementations§

Source§

impl<D, T: Clone> Clone for VNode<D, T>
where D: RawDriver<Triad> + Clone,

Source§

fn clone(&self) -> VNode<D, T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D, T: Debug> Debug for VNode<D, T>
where D: RawDriver<Triad> + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D, T> Default for VNode<D, T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<D, T> Hash for VNode<D, T>
where D: RawDriver<Triad>, Operator<T>: Hash,

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, D, T> PartialEq<&'a VNode<D, T>> for VNode<D, T>

Source§

fn eq(&self, other: &&'a VNode<D, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, D, T> PartialEq<&'a mut VNode<D, T>> for VNode<D, T>

Source§

fn eq(&self, other: &&'a mut VNode<D, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D, T> PartialEq<VNode<D, T>> for &VNode<D, T>

Source§

fn eq(&self, other: &VNode<D, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D, T> PartialEq<VNode<D, T>> for &mut VNode<D, T>

Source§

fn eq(&self, other: &VNode<D, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D, T> PartialEq for VNode<D, T>

Source§

fn eq(&self, other: &VNode<D, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D, T> Eq for VNode<D, T>
where D: RawDriver<Triad>, T: PartialEq,

Auto Trait Implementations§

§

impl<D, T> Freeze for VNode<D, T>
where D: Freeze, T: Freeze,

§

impl<D, T> RefUnwindSafe for VNode<D, T>

§

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>
where D: Unpin, T: Unpin,

§

impl<D, T> UnwindSafe for VNode<D, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsWeight<T> for T
where T: Clone + IntoWeight<T>,

Source§

fn as_weight(&self) -> Weight<T>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<K, S> Identity<K> for S
where S: Borrow<K>, K: Identifier,

Source§

type Item = S

Source§

fn get(&self) -> &<S as Identity<K>>::Item

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoWeight<T> for T

Source§

impl<A, B, C> PercentDifference<B> for A
where A: Clone, B: Sub<A, Output = C>, C: Div<A, Output = C>,

Source§

type Output = C

Source§

fn percent_diff(self, rhs: B) -> <A as PercentDifference<B>>::Output

Computes the percent difference between two values.
Source§

impl<Q> RawState for Q
where Q: Send + Sync + Debug,

Source§

fn __private__(&self) -> Seal

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more