p3_collab-compet/ddpg_agent.py
def sample(self):
        """Update internal state and return it as a noise sample."""
        x = self.state
        # adding both positive and negative noise 
        dx = self.theta * (self.mu - x) + self.sigma * np.array([2*random.random()-1 for i in range(len(x))])
        self.state = x + dx
        return self.state
Update internal state and return it as a noise sample.
Update internal state and return it as a noise sample.
Update internal state and return it as a noise sample .
def sample(self):
        x = self.state
        dx = self.theta * (self.mu - x) + self.sigma * np.array([2*random.random()-1 for i in range(len(x))])
        self.state = x + dx
        return self.state
def sample ( self ) : x = self . state dx = self . theta * ( self . mu - x ) + self . sigma * np . array ( [ 2 * random . random ( ) - 1 for i in range ( len ( x ) ) ] ) self . state = x + dx return self . state
Update internal state and return it as a noise sample.
Update internal state and return it as a noise sample .
"""Update internal state and return it as a noise sample.""" # adding both positive and negative noise 
self