Coder Social home page Coder Social logo

Comments (3)

esparano avatar esparano commented on August 15, 2024

I haven't experienced this, but there is another open issue with a possible implementation bug. It could be related.

A few other issues could be at fault. Are your custom rewards small, say in the range [-1, 1]? If not, the ratio between exploration-const and typical reward magnitude needs to be kept roughly the same.

from mcts.

DarioBernardo avatar DarioBernardo commented on August 15, 2024

Hi, and thanks for your response.
My reward is a score, like in a video game, and starts from 0 with no upper bound, but generally a typical value would be between 0 and let's say 1000000. Does it mean that the exploration value must me in the same range? I actually tried that and you are right, it actually mitigated the problem. I have more visits in the less promising branch now, and at least it is not just 1. Also the game is more stable.
Could you also point me to the open issue with a possible implementation bug you are referring to in your response, so I can have a look?
thank you

from mcts.

esparano avatar esparano commented on August 15, 2024

Hi Dario,

The open issue I referenced is #6. I don't think it's related to your exploration issue, but it can potentially affect multi-player games.

If your values can be as high as 1M, then it makes sense why only one branch is being explored. Check out the code that chooses which branch to explore:

MCTS/mcts.py

Line 98 in 366972d

nodeValue = child.totalReward / child.numVisits + explorationValue * math.sqrt(

Because totalReward is so high, the exploration component of the equation is mostly ignored.

There are two possible solutions I can recommend:

  1. Increase explorationValue until it's in roughly the same range as a typical reward (then tweak it by up to an order of magnitude until you're getting good results).
  2. Rework your reward function to return a value in a more reasonable range. Perhaps you simply divide your reward by 100k before returning it. Or perhaps you could apply a more complicated function like log or arctan to the reward. Some implementations even pass the game state through a neural network before returning a confidence value between [-1, 1]! There are a lot of options here.

from mcts.

Related Issues (11)

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.