pub struct ManifoldLearner { /* private fields */ }Expand description
Autoencoder for chess position manifold learning
Implementations§
Source§impl ManifoldLearner
impl ManifoldLearner
pub fn new(input_dim: usize, output_dim: usize) -> Self
Sourcepub fn init_network(&mut self) -> Result<(), String>
pub fn init_network(&mut self) -> Result<(), String>
Initialize the neural network architecture
Sourcepub fn train(&mut self, data: &Array2<f32>, epochs: usize) -> Result<(), String>
pub fn train(&mut self, data: &Array2<f32>, epochs: usize) -> Result<(), String>
Train the autoencoder on position data (automatically chooses best method)
Sourcepub fn decode(&self, manifold_vec: &Array1<f32>) -> Array1<f32>
pub fn decode(&self, manifold_vec: &Array1<f32>) -> Array1<f32>
Decode from manifold space to original space
Sourcepub fn compression_ratio(&self) -> f32
pub fn compression_ratio(&self) -> f32
Get compression ratio
Sourcepub fn is_trained(&self) -> bool
pub fn is_trained(&self) -> bool
Check if the network is trained
Sourcepub fn output_dim(&self) -> usize
pub fn output_dim(&self) -> usize
Get the output dimension (compressed size)
Sourcepub fn encode_batch(&self, inputs: &[Array1<f32>]) -> Vec<Array1<f32>> ⓘ
pub fn encode_batch(&self, inputs: &[Array1<f32>]) -> Vec<Array1<f32>> ⓘ
Encode multiple vectors in parallel
Sourcepub fn decode_batch(&self, manifold_vecs: &[Array1<f32>]) -> Vec<Array1<f32>> ⓘ
pub fn decode_batch(&self, manifold_vecs: &[Array1<f32>]) -> Vec<Array1<f32>> ⓘ
Decode multiple vectors in parallel
Sourcepub fn train_parallel(
&mut self,
data: &Array2<f32>,
epochs: usize,
batch_size: usize,
) -> Result<(), String>
pub fn train_parallel( &mut self, data: &Array2<f32>, epochs: usize, batch_size: usize, ) -> Result<(), String>
Parallel batch training with memory efficiency and async processing
Sourcepub fn train_memory_efficient(
&mut self,
data: &Array2<f32>,
epochs: usize,
batch_size: usize,
) -> Result<(), String>
pub fn train_memory_efficient( &mut self, data: &Array2<f32>, epochs: usize, batch_size: usize, ) -> Result<(), String>
Memory-efficient training with sequential batch processing
Sourcepub fn save_to_database(&self, db: &Database) -> Result<(), Box<dyn Error>>
pub fn save_to_database(&self, db: &Database) -> Result<(), Box<dyn Error>>
Save manifold learner configuration and weights to database
Auto Trait Implementations§
impl Freeze for ManifoldLearner
impl !RefUnwindSafe for ManifoldLearner
impl Send for ManifoldLearner
impl Sync for ManifoldLearner
impl Unpin for ManifoldLearner
impl !UnwindSafe for ManifoldLearner
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
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>
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 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>
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