Created
June 14, 2018 11:42
-
-
Save jangirrishabh/49b602b9a3090773d492310175bb2e3f to your computer and use it in GitHub Desktop.
Snippet for toyCarIRL, blog usage, not executable
This file contains 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
class irlAgent: | |
def __init__(self, randomFE, expertFE, epsilon, num_states, num_frames, behavior): | |
self.randomPolicy = randomFE | |
self.expertPolicy = expertFE | |
self.num_states = num_states | |
self.num_frames = num_frames | |
self.behavior = behavior | |
self.epsilon = epsilon # termination when t < 0.1 | |
self.randomT = np.linalg.norm(np.asarray(self.expertPolicy)-np.asarray(self.randomPolicy)) #norm of the diff in expert and random | |
self.policiesFE = {self.randomT:self.randomPolicy} # storing the policies and their respective t values in a dictionary | |
print ("Expert - Random at the Start (t) :: " , self.randomT) | |
self.currentT = self.randomT | |
self.minimumT = self.randomT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment