def SGD(eta):
    """
    Stochastic Gradient Descent (SGD)

    parameter update rule:
    w = w - eta * dw
    """
    def optimizer(grads, vars):
        def step():
            for key in vars:
                if key in grads:
                    vars[key] -= eta * grads[key]
        return step
    return optimizer