Skip to content

Instantly share code, notes, and snippets.

@praveen-palanisamy
Last active December 13, 2015 03:19
Show Gist options
  • Save praveen-palanisamy/618e4274ad76a4d1c97e to your computer and use it in GitHub Desktop.
Save praveen-palanisamy/618e4274ad76a4d1c97e to your computer and use it in GitHub Desktop.
Cost update under bandit setting
def single_action_cost(self,y):
index=numpy.nonzero(y)
true_cost=y[index]
y = self.output.copy()
cost = T.scalar()
y_update = (y, T.set_subtensor(y[index], cost))
f = function([cost], updates=[y_update])
f([true_cost])
return (y-self.output)**2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment