pub struct EmbeddingGenerator { /* private fields */ }Implementations§
Source§impl EmbeddingGenerator
impl EmbeddingGenerator
pub fn new(dimension: usize) -> Self
Sourcepub fn embed_observation(
&self,
symbol: &str,
timestamp_us: i64,
price: f64,
volume: f64,
spread: f64,
) -> Vec<f32>
pub fn embed_observation( &self, symbol: &str, timestamp_us: i64, price: f64, volume: f64, spread: f64, ) -> Vec<f32>
Generate embedding from structured data
Sourcepub fn embed_signal(
&self,
strategy_id: &str,
symbol: &str,
timestamp_us: i64,
direction: u8,
confidence: f64,
features: &[f64],
) -> Vec<f32>
pub fn embed_signal( &self, strategy_id: &str, symbol: &str, timestamp_us: i64, direction: u8, confidence: f64, features: &[f64], ) -> Vec<f32>
Generate embedding for trading signal
Sourcepub fn embed_order(
&self,
signal_id: &[u8],
symbol: &str,
side: u8,
order_type: u8,
quantity: u32,
limit_price: Option<f64>,
) -> Vec<f32>
pub fn embed_order( &self, signal_id: &[u8], symbol: &str, side: u8, order_type: u8, quantity: u32, limit_price: Option<f64>, ) -> Vec<f32>
Generate embedding for order
Sourcepub fn cosine_similarity(&self, a: &[f32], b: &[f32]) -> f32
pub fn cosine_similarity(&self, a: &[f32], b: &[f32]) -> f32
Calculate cosine similarity between embeddings
Sourcepub fn euclidean_distance(&self, a: &[f32], b: &[f32]) -> f32
pub fn euclidean_distance(&self, a: &[f32], b: &[f32]) -> f32
Calculate Euclidean distance
Auto Trait Implementations§
impl Freeze for EmbeddingGenerator
impl RefUnwindSafe for EmbeddingGenerator
impl Send for EmbeddingGenerator
impl Sync for EmbeddingGenerator
impl Unpin for EmbeddingGenerator
impl UnwindSafe for EmbeddingGenerator
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
Mutably borrows from an owned value. Read more