Giter Site home page Giter Site logo

Comments (5)

ShangtongZhang avatar ShangtongZhang commented on August 23, 2024

It seems I did't notice this sentence when I implemented this so I just used a random one.

As the initial policy we use the policy evaluated in the previous blackjack example, that which sticks only on 20 or 21.

I have no idea how exactly you use targetPolicyPlayer as the initial policy so I can't give further advise. But I will also try it myself in the future.

from reinforcement-learning-an-introduction.

jerome-white avatar jerome-white commented on August 23, 2024
230c230
<         initialAction = np.random.choice(actions)
---
>         initialAction = int(targetPolicyPlayer(*initialState))

from reinforcement-learning-an-introduction.

ShangtongZhang avatar ShangtongZhang commented on August 23, 2024

This won't work. By initial policy it means the initial policy for the whole training process, not the initial policy for each episode.

from reinforcement-learning-an-introduction.

jerome-white avatar jerome-white commented on August 23, 2024

Another interpretation would be to use targetPolicyPlayer once for each state, the first time that state has been explored. In this case, the policy array could be viewed as a set: if the state is not in the set, use targetPolicyPlayer to decide the action; use behaviorPolicy otherwise.

However, in my personal implementation I wasn't able to get this logic to work either. I have the feeling that random is the correct thing to do; I just wish I knew what the authors had in mind when they wrote what they did in the exercise.

from reinforcement-learning-an-introduction.

ShangtongZhang avatar ShangtongZhang commented on August 23, 2024

https://github.com/ShangtongZhang/reinforcement-learning-an-introduction/blob/latest/chapter05/blackjack.py#L230

This line may explain how it works

from reinforcement-learning-an-introduction.

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.