AlphaZeroSimple icon indicating copy to clipboard operation
AlphaZeroSimple copied to clipboard

Setup Kaggle Environment

Open visuallization opened this issue 2 years ago • 0 comments

Hi there,

I found your project on youtube and it is such a good explanation of the alpha zero algorithm. Thank you very much for that! :) I was wondering if there is some example code how to setup the kaggle environment to play against the agent.

I know you do something like this:

from kaggle_environments import make

# Setup a tictactoe environment.
env = make("tictactoe")

# Basic agent which marks the first available cell.
def my_agent(obs):
  return [c for c in range(len(obs.board)) if obs.board[c] == 0][0]

# Run the basic agent against a default agent which chooses a "random" move.
env.run([my_agent, "random"])

# Render an html ipython replay of the tictactoe game.
env.render(mode="ipython")

But I am currently not 100% sure how to provide the trained connect2 agent, especially with the latest.pth file.

Cheers & thanks again, Florentin

visuallization avatar Dec 01 '22 11:12 visuallization