Skip to content

Instantly share code, notes, and snippets.

@mojones
mojones / gist:f63153660adbfa1500d1
Created September 21, 2015 11:34
sparklines showing plays from various Axelrod strategies. Solid boxes mean cooperate, spaces mean defect.
Arrogant QLearner vs Arrogant QLearner
███████████████ ██████████████████████████████████████████████████████████████████████████ █ ██████████ ███ ████████████████████████ █████████████ ███ ████████████ ███ █████████ ███ █████████ ███████████████████████████████████████████████ █████████ █ ████████ ██████████████████████████████ ██████████████████████████████████████ ███ ████████████████████████████ ███████████████████████████████████ ████████████████████ ███████ ███████████████████████████████████████████████████████████████ ██████
█████████████████████████████████████████████████████████████ ██████████ ██████████████████████████ ████████████████ █████████████████████████████████████ █████████ ███████████████████████████████ ███ █████████████ ████████████████████████ █████████████████████████ ██████ ██ ██████████████████████████████████ ███ ████████████████████████████ ██████████████████████████ ███████████████████ ██████████████████████████████████████████████████ ███████████████ ██████████████ ████████ ██
@mojones
mojones / codemonkeys.ipynb
Created March 24, 2016 14:32
quick jupyter tips for codemonkeys
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mojones
mojones / test.ipynb
Created March 28, 2016 08:28
confusion about axelrod scoring
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from axelrod import Actions, Player, init_args
C, D = Actions.C, Actions.D
class ANN(Player):
name = 'ANN'
classifier = {
'memory_depth': 1, #actually variable
'stochastic': True,
@mojones
mojones / ann_axelrod_trainer.py
Created December 12, 2016 17:14
I'm hideous, don't look at me!
def evolve(starting_weights, mutation_rate, mutation_distance, generations, bottleneck, starting_pop, output_file):
current_bests = starting_weights
for generation in range(generations):
with open(output_file, "a") as output: