def __init__(self, actions, network,
               eps_start=1.0, eps_end=0.01, eps_decay=0.9995,
               learning_rate=0.0001, gamma=0.99, tau=1.0, target_update=1000,
               batch_size=32, min_steps=10000, replay_size=10000):
    """
    :param actions: Number of possible actions
    :param network: Neural neural network to use as a Q function approximator
    :param eps_start: e-greedy exploration start epsilon
    :param eps_end: e-greedy exploration end epsilon
    :param eps_decay: e-greedy exploration decay
    :param learning_rate: optimizer learning rate
    :param gamma: future returns discount
    :param tau: soft update smoothing coefficient. Use 1.0 for hard target update
    :param target_update: target update interval
    :param batch_size: batch size
    :param min_steps: min number of experiences in replay buffer before learning
    :param replay_size: replay memory size
    """

    self.actions = actions

    # e-greedy parameters
    self.eps = eps_start
    self.eps_end = eps_end
    self.eps_decay = eps_decay

    # Experience replay memory: e = (s, a, r, s', done)
    self.replay = collections.deque(maxlen=replay_size)
    self.min_steps = min_steps
    self.batch_size = batch_size

    # Initialize Local and Target networks
    self.local = network
    self.target = copy.deepcopy(self.local)
    self.device = next(network.parameters()).device

    # Optimizations
    self.optimizer = optim.Adam(self.local.parameters(), lr=learning_rate)
    self.gamma = gamma
    self.tau = tau
    self.target_update = target_update
    self.steps = 0
def __init__ ( self , actions , network , eps_start = 1.0 , eps_end = 0.01 , eps_decay = 0.9995 , learning_rate = 0.0001 , gamma = 0.99 , tau = 1.0 , target_update = 1000 , batch_size = 32 , min_steps = 10000 , replay_size = 10000 ) : self . actions = actions self . eps = eps_start self . eps_end = eps_end self . eps_decay = eps_decay self . replay = collections . deque ( maxlen = replay_size ) self . min_steps = min_steps self . batch_size = batch_size self . local = network self . target = copy . deepcopy ( self . local ) self . device = next ( network . parameters ( ) ) . device self . optimizer = optim . Adam ( self . local . parameters ( ) , lr = learning_rate ) self . gamma = gamma self . tau = tau self . target_update = target_update self . steps = 0
:param actions: Number of possible actions
    :param network: Neural neural network to use as a Q function approximator
    :param eps_start: e-greedy exploration start epsilon
    :param eps_end: e-greedy exploration end epsilon
    :param eps_decay: e-greedy exploration decay
    :param learning_rate: optimizer learning rate
    :param gamma: future returns discount
    :param tau: soft update smoothing coefficient. Use 1.0 for hard target update
    :param target_update: target update interval
    :param batch_size: batch size
    :param min_steps: min number of experiences in replay buffer before learning
    :param replay_size: replay memory size