Skip to main content

PrecisionConfig

Dataclass for configuring precision, hardware simulation, and profiling settings.
train_dtype
str
default:"float32"
Data type used during training (e.g., “float32”)
infer_precision
str
default:"float32"
Inference precision mode. Options: “float32”, “float16”, or “int8”
int8_clip_value
int
default:"127"
Clipping threshold for int8 quantization
seed
int
default:"42"
Random seed for reproducibility
enable_profiling
bool
default:"false"
Enable performance profiling during training
enable_hardware_simulation
bool
default:"false"
Enable hardware constraint simulation
max_memory_mb
float
default:"512.0"
Maximum memory budget in megabytes for hardware simulation
compute_speed_factor
float
default:"1.0"
Speed scaling factor for hardware simulation
precision_mode
str
default:"float32"
Global precision mode setting
batch_size_limit
int
default:"128"
Maximum batch size allowed

DEFAULT_CONFIG

Pre-instantiated PrecisionConfig with default values.

EXPERIMENT_CONFIGS

Dictionary of predefined experiment configurations. Each config includes dataset, model architecture, training hyperparameters, and precision settings.

baseline

Standard synthetic dataset experiment:
dataset_version
str
default:"synthetic-v1"
Dataset identifier
layer_sizes
list[int]
default:"[784, 64, 10]"
Neural network layer dimensions
activations
list[str]
default:"['relu', 'softmax']"
Activation functions per layer
epochs
int
default:"2"
Number of training epochs
alpha
float
default:"0.1"
Learning rate
batch_size
int
default:"32"
Training batch size
seed
int
default:"42"
Random seed
precision
str
default:"float32"
Numerical precision mode
hardware_constraint_mode
str
default:"off"
Hardware simulation mode (“off” or “on”)
synthetic_mode
bool
default:"true"
Use synthetic data generation
synthetic_samples
int
default:"512"
Number of synthetic samples to generate

real_fashion_mnist

Fashion-MNIST dataset experiment:
dataset_path
str
Path to Fashion-MNIST training data (uses FASHION_MNIST_SPEC.train_path)
dataset_version
str
Dataset version identifier (uses FASHION_MNIST_SPEC.version)
epochs
int
default:"3"
Number of training epochs
synthetic_mode
bool
default:"false"
Disabled for real dataset
dataset_min_rows
int
default:"100"
Minimum required rows for validation
dataset_auto_prepare
bool
default:"true"
Automatically download dataset if missing
dataset_sha256
str | None
default:"None"
Optional SHA256 hash for integrity verification

synthetic_baseline

Synthetic baseline without auto-preparation:
dataset_auto_prepare
bool
default:"false"
Disabled for synthetic baseline

Profiling Constants

LAYER_SIZES
list[int]
default:"[784, 64, 10]"
Default layer sizes for profiling
ACTIVATIONS
list[str]
default:"['relu', 'softmax']"
Default activations for profiling
PROFILE_BATCH_SIZE
int
default:"32"
Batch size used during profiling
PROFILE_OUTPUT_DIR
str
default:"profiling"
Output directory for profiling results

build_model()

Factory function that constructs a NeuralNetwork instance with default profiling configuration. Returns: NeuralNetwork configured with LAYER_SIZES, ACTIVATIONS, and DEFAULT_CONFIG Source: config.py:29

Build docs developers (and LLMs) love