def train( name, alpha=0.05, gamma=0.6, exp=0.1, max_games=10000000, step=1000000, progress=100000, tag=None, load=None, ): if not tag: tag = "%s_%s_%s_%s" % ( name, str(alpha).replace(".", ""), str(gamma).replace(".", ""), str(exp).replace(".", ""), ) play( SingleAiPlayer( SingleAi(alpha, gamma, exp), tag=tag, save=step, exit=max_games, progress=progress, load=load, ) ) return tag
def watch(tag=None, delay=1, alpha=0.1, gamma=0.6, exp=0.1, load=10000000, games=1000): play( SplitAiPlayer( diceai=DiceAi(alpha, gamma, exp), rollai=RollAi(alpha, gamma, exp), tag=tag, load=load, exit=load + games, ), doshow=True, delay=delay, )
def check(tag, max_game=10000000, step=1000000, sample_size=100000): print(tag) for game in range(step, max_game + 1, step): print("%8i: " % game, end="") play( SingleAiPlayer( SingleAi(), tag=tag, load=game, exit=game + sample_size, progress=sample_size, ) )
def watch( tag=None, delay=1, alpha=0.1, gamma=0.6, exp=0.1, load=10000000, games=1000 ): play( SingleAiPlayer( SingleAi(alpha, gamma, exp), tag=tag, load=load, exit=load + games, ), doshow=True, delay=delay, )