marcellodebernardi/loss-landscapes
Approximating neural network loss landscapes in low-dimensional parameter subspaces for PyTorch
What it solves
Neural networks have thousands or millions of parameters, making their "loss landscape"—the mathematical surface representing how well the model performs—impossible to see directly. This library provides tools to simplify these high-dimensional spaces into 1D or 2D slices, allowing researchers to visualize and analyze the geometry of how a model learns.
How it works
The library samples the model's parameters along specific paths (like a straight line between two models or a random plane). It uses a Metric system to calculate values—such as loss or custom metrics—at each point in that subspace. Users define the subspace and the metric, and the library returns the resulting data points, which can then be plotted using external tools like Matplotlib.
Who it’s for
It is designed for machine learning researchers and developers who need to inspect the internal geometry of neural networks to better understand training dynamics, model stability, or optimization behavior.
Highlights
- Approximates high-dimensional loss functions in low-dimensional subspaces.
- Supports custom metrics beyond standard loss functions.
- Provides a
ModelWrapperinterface to evaluate specific subsets of model parameters. - Compatible with PyTorch models.
- Lightweight design that focuses on data generation rather than plotting.
Related
- Dispatch
- Project
- Project
- Project
- Project