Skip to content
DeepForgeby svx
All problems

Target Network Soft Update

Problem

Polyak-average an online network into a target network.

Return tau * online[i] + (1 - tau) * target[i] for every element. Do not mutate either input list.

Hint

Tau controls how fast the target network tracks the online network.

Test cases

case 1
in: [[0,0],[10,20],0.1]
expected: [1,2]
case 2
in: [[5],[5],1]
expected: [5]
case 3
in: [[1,2,3],[4,5,6],0.5]
expected: [2.5,3.5,4.5]
case 4
in: [[2,4],[0,0],0]
expected: [2,4]
Starter codePython
def soft_update(target, online, tau):
    # Your code here
    pass

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