Ejemplo n.º 1
0
 def newEpisode(self):
     """ modify the original controller parameters and store the deltas """
     DirectAgent.newEpisode(self)
     
     if not self.evaluation:
         self.deltaList.append(self.deltas.copy())  
         self.deltas = random.uniform(-self.epsilon, self.epsilon, len(self.controller.parameters))
         self.controller.parameters = self.storedParameters + self.deltas
         self.epsilon *= self.decay
Ejemplo n.º 2
0
 def __init__(self, faClass=Linear):
     self.deltas = None
     self.alpha = 0.01
     self.epsilon = 0.1
     self.decay = 0.99
     
     self.deltaList = []
     self._evaluation = False
     
     DirectAgent.__init__(self, faClass)
Ejemplo n.º 3
0
 def forget(self):
     DirectAgent.forget(self)
     self.deltaList = []
Ejemplo n.º 4
0
 def _setup(self, conditions):
     """ setup the agent and copy the original parameters. """
     DirectAgent._setup(self, conditions)
     self.storedParameters = copy(self.controller.parameters)
     self.deltas = random.uniform(-self.epsilon, self.epsilon, len(self.controller.parameters))