API Reference
Training Core
LMD4MLTraining.Learner — Type
Learner{M, D, F, P, Q}Object bundling together all information for training.
model: Architecture optimized during training.data_loader: Iterable for training data.loss_fn: Function calculating the loss.optim: Optimizer state.quantities: Metrics computed every training step.
LMD4MLTraining.train! — Function
train!(learner, epochs, with_plots)Train a Learner for a number of epochs, optionally with live plotting.
LMD4MLTraining.train_loop! — Function
train_loop!(learner, epochs, channel)Internal training loop that computes quantities and sends them to the display channel.
LMD4MLTraining.compute — Function
compute(q::AbstractQuantity, losses, back, grads, params)Compute the value of quantity q using the provided training information.
LMD4MLTraining.quantity_key — Function
quantity_key(q::AbstractQuantity)Return a symbol key uniquely identifying the quantity.
Quantities
LMD4MLTraining.AbstractQuantity — Type
AbstractQuantityAbstract base type for all quantities tracked during training.
LMD4MLTraining.LossQuantity — Type
LossQuantityQuantity tracking the training loss.
LMD4MLTraining.DistanceQuantity — Type
DistanceQuantityQuantity tracking the L2 distance of current parameters from the initial parameters.
LMD4MLTraining.GradNormQuantity — Type
GradNormQuantityQuantity tracking the norm of the model gradients.
LMD4MLTraining.UpdateSizeQuantity — Type
UpdateSizeQuantityQuantity tracking the L2 distance of parameters before and after the current update step.
LMD4MLTraining.NormTestQuantity — Type
NormTestQuantityQuantity tracking the normalized gradient noise.
LMD4MLTraining.GradHist1dQuantity — Type
GradHist1dQuantityHistogram of per-sample gradient elements.
Dashboard and Visualization
LMD4MLTraining.build_dashboard — Function
build_dashboard(quantities) -> (fig, axes_dict)Construct the dashboard layout for the given quantities and return the figure and axis mapping. Loss quantity is always plotted