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

Implement the other archetypes #30

Open
drvinceknight opened this issue Aug 5, 2017 · 6 comments
Open

Implement the other archetypes #30

drvinceknight opened this issue Aug 5, 2017 · 6 comments

Comments

@drvinceknight
Copy link
Member

Currently in axelrod_dojo.archetypes I've implemented the FSMParams (and written unit and integration tests) which simplifies FSM_evolve.py. It's not tough work to do the same with the others (but they should be fully tested).

@gaffney2010
Copy link
Member

I'd like to take a stab at HMMParams...

@drvinceknight
Copy link
Member Author

👍 Go for it :)

@marcharper
Copy link
Member

Note for HMM we can use either swarm algorithm or the evolutionary algorithm, so if it's possible to test both that would be ideal.

@drvinceknight
Copy link
Member Author

The current implementation that is to be modified is here: https://github.com/Axelrod-Python/axelrod-dojo/blob/master/bin/hmm_evolve.py

@gaffney2010
Copy link
Member

gaffney2010 commented Dec 16, 2017

I'm looking at this now. Here's what I think the steps are:

  1. Move HMMParams to hmm.py, similar to fsm.py.
  2. Test HMMParams similar to archetypes/test_fsm.py.
  3. Implement PSO algorithm, by implementing receive_vector, create_vector_bounds, and vector_to_instance in HMMParams. [Basically serializing the transition matrices and emission probabilities.] I will have to normalize in one or more of these functions, and the PSO will have to return unnormalized vectors.
  4. Add "--algorithm" as an argument on hmm_evolve.py to decide which of the two implementations to use. And actually implement the PSO call, unserializing and normalizing.
  5. Test PSO implementation.
  6. Test similar to integration/test_fsm.py
  7. Optionally, add some documentation.

I'm going to move forward with this plan, but let me know if I'm off-track or if I should do intermediate PRs.

Also: I haven't looked into the pyswarm implementation, but I think I understand the idea of the algorithm, and it seems safe to assume that no iteration of the algorithm will create values that are not probabilities [outside 0 to 1].

@drvinceknight
Copy link
Member Author

That looks right to me 👍

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

No branches or pull requests

3 participants