Skip to main content

One post tagged with "RL"

View All Tags

RL 001

· 2 min read

Reinforcement Learning

  • Learn how to make a good sequence of decisions by interacting with the environment.

Characteristics of RL

  • Trial and Error: Based learning approach.
  • Optimization: Find good sequences of actions or decisions.
  • Delayed Consequences/Rewards: Takes time to relize the actions or decisions are good or bad.
  • Exploration: Learn by making decisions or forming actions or through experiences. Trying new actions to discover their effects.
  • Exploitation: Choosing actions with the highest expected reward, based on current knowledge.
  • Generalization: Use previous experiences or knowledge to new or unseen situations effectively.

Framwork of RL

  • OpenAI Gym
  • Torch RL
  • AWS DeepRacer

RL Math

Probability

Bonferroni's Inequality

P(AB)P(A)+P(B)1P(A \cap B) \geq P(A) + P(B) - 1 P(i=1nAi)i=1nP(Ai)(n1)P(\cap^{n}_{i=1} A_i) \geq \sum_{i=1}^{n} P(A_i) - (n-1)

  • Gives a lower bound on the intersection probability which is useful when this probability is difficult to compute directly.
  • It is useful when the probabilities of individual events are sufficiently large.

Boole's Inequality

P(i=1nAi)i=1nP(Ai)P(\cup^{n}_{i=1} A_i) \leq \sum_{i=1}^{n} P(A_i)

for any sets A1,A2,...,AnA_1, A_2, ..., A_n.

  • It is useful when finding an upper bound for the probabilities of the union of events.

Bayes' Rule

P(AB)=P(AB)P(B)P(A|B) = \frac{P(A \cap B)}{P(B)} P(AB)=P(BA)P(A)=P(AB)P(B)P(A\cap B) = P(B|A) P(A) = P(A|B) P(B) P(AB)P(B)=P(BA)P(A)P(A|B)P(B) = P(B|A)P(A) P(AB)=P(BA)P(A)P(B)P(A|B) = \frac{P(B|A) P(A)}{P(B)}

  • It allows us to compute the conditional probability P(AB)P(A|B) from the inverse conditional probability P(BA)P(B|A).
  • Let A1,A2,...,AnA_1, A_2, ..., A_n be a partition of the sample space SS. Then let BB be any subset of SS we have:

P(AiB)=P(BAi)P(Ai)j=1P(BAj)P(Aj)P(A_i|B) = \frac{P(B|A_i) P(A_i)}{\sum_{j=1}^{\infty} P(B|A_j) P(A_j)}

Independent Events

P(AB)=P(A)P(B)P(A \cap B) = P(A) P(B)

  • A family Ai:iIA_i :i \in I of events is independent if for every finite subset JIJ \subseteq I we have: P(iJAi)=iJP(Ai)P\left(\bigcap_{i \in J} A_i\right) = \prod_{i \in J} P(A_i)

  • The pair-wise independence of events does not imply their mutual independence.

Conditional Independence

P(ABC)=P(AC)P(BC)P(A \cap B|C) = P(A|C) P(B|C)

  • where P(C)>0P(C) > 0.
  • or equivalently, P(ABC)=P(AC)P(A|B \cap C) = P(A|C) and P(BAC)=P(BC)P(B|A \cap C) = P(B|C).