Saturday, August 7, 2010

PyBrain: Reinforcement Learning, a Tutorial

1 – Introduction:

Let me begin by saying that PyBrain is more than just a Reinforcement Learning library. For example, it implements principal component analysis, supervised training by neural networks, genetic algorithms, as well as particle swarm optimizers.

This tutorial, however, will focus entirely on the Reinforcement Learning module. The target audience is essentially any decent Python programmer, with or without any experience in machine learning, as it explains everything from scratch and is relatively informal.

Reinforcement learning is the machine learning equivalent of the dopaminergic system in the basal ganglia, i.e. pleasure versus pain. You do something, your brain likes it – you get pleasure ("reward"). Nobody tells you what the optimal or desired action is (in contrast to supervised learning, for example). You just know that what you did is better than that other thing you did that gave you less pleasure, or even pain. Somehow, you try to adjust accordingly. And yet, you have to keep exploring a little bit, otherwise you might never find out that optimal action that provides the most pleasure.

I will start by describing the general concept of Q Learning from a mathematical perspective (as well as its variations), then I will proceed to the PyBrain API. Finally, I will give a few examples of a Black Jack (the card game) learning agent implemented with PyBrain.


  1. It's heartbreaking but we're trying to get over it. As disappointed as we were, I think that somehow you have to find a way to think that it happened for a reason. See the link below for more info.


  2. This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog.


  3. I wanted to implement REPS with pybrain. Could you help with that?


  4. [검증완료] 맥스88(

    해외합법라이센스 보유중인 회사로써
    별도의 코드 없이 가입가능 합니다.
    해외배팅사이트 맥스88 페이먼트사
    IBC,SBOBET,10벳,다양한 카지노를 즐길수 있습니다.
    (별도의코드없이 회원가입 가능합니다.)
    맥스벳페이먼트사와 같은 계열사 입니다.
    다양한 해외배팅을 누려보세요

    ※승무/무패/승패로 2/3의 확률로 올라간 더블찬스배팅
    ※경기시작1분부터 종료1분직전까지 배팅이 가능한 라이브배팅
    ※별도의 배팅제재 없습니다.
    ※몰타, 필리핀에 합법 라이센스 보유
    ※스포츠 평일 첫충 5% / 주말 10% 롤링1배
    ※카지노 매일 첫충 15% 롤링2배
    ※신규 첫 충전시 100,000KRW 제공
    ※매일 10% 추가충전 보너스 제공
    ※가입후 첫 충전시 충전금액의 20% 보너스 제공

    맥스88 주소:

    사이트 가입 문의 카카오톡: m88kr

    파트너제휴 문의 스카이프: m88partner

  5. Very nice post.really I apperciate your blog.Thanks for sharing.keep sharing more blogs.

    thai porn