Lensa ML
Lensa ML

Hyperparameters

Step 1 of 6

Parameters vs Hyperparameters

What the model learns vs what you choose

x1x2x3h1h2h3h4y1y2InputHidden (4)OutputLearned (weights)User-set (hyperparams)
Hidden neurons4
PARAMETERS
26
HYPERPARAMS
3
HIDDEN SIZE
4

Parameters (weights, biases) are learned during training — the model figures them out automatically. Hyperparameters (learning rate, layer size, batch size) are set by you before training begins. With 4 hidden neurons, this network has 26 learnable parameters (weights + biases).

Step 1 of 6: Parameters vs Hyperparameters

What the model learns vs what you choose

x1x2x3h1h2h3h4y1y2InputHidden (4)OutputLearned (weights)User-set (hyperparams)
Hidden neurons4
PARAMETERS
26
HYPERPARAMS
3
HIDDEN SIZE
4

Parameters (weights, biases) are learned during training — the model figures them out automatically. Hyperparameters (learning rate, layer size, batch size) are set by you before training begins. With 4 hidden neurons, this network has 26 learnable parameters (weights + biases).

Step 2 of 6: Learning Rate

The most important hyperparameter in deep learning

EpochsLossLR = 0.0707
Adjust learning rate (log scale)0.071
LEARNING RATE
0.071
FINAL LOSS
1.083
STATUS
Converged

A good learning rate lets loss decrease steadily and converge to a low value. The sweet spot is usually between 0.01 and 1.0 -- but the optimal value depends on the problem.

Step 3 of 6: Batch Size

How many samples per gradient update

EpochsLoss1832128512Batch = 32
Batch size32
BATCH SIZE
32
GRAD NOISE
Medium
STEPS/EPOCH
32

Batch size 32 is a mini-batch. This balances gradient noise with stability -- the most common choice in practice. Moderate noise helps generalization.

Step 4 of 6: Network Depth & Width

How many layers, and how wide each one is

x1x2x3y1y2In(3)H1(6)H2(6)Out(2)
Hidden layers2
Neurons per hidden layer6
TOTAL PARAMS
80
LAYERS
2
WIDTH
6

With 2 hidden layers and 6 neurons each, the network has 80 parameters. Each layer builds higher-level abstractions on top of the previous one.

Step 5 of 6: Regularization Strength

Balancing underfitting and overfitting with lambda

EpochsLossTrainValOverfit
L2 regularization strength (lambda)0.00
LAMBDA
0.00
TRAIN LOSS
0.090
VAL LOSS
1.140
GAP
1.050

With lambda near 0, no regularization. The model overfits -- training loss is low but validation loss climbs as the model memorizes noise. The gap between curves grows over time.

Step 6 of 6: The Search

Grid search vs random search for hyperparameter tuning

Learning RateBatch SizebestRandom SearchLowHighLoss
Number of trials20
BEST LOSS
0.010
TRIALS
20
METHOD
Random

Random search samples hyperparameters uniformly at random. It often finds better configurations than grid search because it explores more unique values along each dimension. With 20 trials, the best loss found is 0.010. Research shows random search is more efficient when some hyperparameters matter more than others.