Skip to content

Instantly share code, notes, and snippets.

@jangirrishabh
Created June 14, 2018 11:42
Show Gist options
  • Save jangirrishabh/ce0ef99adc652c7469f1bc4303a3af41 to your computer and use it in GitHub Desktop.
Save jangirrishabh/ce0ef99adc652c7469f1bc4303a3af41 to your computer and use it in GitHub Desktop.
Snippet for toyCarIRL, blog usage, not executable
def policyListUpdater(self, W, i): #add the policyFE list and differences
tempFE = self.getRLAgentFE(W, i) # get feature expectations of a new policy respective to the input weights
hyperDistance = np.abs(np.dot(W, np.asarray(self.expertPolicy)-np.asarray(tempFE))) #hyperdistance = t
self.policiesFE[hyperDistance] = tempFE
return hyperDistance # t = (weights.tanspose)*(expert-newPolicy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment