Skip to content
DeepForgeby svx
All problems

APE-X Priority Assignment

Problem

Assign a priority to a new transition the APE-X way: the new priority is max over the existing buffer priorities and (|td_error| + epsilon) ** alpha.

Hint

Giving new transitions the buffer maximum encourages them to be replayed soon.

Test cases

case 1
in: [[1,2,0.5],3,1,0.000001]
expected: 3.000001
case 2
in: [[5],0.1,1,0.000001]
expected: 5
case 3
in: [[],0,0.5,0.000001]
expected: 0.001
Starter codePython
def apex_priority_assignment(existing_priorities, td_error, alpha, epsilon):
    # Your code here
    pass

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