8-bit RMSprop optimizer. Arguments: params (`torch.tensor`): The input parameters to optimize. lr (`float`, defaults to 1e-2): The learning rate. alpha (`float`, defaults to 0.99): The alpha value i
(
self,
params,
lr=1e-2,
alpha=0.99,
eps=1e-8,
weight_decay=0,
momentum=0,
centered=False,
args=None,
min_8bit_size=4096,
)
| 63 | |
| 64 | class RMSprop8bit(Optimizer1State): |
| 65 | def __init__( |
| 66 | self, |
| 67 | params, |
| 68 | lr=1e-2, |
| 69 | alpha=0.99, |
| 70 | eps=1e-8, |
| 71 | weight_decay=0, |
| 72 | momentum=0, |
| 73 | centered=False, |
| 74 | args=None, |
| 75 | min_8bit_size=4096, |
| 76 | ): |
| 77 | """ |
| 78 | 8-bit RMSprop optimizer. |
| 79 | |
| 80 | Arguments: |
| 81 | params (`torch.tensor`): |
| 82 | The input parameters to optimize. |
| 83 | lr (`float`, defaults to 1e-2): |
| 84 | The learning rate. |
| 85 | alpha (`float`, defaults to 0.99): |
| 86 | The alpha value is the decay rate of the squared gradients of the optimizer. |
| 87 | eps (`float`, defaults to 1e-8): |
| 88 | The epsilon value prevents division by zero in the optimizer. |
| 89 | weight_decay (`float`, defaults to 0.0): |
| 90 | The weight decay value for the optimizer. |
| 91 | momentum (`float`, defaults to 0): |
| 92 | The momentum value speeds up the optimizer by taking bigger steps. |
| 93 | centered (`bool`, defaults to `False`): |
| 94 | Whether the gradients are normalized by the variance. If `True`, it can help training at the expense of additional compute. |
| 95 | args (`object`, defaults to `None`): |
| 96 | An object with additional arguments. |
| 97 | min_8bit_size (`int`, defaults to 4096): |
| 98 | The minimum number of elements of the parameter tensors for 8-bit optimization. |
| 99 | """ |
| 100 | if alpha == 0: |
| 101 | raise NotImplementedError("RMSprop with alpha==0.0 is not supported!") |
| 102 | if centered: |
| 103 | raise NotImplementedError("Centered RMSprop is not supported!") |
| 104 | super().__init__( |
| 105 | "rmsprop", |
| 106 | params, |
| 107 | lr, |
| 108 | (alpha, momentum), |
| 109 | eps, |
| 110 | weight_decay, |
| 111 | 8, |
| 112 | args, |
| 113 | min_8bit_size, |
| 114 | ) |
| 115 | |
| 116 | |
| 117 | class RMSprop32bit(Optimizer1State): |