def step(self, closure=None):
        """
        Performs a single optimization step (parameter update).

        Arguments:
            closure: A closure that reevaluates the model and
                returns the loss. Optional for most optimizers.

        Returns:
            computed loss
        """
        loss = None
        if closure is not None:
            loss = closure()

        for group in self.param_groups:
            momentum = group["momentum"]
            dampening = group["dampening"]
            nesterov = group["nesterov"]

            for p in group["params"]:
                if p.grad is None:
                    continue
                grad = p.grad.data
                state = self.state[p]

                # State initialization
                if len(state) == 0:
                    state["momentum"] = torch.zeros_like(p.data)

                # SGD
                buf = state["momentum"]
                buf.mul_(momentum).add_(grad, alpha=1 - dampening)
                if nesterov:
                    d_p = grad + momentum * buf
                else:
                    d_p = buf

                # Projection
                wd_ratio = 1
                if len(p.shape) > 1:
                    d_p, wd_ratio = self._projection(
                        p, grad, d_p, group["delta"], group["wd_ratio"], group["eps"]
                    )

                # Weight decay
                if group["weight_decay"] > 0:
                    p.data.mul_(
                        1
                        - group["lr"] * group["weight_decay"] * wd_ratio / (1 - momentum)
                    )

                # Step
                p.data.add_(d_p, alpha=-group["lr"])

        return loss

        Performs a single optimization step (parameter update).

        Arguments:
            closure: A closure that reevaluates the model and
                returns the loss. Optional for most optimizers.

        Returns:
            computed loss
        
catalyst/contrib/optimizers/sgdp.py