Git Product home page Git Product logo

Comments (6)

lanctot avatar lanctot commented on July 18, 2024

Hi @StepHaze,

It's probably due to the size of Mancala? i.e. I would guess something similar would happen with chess. The state space is too large, so most states are probably only visited once (or very small number of times). Tabular methods will only work on small games (e.g. Tic-Tac-Toe has ~4500 states total).

Try self-play DQN instead? It's basically Q-learning with function approximation and a few extra things (experience replay, target network, etc.)

from open_spiel.

DmitriMedved avatar DmitriMedved commented on July 18, 2024

Hi @StepHaze,

Try self-play DQN instead? It's basically Q-learning with function approximation and a few extra things (experience replay, target network, etc.)

I'm interested in it too. Can you please provide us with an example for DQN ?

from open_spiel.

lanctot avatar lanctot commented on July 18, 2024

Sure. In OpenSpiel all the agents follow the same API (they are subclasses of the agent base class). So, 99% of the code above can be re-used and you just have to change the instantiation of the agent to DQN instead of tabular_qlearner.QLearning.

There is a full example here.

from open_spiel.

lanctot avatar lanctot commented on July 18, 2024

Note the example above is a bit old and still uses the TF1-based DQN.

It can be easily swapped for the PyTorch DQN or JAX DQN if you prefer.

from open_spiel.

StepHaze avatar StepHaze commented on July 18, 2024

Hi @lanctot
Thank you Marc.
I always thought that a trained neural network (weights) should be stored in the external file, and be loaded every time the bot starts. Am I correct?

from open_spiel.

lanctot avatar lanctot commented on July 18, 2024

Sounds like you are talking about checkpoints. The DQN supports saving and loading the networks themselves, but not the replay buffer. But it's certainly not enabled by default. It's something you have to do manually in your training script (check the save + load methods in dqn.py). Or if you use JAX/PyTorch you can just serialize the agent via pickle and save/load that (which would then include the replay buffer).

from open_spiel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.