Randomize Physics Parameters per Episode

~8 mincode completion

Implement randomize_physics(nominal, low, high, u) returning an array of shape (episodes, parameters) with the sampled values.

Python
import numpy as np


def randomize_physics(nominal, low, high, u):
    """
    Scale nominal physics parameters by per-episode uniform multipliers.

    Args:
        nominal: nominal parameter values, shape (p,)
        low:     lowest multiplier per parameter, shape (p,)
        high:    highest multiplier per parameter, shape (p,)
        u:       uniform draws in [0, 1), shape (episodes, p)

    Returns:
        array of shape (episodes, p): the sampled parameter values
    """
    # YOUR CODE HERE
    pass

Run your code to see results

⌘↵ runs against the visible tests

Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.