Skip to content
DeepForgeby svx
All problems

Reptile Meta Update

Problem

Apply one Reptile meta-update toward a task-adapted parameter vector.

Return params + meta_lr * (adapted_params - params) elementwise, moving the initialization toward the adapted solution. Empty vectors return [].

Hint

Reptile needs no second derivatives because it moves toward the adapted weights directly.

Test cases

case 1
in: [[0,1],[1,3],0.1]
expected: [0.1,1.2]
case 2
in: [[1,1],[0,2],0.5]
expected: [0.5,1.5]
case 3
in: [[1],[1],1]
expected: [1]
case 4
in: [[],[],0.5]
expected: []
Starter codePython
def reptile_meta_update(params, adapted_params, meta_lr):
    # Your code here
    pass

4 test cases · run your code against them in the editor