Skip to content
DeepForgeby svx
All problems

Count-Based Bonus

Problem

Compute the count-based exploration bonus beta / (1 + count), where count is how many times the state-action pair has been visited. More visits shrink the bonus.

Hint

The bonus is a decreasing function of visitation count.

Test cases

case 1
in: [0,1]
expected: 1
case 2
in: [1,1]
expected: 0.5
case 3
in: [9,2]
expected: 0.2
case 4
in: [3,0]
expected: 0
Starter codePython
def count_based_bonus(count, beta):
    # Your code here
    pass

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