helper_utils
"/home/yossef/notes/personal/ml/torch_study/helper_utils.md"
path: personal/ml/torch_study/helper_utils.md
- **fileName**: helper_utils
- **Created on**: 2026-04-02 19:54:35
helper_utils.py Documentation
This script provides utility functions for plotting data, model fit,
and training progress in PyTorch.
Functions
plot_data(distances, times, normalize=False)
Creates a scatter plot of the data points.
- Args:
distances: The input data points for the x-axis. -times: The
target data points for the y-axis. -normalize: A boolean flag
indicating whether the data is normalized.
plot_final_fit(model, distances, times, distances_norm, times_std, times_mean)
Plots the predictions of a trained model against the original data,
after de-normalizing the predictions.
- Args:
model: The trained model used for prediction. -distances: The
original, un-normalized input data. -times: The original, un-
normalized target data. -distances_norm: The normalized input data
for the model. -times_std: The standard deviation used for de-
normalization. -times_mean: The mean value used for de-
normalization.
plot_training_progress(epoch, loss, model, distances_norm, times_norm)
Plots the training progress of a model on normalized data, showing the
current fit at each epoch.
- Args:
epoch: The current training epoch number. -loss: The loss value
at the current epoch. -model: The model being trained. -
distances_norm: The normalized input data. -times_norm: The
normalized target data.
before:[[]]
continue:./torch_study_1.md