def __call__(self, context, explore=True):
"""Evaluates policy for given context.
Samples weight vector from distribution if explore is true, otherwise
return the distribution's mean (which depends on the context).
Parameters
----------
context: array-like, (n_context_dims,)
context vector
explore: bool
if true, weight vector is sampled from distribution. otherwise the
distribution's mean is returned
"""
if explore:
return self.random_state.multivariate_normal(
self.W.dot(context), self.Sigma, size=[1])[0]
else:
return self.W.dot(context)
评论列表
文章目录