SHARE
TWEET

Untitled

a guest Jul 24th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Agent():
  2.     """Interacts with and learns from the environment."""
  3.    
  4.     def __init__(self, state_size, action_size, random_seed):
  5.         """Initialize an Agent object.
  6.        
  7.         Params
  8.         ======
  9.             state_size (int): dimension of each state
  10.             action_size (int): dimension of each action
  11.             random_seed (int): random seed
  12.         """
  13.         self.state_size = state_size
  14.         self.action_size = action_size
  15.         self.seed = random.seed(random_seed)
  16.  
  17.         # Actor Network (w/ Target Network)
  18.         self.actor_local = Actor(state_size, action_size, random_seed).to(device)
  19.         self.actor_target = Actor(state_size, action_size, random_seed).to(device)
  20.         self.actor_optimizer = optim.Adam(self.actor_local.parameters(), lr=LR_ACTOR)
  21.  
  22.         # Critic Network (w/ Target Network)
  23.         self.critic_local = Critic(state_size, action_size, random_seed).to(device)
  24.         self.critic_target = Critic(state_size, action_size, random_seed).to(device)
  25.         self.critic_optimizer = optim.Adam(self.critic_local.parameters(), lr=LR_CRITIC, weight_decay=WEIGHT_DECAY)
  26.  
  27.         # Noise process
  28.         self.noise = OUNoise(action_size, random_seed)
  29.  
  30.         # Replay memory
  31.         self.memory = ReplayBuffer(action_size, BUFFER_SIZE, BATCH_SIZE, random_seed)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top