32-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
(
self,
params,
lr=1e-2,
alpha=0.99,
eps=1e-8,
weight_decay=0,
momentum=0,
centered=False,
args=None,
min_8bit_size=4096,
)
| 116 | |
| 117 | class RMSprop32bit(Optimizer1State): |
| 118 | def __init__( |
| 119 | self, |
| 120 | params, |
| 121 | lr=1e-2, |
| 122 | alpha=0.99, |
| 123 | eps=1e-8, |
| 124 | weight_decay=0, |
| 125 | momentum=0, |
| 126 | centered=False, |
| 127 | args=None, |
| 128 | min_8bit_size=4096, |
| 129 | ): |
| 130 | """ |
| 131 | 32-bit RMSprop optimizer. |
| 132 | |
| 133 | Arguments: |
| 134 | params (`torch.tensor`): |
| 135 | The input parameters to optimize. |
| 136 | lr (`float`, defaults to 1e-2): |
| 137 | The learning rate. |
| 138 | alpha (`float`, defaults to 0.99): |
| 139 | The alpha value is the decay rate of the squared gradients of the optimizer. |
| 140 | eps (`float`, defaults to 1e-8): |
| 141 | The epsilon value prevents division by zero in the optimizer. |
| 142 | weight_decay (`float`, defaults to 0.0): |
| 143 | The weight decay value for the optimizer. |
| 144 | momentum (`float`, defaults to 0): |
| 145 | The momentum value speeds up the optimizer by taking bigger steps. |
| 146 | centered (`bool`, defaults to `False`): |
| 147 | Whether the gradients are normalized by the variance. If `True`, it can help training at the expense of additional compute. |
| 148 | optim_bits (`int`, defaults to 32): |
| 149 | The number of bits of the optimizer state. |
| 150 | args (`object`, defaults to `None`): |
| 151 | An object with additional arguments. |
| 152 | min_8bit_size (`int`, defaults to 4096): |
| 153 | The minimum number of elements of the parameter tensors for 8-bit optimization. |
| 154 | """ |
| 155 | |
| 156 | if alpha == 0: |
| 157 | raise NotImplementedError("RMSprop with alpha==0.0 is not supported!") |
| 158 | if centered: |
| 159 | raise NotImplementedError("Centered RMSprop is not supported!") |
| 160 | super().__init__( |
| 161 | "rmsprop", |
| 162 | params, |
| 163 | lr, |
| 164 | (alpha, momentum), |
| 165 | eps, |
| 166 | weight_decay, |
| 167 | 32, |
| 168 | args, |
| 169 | min_8bit_size, |
| 170 | ) |