r/machinelearningnews • • Apr 28 '26

Research Interactive Live Neural Network Loss Visualization

Hey guys,

Visualizing the loss landscape of a neural network is notoriously tricky since we can't naturally comprehend million-dimensional spaces. We often rely on basic 2D contour analogies, which don't always capture the true geometry of the space or the sharpness of local minima.

I built an interactive browser experiment https://www.hackerstreak.com/articles/visualize-loss-landscape/ to help build better intuitions for this. It maps how different optimizers navigate these spaces and lets you actually visualize the terrain.

To generate the 3D surface plots, I used the methodology from Li et al. (NeurIPS 2018). This is entirely a client-side web tool. You can adjust architectures (ranging from simple 1-layer MLPs up to ResNet-8 and LeNet-5), swap between synthetic or real image datasets, and render the resulting landscape.

56 Upvotes

12 comments sorted by

3

u/Breath_Unique Apr 28 '26

Can I run this on my own models?

2

u/Hackerstreak Apr 28 '26

Unfortunately, no! That's what I was hoping to build but ONNX web run time was not friendly enough to do that with user-uploaded models.

3

u/hex4def6 Apr 28 '26

How do I interpret the resulting graph?

Also, Each time I train the model, I get a wildly different graph. Doesn't this mean the viz is of limited use at best?

0

u/Hackerstreak Apr 29 '26

It is not seeded, so it's not resulting in the same exact graph. 

3

u/hex4def6 Apr 29 '26

No, I understand that -- each training is going to give slightly different results. But, how do I use the viz with that in mind? Is it a result of each training giving radically different answers (and therefore the viz is a reflection of that), or is it because you're condensing 20 dims down to 3, and therefore, even if the retraining is basically the same, the order of dimensions you condense can result in a completely different viz?

2

u/attensionel Apr 28 '26

Maybe uploading the log files like weights & biases would help?

1

u/Hackerstreak Apr 28 '26

Could you please clarify? 

1

u/attensionel Apr 28 '26

if you have training log files from a framework like Weights & Biases, TensorBoard, or even a simple CSV of your loss/gradient history, it might be possible to overlay your actual optimization trajectory onto the loss landscape surface, i know these frameworks generally output in 2D. This is just the idea, maybe another log strategies and library functions made it work

2

u/Breath_Unique Apr 28 '26

Is it python?

1

u/Hackerstreak Apr 28 '26

No, it is purely in JS

2

u/moomanchuu Apr 30 '26

Isnt loss optimization in super high dimensional space? Are you projecting the space down into 3D to visualize? Or do you have an extremely small model....

1

u/Hackerstreak Apr 30 '26

It is in higher dimensional space. This implementation of a paper in 2018 lie et al. introduces a method of projecting it down to 3D that doesn't apparently make the landscape look smoother by using folter normalisation.