def step(self, action):
    '\n        Execute environment step\n\n        Parameters\n        ----------\n        action : list\n            action to execute\n\n        Returns\n        -------\n        np.array, float, bool, dict\n            state, reward, done, info\n        '
    done = super(SGDEnv, self).step_()
    self.step_count += 1
    index = 0
    if (not isinstance(action, float)):
        action = action[0]
    action = torch.Tensor([action]).to(self.device)
    new_lr = (10 ** (- action))
    self.current_lr = new_lr
    delta_w = torch.mul(new_lr, (self.firstOrderMomentum / (torch.sqrt(self.secondOrderMomentum) + self.epsilon)))
    for (i, p) in enumerate(self.model.parameters()):
        layer_size = self.layer_sizes[i]
        p.data = (p.data - delta_w[index:(index + layer_size)].reshape(shape=p.data.shape))
        index += layer_size
    self._set_zero_grad()
    reward = self.get_reward(self)
    return (self.get_state(self), reward, done, {})
Execute environment step

Parameters
----------
action : list
    action to execute

Returns
-------
np.array, float, bool, dict
    state, reward, done, info
def step(self, action):
    '\n        Execute environment step\n\n        Parameters\n        ----------\n        action : list\n            action to execute\n\n        Returns\n        -------\n        np.array, float, bool, dict\n            state, reward, done, info\n        '
    done = super(SGDEnv, self).step_()
    self.step_count += 1
    index = 0
    if (not isinstance(action, float)):
        action = action[0]
    action = torch.Tensor([action]).to(self.device)
    new_lr = (10 ** (- action))
    self.current_lr = new_lr
    delta_w = torch.mul(new_lr, (self.firstOrderMomentum / (torch.sqrt(self.secondOrderMomentum) + self.epsilon)))
    for (i, p) in enumerate(self.model.parameters()):
        layer_size = self.layer_sizes[i]
        p.data = (p.data - delta_w[index:(index + layer_size)].reshape(shape=p.data.shape))
        index += layer_size
    self._set_zero_grad()
    reward = self.get_reward(self)
    return (self.get_state(self), reward, done, {})