Open
Conversation
e5ff2ce to
d020a29
Compare
112b4ed to
9e56be5
Compare
9e56be5 to
a17e0cd
Compare
a17e0cd to
92a5859
Compare
| @@ -50,10 +50,7 @@ | |||
| DISK_FOUR_COUNTS = np.zeros([HEIGHT, WIDTH], int) | |||
| for row in range(HEIGHT): | |||
| for column in range(WIDTH): | |||
Author
There was a problem hiding this comment.
Lines 53-56 refactored with the following changes:
- Convert for loop into list comprehension
| @@ -106,10 +106,10 @@ def variables(self): | |||
| self.scope + '/') | |||
|
|
|||
| def assign(self, other): | |||
Author
There was a problem hiding this comment.
Function BaseNetwork.assign refactored with the following changes:
- Convert for loop into list comprehension
- Inline variable that is only used once
| @@ -141,8 +141,7 @@ def train_games(self, opponent, games): | |||
|
|
|||
| def process_results(self, opponent, games, step, summary): | |||
| win_rate = np.mean([game.policy_player_score for game in games]) | |||
Author
There was a problem hiding this comment.
Function PolicyTraining.process_results refactored with the following changes:
- Replace unneeded comprehension with generator
| @@ -263,10 +262,7 @@ def move(self, move, policy_player_turn=False): | |||
| self.positions.append(self.position) | |||
| if self.position.gameover(): | |||
| self.result = self.position.result | |||
Author
There was a problem hiding this comment.
Function Game.move refactored with the following changes:
- Replace if statement with if expression
| @@ -10,7 +10,7 @@ def find_previous_run(dir): | |||
| if os.path.isdir(dir): | |||
| runs = [child[4:] for child in os.listdir(dir) if child[:4] == 'run_'] | |||
| if runs: | |||
Author
There was a problem hiding this comment.
Function run_directory.find_previous_run refactored with the following changes:
- Replace unneeded comprehension with generator
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch
masterrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
To manually merge these changes, make sure you're on the
masterbranch, then run:See our documentation for configuring or disabling Sourcery.