Skip to content
DeepForgeby svx
All problems

Prioritized Alpha Effect

Problem

Compute the sampling-probability ratio induced by the prioritized replay exponent alpha.

Return (p_max / p_min)^alpha. If p_min is not positive or p_max is below p_min, return 0.0.

Hint

Alpha of 0 flattens the ratio to 1 and alpha of 1 passes the raw priority ratio through.

Test cases

case 1
in: [1,100,0.5]
expected: 10
case 2
in: [1,10,2]
expected: 100
case 3
in: [2,8,1]
expected: 4
case 4
in: [0,5,1]
expected: 0
case 5
in: [5,5,0.7]
expected: 1
Starter codePython
def prioritized_alpha_effect(p_min, p_max, alpha):
    # Your code here
    pass

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