pub struct MemoryMappedFileDataset<T> { /* private fields */ }Expand description
Enhanced memory-mapped dataset that loads data directly from files This provides true zero-copy access to very large datasets that exceed available RAM
Implementations§
Source§impl<T> MemoryMappedFileDataset<T>
impl<T> MemoryMappedFileDataset<T>
Sourcepub fn from_file<P: AsRef<Path>>(
file_path: P,
num_samples: usize,
feature_shape: Vec<usize>,
label_shape: Vec<usize>,
) -> Result<Self>
pub fn from_file<P: AsRef<Path>>( file_path: P, num_samples: usize, feature_shape: Vec<usize>, label_shape: Vec<usize>, ) -> Result<Self>
Create a memory-mapped dataset directly from a file The file should contain binary data in the format: [sample0_features, sample0_labels, sample1_features, sample1_labels, …]
Sourcepub fn auto_detect<P: AsRef<Path>>(
file_path: P,
feature_shape: Vec<usize>,
label_shape: Vec<usize>,
) -> Result<Self>
pub fn auto_detect<P: AsRef<Path>>( file_path: P, feature_shape: Vec<usize>, label_shape: Vec<usize>, ) -> Result<Self>
Create a memory-mapped dataset from an existing file with automatic shape detection Assumes all samples have the same shape
Sourcepub fn file_stats(&self) -> MemoryMappedFileStats
pub fn file_stats(&self) -> MemoryMappedFileStats
Get file statistics for monitoring
Trait Implementations§
Source§impl<T> Dataset<T> for MemoryMappedFileDataset<T>
Available on crate feature mmap only.
impl<T> Dataset<T> for MemoryMappedFileDataset<T>
Available on crate feature
mmap only.Auto Trait Implementations§
impl<T> Freeze for MemoryMappedFileDataset<T>
impl<T> RefUnwindSafe for MemoryMappedFileDataset<T>where
T: RefUnwindSafe,
impl<T> Send for MemoryMappedFileDataset<T>where
T: Send,
impl<T> Sync for MemoryMappedFileDataset<T>where
T: Sync,
impl<T> Unpin for MemoryMappedFileDataset<T>where
T: Unpin,
impl<T> UnsafeUnpin for MemoryMappedFileDataset<T>
impl<T> UnwindSafe for MemoryMappedFileDataset<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T, D> AdvancedStatisticsExt<T> for D
impl<T, D> AdvancedStatisticsExt<T> for D
Source§fn compute_multivariate_statistics(
&self,
) -> Result<MultivariateStatistics<T>, TensorError>
fn compute_multivariate_statistics( &self, ) -> Result<MultivariateStatistics<T>, TensorError>
Compute advanced multivariate statistics
Source§fn compute_pca(&self, n_components: usize) -> Result<PCAResult<T>, TensorError>
fn compute_pca(&self, n_components: usize) -> Result<PCAResult<T>, TensorError>
Perform principal component analysis
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, D> CacheExt<T> for Dwhere
D: Dataset<T>,
impl<T, D> CacheExt<T> for Dwhere
D: Dataset<T>,
Source§fn cached(self, capacity: usize) -> CachedDataset<T, Self>
fn cached(self, capacity: usize) -> CachedDataset<T, Self>
Wrap this dataset with caching
Source§fn cached_with_warming(
self,
capacity: usize,
strategy: WarmingStrategy,
) -> Result<CachedDataset<T, Self>>
fn cached_with_warming( self, capacity: usize, strategy: WarmingStrategy, ) -> Result<CachedDataset<T, Self>>
Wrap this dataset with caching and pre-warm the cache
Source§impl<T, D> DataQualityExt<T> for Dwhere
D: Dataset<T>,
impl<T, D> DataQualityExt<T> for Dwhere
D: Dataset<T>,
Source§fn analyze_quality(&self, name: impl Into<String>) -> Result<DataQualityMetrics>
fn analyze_quality(&self, name: impl Into<String>) -> Result<DataQualityMetrics>
Analyze data quality
Source§impl<T, D> DatasetExt<T> for Dwhere
D: Dataset<T>,
impl<T, D> DatasetExt<T> for Dwhere
D: Dataset<T>,
Source§fn transform<Tr: Transform<T>>(
self,
transform: Tr,
) -> TransformedDataset<T, Self, Tr>
fn transform<Tr: Transform<T>>( self, transform: Tr, ) -> TransformedDataset<T, Self, Tr>
Apply a transform to this dataset
Source§impl<T, D> DatasetShardingExt<T> for Dwhere
D: Dataset<T>,
impl<T, D> DatasetShardingExt<T> for Dwhere
D: Dataset<T>,
Source§fn shard(self, config: ShardConfig) -> Result<ShardedDataset<T, Self>>
fn shard(self, config: ShardConfig) -> Result<ShardedDataset<T, Self>>
Shard this dataset for distributed training
Source§fn shard_round_robin(
self,
world_size: usize,
rank: usize,
) -> Result<ShardedDataset<T, Self>>
fn shard_round_robin( self, world_size: usize, rank: usize, ) -> Result<ShardedDataset<T, Self>>
Create a round-robin sharded dataset
Source§fn shard_contiguous(
self,
world_size: usize,
rank: usize,
) -> Result<ShardedDataset<T, Self>>
fn shard_contiguous( self, world_size: usize, rank: usize, ) -> Result<ShardedDataset<T, Self>>
Create a contiguous sharded dataset
Source§fn shard_shuffled(
self,
world_size: usize,
rank: usize,
seed: u64,
) -> Result<ShardedDataset<T, Self>>
fn shard_shuffled( self, world_size: usize, rank: usize, seed: u64, ) -> Result<ShardedDataset<T, Self>>
Create a shuffled sharded dataset with a seed
Source§impl<T, D> DatasetStatisticsExt<T> for D
impl<T, D> DatasetStatisticsExt<T> for D
Source§fn compute_statistics(&self) -> Result<DatasetStats<T>, TensorError>
fn compute_statistics(&self) -> Result<DatasetStats<T>, TensorError>
Compute statistics with default configuration
Source§fn compute_statistics_with_config(
&self,
config: StatisticsConfig,
) -> Result<DatasetStats<T>, TensorError>
fn compute_statistics_with_config( &self, config: StatisticsConfig, ) -> Result<DatasetStats<T>, TensorError>
Compute statistics with custom configuration
Source§impl<T, D> DatasetUtilsExt<T> for Dwhere
D: Dataset<T>,
impl<T, D> DatasetUtilsExt<T> for Dwhere
D: Dataset<T>,
Source§impl<T, D> DatasetValidationExt<T> for D
impl<T, D> DatasetValidationExt<T> for D
fn validate( &self, validator: &DataValidator<T>, ) -> Result<ValidationResult, TensorError>
fn validate_with_config( &self, config: ValidationConfig, ) -> Result<ValidationResult, TensorError>
fn is_valid(&self) -> Result<bool, TensorError>
Source§impl<T, D> DatasetVisualizationExt<T> for Dwhere
D: Dataset<T>,
impl<T, D> DatasetVisualizationExt<T> for Dwhere
D: Dataset<T>,
Source§fn sample_preview(&self, num_samples: usize) -> Result<SamplePreview>
fn sample_preview(&self, num_samples: usize) -> Result<SamplePreview>
Create a sample preview
Source§fn feature_distribution(
&self,
max_samples: Option<usize>,
) -> Result<DistributionInfo<T>>
fn feature_distribution( &self, max_samples: Option<usize>, ) -> Result<DistributionInfo<T>>
Get feature distribution information
Source§fn class_distribution(&self) -> Result<ClassDistribution>
fn class_distribution(&self) -> Result<ClassDistribution>
Get class distribution
Source§fn feature_histogram(
&self,
feature_index: usize,
bins: usize,
) -> Result<FeatureHistogram<T>>
fn feature_histogram( &self, feature_index: usize, bins: usize, ) -> Result<FeatureHistogram<T>>
Create a histogram for a specific feature
Source§fn analyze_augmentation_effects<Tr>(
&self,
transform: &Tr,
num_samples: usize,
) -> Result<AugmentationEffects<T>>
fn analyze_augmentation_effects<Tr>( &self, transform: &Tr, num_samples: usize, ) -> Result<AugmentationEffects<T>>
Analyze the effects of a transform on dataset samples
Source§impl<T, D> FederatedDatasetExt<T> for D
impl<T, D> FederatedDatasetExt<T> for D
Source§fn federated_client(
self,
config: ClientConfig,
) -> FederatedClientDataset<T, Self>
fn federated_client( self, config: ClientConfig, ) -> FederatedClientDataset<T, Self>
Create a federated client dataset
Source§fn partition_federated(
self,
num_clients: usize,
strategy: PartitioningStrategy,
seed: u64,
) -> Result<Vec<FederatedClientDataset<T, ClientIndexedDataset<T, Self>>>>where
Self: Clone,
fn partition_federated(
self,
num_clients: usize,
strategy: PartitioningStrategy,
seed: u64,
) -> Result<Vec<FederatedClientDataset<T, ClientIndexedDataset<T, Self>>>>where
Self: Clone,
Partition dataset for federated learning
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, D> ReproducibilityExt<T> for D
impl<T, D> ReproducibilityExt<T> for D
Source§fn deterministic(self, seed: u64) -> DeterministicDataset<T, Self>
fn deterministic(self, seed: u64) -> DeterministicDataset<T, Self>
Make the dataset deterministic with a seed
Source§fn sequential(self) -> DeterministicDataset<T, Self>
fn sequential(self) -> DeterministicDataset<T, Self>
Make the dataset sequential
Source§fn reverse(self) -> DeterministicDataset<T, Self>
fn reverse(self) -> DeterministicDataset<T, Self>
Make the dataset reverse ordered