oarust 0.11.0

GPU-first semantic computing engine written in Rust
// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
// schema=data_types.json schema_version=1 generator_version=64
// schema_sha256=c517613ec4b60e2e8234555780ae52416fba23b4542efdb8f76731ab4585269d
use crate::Matrix;
/// Configuration for [`DataLoader`](crate::data::DataLoader).
#[derive(Clone, Copy, Debug)]
pub struct DataLoaderConfig {
	/// Number of samples per batch.
	pub batch_size: i32,
	/// Whether to shuffle indices before each epoch.
	pub shuffle: bool,
	/// Seed for shuffling.  `0` derives a seed from the system clock, as in the donor.
	pub seed: u64,
	/// Drop the last incomplete batch when `true`.
	pub drop_last: bool,
}

impl Default for DataLoaderConfig {
	fn default() -> Self {
		Self {
			batch_size: 32,
			shuffle: true,
			seed: 0,
			drop_last: false,
		}
	}
}

/// Result of a train / validation / test split.
pub struct SplitResult {
	/// Training indices.
	pub train: Vec<i64>,
	/// Validation indices.
	pub val: Vec<i64>,
	/// Test indices.
	pub test: Vec<i64>,
}

/// Window shape; targets are the immediately following future close prices.
#[derive(Clone, Copy, Debug)]
pub struct OhlcvWindowConfig {
	/// Number of history candles per input.
	pub lookback: usize,
	/// Number of future closes per label.
	pub horizon: usize,
	/// Advance between consecutive window starts.
	pub stride: usize,
}

/// Batched output: `x` [B, …] and optional `y` [B, …]. Corresponds to `oa::DataLoader::Batch`.
pub struct Batch {
	/// Batched input matrix with a leading batch dimension.
	pub x: Matrix,
	/// Batched label matrix with a leading batch dimension, or `None`.
	pub y: Option<Matrix>,
}