Created
January 15, 2020 08:19
-
-
Save pythonlessons/e2a4f2aa8e46e27d65314071b94e65cb to your computer and use it in GitHub Desktop.
05_CartPole-reinforcement-learning_PER_D3QN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def batch_update(self, tree_idx, abs_errors): | |
| abs_errors += self.PER_e # convert to abs and avoid 0 | |
| clipped_errors = np.minimum(abs_errors, self.absolute_error_upper) | |
| ps = np.power(clipped_errors, self.PER_a) | |
| for ti, p in zip(tree_idx, ps): | |
| self.tree.update(ti, p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment