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

Merge evolved artificial neural network strategy #773

Merged
merged 9 commits into from
Nov 30, 2016
Merged

Conversation

mojones
Copy link
Contributor

@mojones mojones commented Nov 28, 2016

No description provided.

Copy link
Member

@drvinceknight drvinceknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor things from me. Looking good.

return D


class EvolvedANN(ANN):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have more of a docstring here please.

  • Saying that it's based on a neural net etc.

  • Include:

    Names:
    
         - Evolved ANN: : Original name by Marc Harper/Marting Jones
    

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also include a reference (in bibliography.rst) to a good base text on neural nets? (Perhaps.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to docstring, I think people should just google about neural networks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

input_values = 17
hidden_layer_size = 10

test_weights = [0.19789658035994948, -5575.476236516673, 0.1028948855131803, 0.7421752484224489,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is test_weights the right name for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to weights.

class TestEvolvedANNvsCooperator(TestHeadsUp):
def test_rounds(self):
self.versus_test(axelrod.EvolvedANN(), axelrod.Cooperator(),
[C, D, D, C, D], [C] * 5)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we throw in a couple more? (Just to ensure we have some more variety).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

opponent_previous2_d = 1 if opponent.history[-2] == D else 0

# Remaining Features
turns_remaining = self.match_attributes['length'] - len(self.history)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test for the case of a match when the match length is unknown? (Just to make sure this doesn't fall over).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The heads up tests don't supply the match length.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should train a separate strategy that only uses the round number though.

@meatballs meatballs merged commit 0e3712a into master Nov 30, 2016
@meatballs meatballs deleted the ann-mojones branch November 30, 2016 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants