Experiment
Title:
Hyperparameter Tuning of Neural Network on Fashion MNIST Dataset
๐ฏ Objective
-
To implement a neural network on Fashion MNIST dataset
-
To experiment with:
-
Learning rate
-
Batch size
-
Number of epochs
-
To analyze the impact of hyperparameters on performance
Theory
๐น 1. Fashion MNIST Dataset
-
Dataset of clothing images (10 classes)
-
Image size: 28 × 28 grayscale
-
Classes: T-shirt, Trouser, Dress, etc.
๐น 2. Hyperparameters
Hyperparameters are user-defined settings that control training.
๐ธ Learning Rate (ฮท)
-
Controls step size in weight updates
| Value | Effect |
|---|
| Too small | Slow learning |
| Too large | Unstable training |
๐ธ Batch Size
-
Number of samples per update
| Value | Effect |
|---|
| Small | Noisy but better generalization |
| Large | Faster but may overfit |
๐ธ Epochs
-
Number of full passes over dataset
| Value | Effect |
|---|
| Low | Underfitting |
| High | Overfitting |
๐ป Program
๐ Step 1: Import Libraries
๐ Step 2: Load Dataset
๐ Step 3: Preprocessing
๐ง Step 4: Model Function
๐งช Step 5: Hyperparameter Experiments
๐ Run Experiments
๐ Step 6: Display Results
๐ Optional Visualization
๐ Observations
✔ Learning Rate
-
0.001 → stable, better accuracy
-
0.01 → faster but unstable
✔ Batch Size
-
32 → better generalization
-
128 → faster training
✔ Epochs
-
5 epochs → underfitting
-
10 epochs → better learning
| LR | Batch | Epochs | Accuracy | Observation |
|---|
| 0.001 | 32 | 10 | High | Best |
| 0.01 | 128 | 5 | Low | Unstable |
| 0.001 | 128 | 10 | Medium | Balanced |
Result
-
Best performance achieved with:
-
Moderate learning rate
-
Smaller batch size
-
Sufficient epochs
Comments
Post a Comment