Oracle-inspired neural-network training experiment uses dropout to reduce reliance on individual activations. You need to apply inverted dropout during training so the expected activation scale remains consistent with inference.
Apply inverted dropout with drop probability p: draw np.random.default_rng(seed).random(x.shape), keep the entries where the draw is >= p, zero the others and divide the survivors by 1−p. p must satisfy 0≤p<1, otherwise ValueError is raised.
Implement solve(x, p, seed=0).
Returns. Return a float NumPy array with the shape of x.
Example 1
Input:
solve([1, 2, 3, 4], 0.5)
Output:
[2.0, 0.0, 0.0, 0.0]
Example 2
Input:
solve([1.0, 2.0], 0.0)
Output:
[1.0, 2.0]
Example 3
Input:
solve([1.0], 1.0)
Output: Raises ValueError.
No results yet
Run your code to check it against the examples, or submit to run every test.