Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runner requires manual call to close() so calling-code can work with "dirty" runner #310

Merged
merged 1 commit into from
Jan 22, 2018

Conversation

lefnire
Copy link
Contributor

@lefnire lefnire commented Jan 21, 2018

A conversation I'd had earlier with @AlexKuhnle - in order to do cross-validation, or alternating train/test, we came to doing this:

# Train
runner = Runner(agent=agent, environment=env)
runner.run(timesteps=...)

# Test
next_state, terminal = env.reset(), False
while not terminal:
    next_state, terminal, reward = env.execute(agent.act(next_state, deterministic=True))

With the current TensorForce code, the Test segment will fail because agent & model will have been closed automatically (in the end of runner.run()). For consideration: this PR which requires manually closing runner, or possibly a method argument such as auto_close=True.

@AlexKuhnle AlexKuhnle merged commit f0876f5 into tensorforce:master Jan 22, 2018
@lefnire lefnire deleted the lefnire/runner-close branch March 5, 2018 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants