Skip to content
DeepForgeby svx
All problems

Noisy Net Effective Epsilon

Problem

Estimate the effective epsilon-greedy exploration of a noisy linear layer.

The expected absolute Gaussian noise is |sigma| * sqrt(2 / pi); per parameter the exploration share is that value divided by |weight| plus it, and the result is the mean share across parameters. Empty inputs return 0.0 and zero-noise, zero-weight parameters contribute nothing.

Hint

Comparing noise magnitude to weight magnitude approximates how exploratory the layer is.

Test cases

case 1
in: [[1],[0.1]]
expected: 0.07389267372789357
case 2
in: [[0],[0.1]]
expected: 1
case 3
in: [[1,1],[0,0]]
expected: 0
case 4
in: [[1,0.5],[0.1,0.2]]
expected: 0.15791548331105915
case 5
in: [[],[]]
expected: 0
Starter codePython
import math
def noisy_net_effective_epsilon(weights, sigmas):
    # Your code here
    pass

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