DAgger Dataset Aggregation

~10 mincode completion

Implement dagger_aggregate(demo_states, rounds_visited, expert_action) returning the final dataset as an array of shape , one row [state, expert_action[state]] per labeled state.

Python
import numpy as np


def dagger_aggregate(demo_states, rounds_visited, expert_action):
    """
    Grow a DAgger dataset over several rounds.

    Args:
        demo_states:    1D array of states the expert demonstrated
        rounds_visited: 2D array, row i = states the learner visited in round i
        expert_action:  1D array, expert_action[s] is the expert's label for state s

    Returns:
        array of shape (N, 2): rows [state, label] in order of first appearance
    """
    # 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.