Prioritized Experience Replay (PER) improves on uniform replay by sampling transitions proportional to their TD error magnitude. Transitions where the agent was most "surprised" (large TD error) are replayed more often, leading to faster learning. To correct for the bias introduced by non-uniform sampling, importance sampling weights are applied.
Given a list of priority values, an alpha parameter (controls how much prioritization is used), and a beta parameter (controls importance sampling correction), compute the sampling probabilities and normalized importance sampling weights.
Return a two-item list containing probabilities followed by normalized weights.
Input: priorities = [1, 2, 3], alpha = 1, beta = 1
Output: [[0.166667, 0.333333, 0.5], [1.0, 0.5, 0.333333]]
Explanation: Probabilities follow the priorities, while inverse-probability weights reduce the influence of frequently sampled items.
Input: priorities = [1, 1, 1], alpha = 1, beta = 1
Output: [[0.333333, 0.333333, 0.333333], [1.0, 1.0, 1.0]]
Normalize priorities after raising each one to alpha.
Compute each raw weight from its probability, then divide all weights by their maximum.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number
Prioritized Experience Replay (PER) improves on uniform replay by sampling transitions proportional to their TD error magnitude. Transitions where the agent was most "surprised" (large TD error) are replayed more often, leading to faster learning. To correct for the bias introduced by non-uniform sampling, importance sampling weights are applied.
Given a list of priority values, an alpha parameter (controls how much prioritization is used), and a beta parameter (controls importance sampling correction), compute the sampling probabilities and normalized importance sampling weights.
Return a two-item list containing probabilities followed by normalized weights.
Input: priorities = [1, 2, 3], alpha = 1, beta = 1
Output: [[0.166667, 0.333333, 0.5], [1.0, 0.5, 0.333333]]
Explanation: Probabilities follow the priorities, while inverse-probability weights reduce the influence of frequently sampled items.
Input: priorities = [1, 1, 1], alpha = 1, beta = 1
Output: [[0.333333, 0.333333, 0.333333], [1.0, 1.0, 1.0]]
Normalize priorities after raising each one to alpha.
Compute each raw weight from its probability, then divide all weights by their maximum.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number