Realm

oa::data::MatrixDataset

Dense labeled feature/label pair implementing Dataset. x is a rank-≥1 [N, ...] F32 feature matrix and y a [N] F32 label vector on the same runtime. get_item returns the rank-(N-1) feature slice; get_sample pairs it with the [1] label slice — the contract DataLoader/collate expect for labeled corpora. Dataset packs and synthetic benchmarks build their Dataset impl on this type instead of repeating bounds, slice, and pairing logic.

StRust public API

Declaration

pub struct MatrixDataset { /* private fields */ }
Public Rust declaration.

Public Methods

pub const fn x(&self) -> &Matrix
pub const fn y(&self) -> &Matrix
fn len(&self) -> i64
fn get_item(&self, index: i64) -> Result<Matrix>
fn get_sample(&self, index: i64) -> Result<Sample>
fn is_empty(&self) -> bool
fn get_batch(&self, indices: &[i64]) -> Result<Batch>
fn subset(&self, indices: Vec<i64>) -> Result<Subset<'_>>where Self: Sized,
fn shuffled_subset(&self, seed: u64) -> Result<Subset<'_>>where Self: Sized,

Associated Functions

pub fn new(x: Matrix, y: Matrix) -> Result<Self>

Public Method Documentation

pub const fn x( &self ) -> &Matrix
No public source comment is attached to this declaration.
pub const fn y( &self ) -> &Matrix
No public source comment is attached to this declaration.
fn len( &self ) -> i64
No public source comment is attached to this declaration.
fn get_item( &self, index: i64 ) -> Result<Matrix>
No public source comment is attached to this declaration.
fn get_sample( &self, index: i64 ) -> Result<Sample>
No public source comment is attached to this declaration.
fn is_empty( &self ) -> bool
No public source comment is attached to this declaration.
fn get_batch( &self, indices: &[i64] ) -> Result<Batch>
No public source comment is attached to this declaration.
fn subset( &self, indices: Vec<i64> ) -> Result<Subset<'_>>where Self: Sized,
No public source comment is attached to this declaration.
fn shuffled_subset( &self, seed: u64 ) -> Result<Subset<'_>>where Self: Sized,
No public source comment is attached to this declaration.
pub fn new( x: Matrix, y: Matrix ) -> Result<Self>
No public source comment is attached to this declaration.