def __init__(self, model_distribution, learning_rate=0.01, weight_decay=0.0002, momentum=0.9, is_ascent=True):
        assert (isinstance(model_distribution, Distribution))

        self.model_distribution = model_distribution

        # otherwise the model won't learn
        assert (learning_rate > 0)

        self.learning_rate = learning_rate
        self.weigth_decay = weight_decay
        self.momentum = momentum

        # a premultiplication factor to retieve the correct update rule
        self.ascent_factor = 1 if is_ascent else -1

        # initialize matrices to store deltas past values
        self.d_weights = np.zeros(shape=self.model_distribution.weights.shape)
        self.d_bias_visible = np.zeros(shape=self.model_distribution.bias_visible.shape)
        self.d_bias_hidden = np.zeros(shape=self.model_distribution.bias_hidden.shape)
dataset/ETHPy150Open deprofundis/deprofundis/models/optimizer.py/SGD.__init__/original