def __init__(self, config):
    '\n        Initialize SGD Env\n\n        Parameters\n        -------\n        config : objdict\n            Environment configuration\n        '
    super(SGDEnv, self).__init__(config)
    self.batch_size = config.training_batch_size
    self.validation_batch_size = config.validation_batch_size
    self.no_cuda = config.no_cuda
    self.current_batch_size = config.training_batch_size
    self.env_seed = config.seed
    self.seed(self.env_seed)
    self.use_cuda = ((not self.no_cuda) and torch.cuda.is_available())
    self.device = torch.device(('cuda' if self.use_cuda else 'cpu'))
    self.training_validation_ratio = 0.8
    self.train_dataset = None
    self.validation_dataset = None
    self.train_loader = None
    self.validation_loader = None
    self.train_loader_it = None
    self.validation_loader_it = None
    self.train_batch_index = 0
    self.epoch_index = 0
    self.current_training_loss = None
    self.loss_batch = None
    self.model = None
    self.parameter_count = 0
    self.layer_sizes = []
    self.loss_function = torch.nn.NLLLoss(reduction='none')
    self.loss_function = extend(self.loss_function)
    self.initial_lr = (config.lr * torch.ones(1, device=self.device, requires_grad=False))
    self.current_lr = (config.lr * torch.ones(1, device=self.device, requires_grad=False))
    self.beta1 = config.beta1
    self.beta2 = config.beta2
    self.m = 0
    self.v = 0
    self.epsilon = 1e-08
    self.t = 0
    self.step_count = torch.zeros(1, device=self.device, requires_grad=False)
    self.prev_descent = None
    self.learning_rate = 0.001
    self.predictiveChangeVarDiscountedAverage = torch.zeros(1, device=self.device, requires_grad=False)
    self.predictiveChangeVarUncertainty = torch.zeros(1, device=self.device, requires_grad=False)
    self.lossVarDiscountedAverage = torch.zeros(1, device=self.device, requires_grad=False)
    self.lossVarUncertainty = torch.zeros(1, device=self.device, requires_grad=False)
    self.discount_factor = 0.9
    self.firstOrderMomentum = torch.zeros(1, device=self.device, requires_grad=False)
    self.secondOrderMomentum = torch.zeros(1, device=self.device, requires_grad=False)
    self.writer = None
    if ('reward_function' in config.keys()):
        self.get_reward = config['reward_function']
    else:
        self.get_reward = self.get_default_reward
    if ('state_method' in config.keys()):
        self.get_state = config['state_method']
    else:
        self.get_state = self.get_default_state
Initialize SGD Env

Parameters
-------
config : objdict
    Environment configuration
def __init__(self, config):
    '\n        Initialize SGD Env\n\n        Parameters\n        -------\n        config : objdict\n            Environment configuration\n        '
    super(SGDEnv, self).__init__(config)
    self.batch_size = config.training_batch_size
    self.validation_batch_size = config.validation_batch_size
    self.no_cuda = config.no_cuda
    self.current_batch_size = config.training_batch_size
    self.env_seed = config.seed
    self.seed(self.env_seed)
    self.use_cuda = ((not self.no_cuda) and torch.cuda.is_available())
    self.device = torch.device(('cuda' if self.use_cuda else 'cpu'))
    self.training_validation_ratio = 0.8
    self.train_dataset = None
    self.validation_dataset = None
    self.train_loader = None
    self.validation_loader = None
    self.train_loader_it = None
    self.validation_loader_it = None
    self.train_batch_index = 0
    self.epoch_index = 0
    self.current_training_loss = None
    self.loss_batch = None
    self.model = None
    self.parameter_count = 0
    self.layer_sizes = []
    self.loss_function = torch.nn.NLLLoss(reduction='none')
    self.loss_function = extend(self.loss_function)
    self.initial_lr = (config.lr * torch.ones(1, device=self.device, requires_grad=False))
    self.current_lr = (config.lr * torch.ones(1, device=self.device, requires_grad=False))
    self.beta1 = config.beta1
    self.beta2 = config.beta2
    self.m = 0
    self.v = 0
    self.epsilon = 1e-08
    self.t = 0
    self.step_count = torch.zeros(1, device=self.device, requires_grad=False)
    self.prev_descent = None
    self.learning_rate = 0.001
    self.predictiveChangeVarDiscountedAverage = torch.zeros(1, device=self.device, requires_grad=False)
    self.predictiveChangeVarUncertainty = torch.zeros(1, device=self.device, requires_grad=False)
    self.lossVarDiscountedAverage = torch.zeros(1, device=self.device, requires_grad=False)
    self.lossVarUncertainty = torch.zeros(1, device=self.device, requires_grad=False)
    self.discount_factor = 0.9
    self.firstOrderMomentum = torch.zeros(1, device=self.device, requires_grad=False)
    self.secondOrderMomentum = torch.zeros(1, device=self.device, requires_grad=False)
    self.writer = None
    if ('reward_function' in config.keys()):
        self.get_reward = config['reward_function']
    else:
        self.get_reward = self.get_default_reward
    if ('state_method' in config.keys()):
        self.get_state = config['state_method']
    else:
        self.get_state = self.get_default_state