Skip to content
DeepForgeby svx
All problems

Self-Play Temperature Schedule

Problem

Compute the move-selection temperature during self-play.

Before switch_move the temperature is 1.0. Afterwards it decays linearly, tau = 1 - (move_index - switch_move) * (1 - tau_min) / decay_steps, floored at tau_min. A non-positive decay_steps jumps straight to tau_min.

Hint

Early moves stay exploratory; late moves become nearly greedy.

Test cases

case 1
in: [0,10,20,0.1]
expected: 1
case 2
in: [10,10,20,0.1]
expected: 1
case 3
in: [20,10,20,0.1]
expected: 0.55
case 4
in: [50,10,20,0.1]
expected: 0.1
case 5
in: [15,10,0,0.5]
expected: 0.5
Starter codePython
def self_play_temperature_schedule(move_index, switch_move, decay_steps, tau_min):
    # Your code here
    pass

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