generate_goals.py
def rollout(agent, env, task):
    """Standard gym environment rollout, following as in main.py."""
    episode = []
    total_reward = 0
    obs = env.reset(task)
    info = env.info
    for t in range(task.max_steps):
        act = agent.act(obs, info)
        if len(obs) > 0 and act['primitive']:
            episode.append((obs, act, info))
        (obs, reward, done, info) = env.step(act)
        total_reward += reward
        last_stuff = (obs, info)
        if done:
            break
    return total_reward, t, episode, last_stuff
Standard gym environment rollout, following as in main.py.
Standard gym environment rollout, following as in main.py.
Standard gym environment rollout following as in main . py .
def rollout(agent, env, task):
    episode = []
    total_reward = 0
    obs = env.reset(task)
    info = env.info
    for t in range(task.max_steps):
        act = agent.act(obs, info)
        if len(obs) > 0 and act['primitive']:
            episode.append((obs, act, info))
        (obs, reward, done, info) = env.step(act)
        total_reward += reward
        last_stuff = (obs, info)
        if done:
            break
    return total_reward, t, episode, last_stuff
def rollout ( agent , env , task ) : episode = [ ] total_reward = 0 obs = env . reset ( task ) info = env . info for t in range ( task . max_steps ) : act = agent . act ( obs , info ) if len ( obs ) > 0 and act [ 'primitive' ] : episode . append ( ( obs , act , info ) ) ( obs , reward , done , info ) = env . step ( act ) total_reward += reward last_stuff = ( obs , info ) if done : break return total_reward , t , episode , last_stuff
Standard gym environment rollout, following as in main.py.
Standard gym environment rollout following as in main . py .
"""Standard gym environment rollout, following as in main.py."""
agent
env
task