Skip to content

Latest commit

Β 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 
Β 
Β 
Β 
Β 

README.md

πŸ“‰ Loss Landscape Visualization

This project visualizes how the loss function (MSE) changes with different weight and bias combinations in a simple linear regression task.


🎯 Problem Statement

In deep learning, understanding how model parameters affect the loss surface is crucial. This visualization helps interpret:

  • Where the global minima lies
  • How gradient descent navigates the surface
  • The shape of convex vs. non-convex loss functions

πŸ”§ Tools & Libraries Used

  • Python 3
  • NumPy
  • Matplotlib
  • mpl_toolkits.mplot3d for 3D plotting

πŸ“Š What It Does

  • Generates a toy linear dataset: ( y = 2x + 3 + \epsilon )
  • Computes the Mean Squared Error (MSE) over a grid of weight (w) and bias (b) values
  • Plots:
    • A 2D Contour Plot of the loss surface
    • A 3D Surface Plot of the same

πŸ“ˆ Sample Output

Contour Plot 3D Surface
contour surface

▢️ How to Run

pip install numpy matplotlib
python loss_surface.py