Skip to main content

Module machine_learning_io

Module machine_learning_io 

Source
Expand description

Machine learning model I/O for the OxiPhysics engine.

Covers:

  • ML model serialization (weights/biases as binary)
  • ONNX-like simplified format (op-graph with typed tensors)
  • PyTorch-like state dict (string-keyed tensor store)
  • Dataset I/O (training/validation split, shuffle)
  • Feature normalization parameter storage
  • Label encoding / decoding
  • Confusion matrix export
  • Training history (loss/accuracy per epoch)
  • Hyperparameter configuration
  • Model checkpoint with metadata

Structs§

CheckpointMeta
Metadata stored alongside a model checkpoint.
ConfusionMatrix
Confusion matrix for multi-class classification.
DataRow
A dataset row: a feature vector and an optional label index.
Dataset
A dataset with optional train/validation split.
DenseLayer
A single dense (fully connected) layer with weights and biases.
EpochRecord
Per-epoch metrics.
HyperparamConfig
Hyperparameter configuration container.
LabelEncoder
Encodes class labels as integers and decodes them back.
ModelCheckpoint
A model checkpoint: state dict + metadata + hyperparameters.
ModelWeights
A collection of named dense layers (binary-serialisable model weights).
NormalizationParams
Stored feature normalization parameters (mean and std for z-score normalization).
OnnxLikeGraph
A simplified ONNX-like computation graph.
OnnxNode
A single operation node in an ONNX-like compute graph.
StateDict
PyTorch-like state dict: a HashMap<String, Tensor>.
Tensor
A multi-dimensional tensor stored as a flat Vecf64`.
TrainingHistory
Full training history for a model.

Enums§

HpValue
Typed hyperparameter value.

Functions§

apply_activation
Apply a named activation function to a scalar.
argmax
Argmax: index of the maximum value.
cross_entropy_loss
Compute cross-entropy loss between probs and one-hot targets.
mae
Compute mean absolute error.
mse
Compute mean squared error.
softmax
Compute softmax of a slice.