0
0
Computer Visionml~10 mins

Learning rate selection in Computer Vision - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the learning rate for the optimizer.

Computer Vision
optimizer = torch.optim.SGD(model.parameters(), lr=[1])
Drag options to blanks, or click blank then click option'
A0
B0.01
C-0.1
D'fast'
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero or negative values for learning rate.
Using strings instead of numbers.
2fill in blank
medium

Complete the code to reduce the learning rate by a factor of 10.

Computer Vision
new_lr = old_lr [1] 10
Drag options to blanks, or click blank then click option'
A*
B+
C/
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Multiplying instead of dividing.
Adding or subtracting instead of dividing.
3fill in blank
hard

Fix the error in the learning rate scheduler code.

Computer Vision
scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=5, gamma=[1])
Drag options to blanks, or click blank then click option'
A0.1
B0
C-0.5
D1.5
Attempts:
3 left
💡 Hint
Common Mistakes
Using gamma greater than 1 or negative.
Using zero which stops decay.
4fill in blank
hard

Fill both blanks to create a dictionary of learning rates for different layers.

Computer Vision
lr_dict = {'conv': [1], 'fc': [2]
Drag options to blanks, or click blank then click option'
A0.001
B0.01
C0.0001
D0.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same learning rate for both layers.
Using too large learning rates for conv layers.
5fill in blank
hard

Fill all three blanks to create a learning rate scheduler with warmup and decay.

Computer Vision
scheduler = torch.optim.lr_scheduler.LambdaLR(optimizer, lr_lambda=lambda epoch: [1] if epoch < 5 else [2] ** (epoch - 5) * [3])
Drag options to blanks, or click blank then click option'
Aepoch / 5
B0.9
C1
Depoch
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong decay base or multiplier.
Confusing warmup formula.