DAgger Dataset Aggregation
~10 mincode completion
Implement dagger_aggregate(demo_states, rounds_visited, expert_action) returning the final dataset as an array of shape (N,2), 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