Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet for toyCarIRL, blog usage, not executable
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
You can’t perform that action at this time.