All problems
DreamBooth Prior Loss
Problem
Compute the prior-preservation loss of DreamBooth: the mean squared error between the model's prediction on class images and the sampled noise/velocity target.
The signature is dreambooth_prior_loss(prior_pred, prior_target).
Hint
The prior loss keeps the class from drifting while the subject is learned.
Test cases
case 1
in: [[1,2],[1,2]]
expected: 0
case 2
in: [[1,2],[2,4]]
expected: 2.5
case 3
in: [[0.5],[1]]
expected: 0.25
case 4
in: [[-1,0,1],[0,0,0]]
expected: 0.6666666667
Starter codePython
def dreambooth_prior_loss(prior_pred, prior_target):
# Your code here
pass4 test cases · run your code against them in the editor