Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create mixed inputs using MixUp.
Computer Vision
mixed_x = lambda x1, x2, lam: lam * x1 + [1] * x2 Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lam instead of 1 - lam for the second input weight.
Adding lambda values instead of subtracting.
Using incorrect arithmetic operators.
✗ Incorrect
MixUp combines two inputs weighted by lambda and (1 - lambda).
2fill in blank
mediumComplete the code to mix labels in MixUp.
Computer Vision
mixed_y = lam * y1 + [1] * y2 Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lam for both labels.
Multiplying lam by 2 incorrectly.
Adding lam and 1 instead of subtracting.
✗ Incorrect
Labels are mixed with the same weights as inputs: lam and 1 - lam.
3fill in blank
hardFix the error in the MixUp lambda sampling code.
Computer Vision
lam = np.random.beta([1], [1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1.0 which results in uniform distribution.
Using 0 which is invalid for Beta distribution.
Using 2.0 which biases mixing too much.
✗ Incorrect
The MixUp lambda is sampled from a Beta distribution with alpha=beta=0.5 for stronger mixing.
4fill in blank
hardFill both blanks to create a MixUp batch of inputs and labels.
Computer Vision
mixed_x = lam * x + [1] * x[[2]]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lam instead of 1 - lam for the second weight.
Using x instead of permuted indices for the second input.
✗ Incorrect
MixUp uses (1 - lam) for the second input weight and permuted indices to shuffle the batch.
5fill in blank
hardFill all three blanks to complete the MixUp label mixing code.
Computer Vision
mixed_y = lam * y + [1] * y[[2]] # y shape: [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lam instead of 1 - lam.
Using wrong shape for labels.
Not using permuted indices for label mixing.
✗ Incorrect
Labels are mixed with 1 - lam and permuted indices; labels usually have shape (batch_size, num_classes).