mirror of
https://github.com/gryf/coach.git
synced 2025-12-18 11:40:18 +01:00
Add is_on_policy property to agents (#480)
This commit is contained in:
@@ -100,6 +100,10 @@ class ActorCriticAgent(PolicyOptimizationAgent):
|
||||
self.value_loss = self.register_signal('Value Loss')
|
||||
self.policy_loss = self.register_signal('Policy Loss')
|
||||
|
||||
@property
|
||||
def is_on_policy(self) -> bool:
|
||||
return True
|
||||
|
||||
# Discounting function used to calculate discounted returns.
|
||||
def discount(self, x, gamma):
|
||||
return scipy.signal.lfilter([1], [1, -gamma], x[::-1], axis=0)[::-1]
|
||||
|
||||
Reference in New Issue
Block a user