-
-
Save gsurma/eff480149e9a045c57478ff8c3ecd488 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _gameplay_for_chromosome(self, chromosome, env): | |
self.run += 1 | |
self.logger.add_run(self.run) | |
self.model.set_weights(chromosome) | |
state = env.reset() | |
score = 0 | |
while True: | |
action = self._predict(state) | |
state_next, reward, terminal, info = env.step(action) | |
score += np.sign(reward) | |
state = state_next | |
if terminal: | |
self.logger.add_score(score) | |
return score |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment