Skip to content
DeepForgeby svx
All problems

Discrete SAC Entropy Target

Problem

Compute the discrete SAC target entropy: 0.98 * ln(n_actions).

Hint

A fraction of the maximum entropy keeps the policy from collapsing too early.

Test cases

case 1
in: [4]
expected: 1.3585684738974928
case 2
in: [2]
expected: 0.6792842369487464
case 3
in: [10]
expected: 2.2565333911341647
Starter codePython
import math
def discrete_sac_entropy_target(n_actions):
    # Your code here
    pass

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