4 #include <torch/nn/module.h> 5 #include <torch/optim/optimizer.h> 6 #include <torch/optim/serialize.h> 7 #include <torch/types.h> 26 TORCH_ARG(
double, learning_rate);
27 TORCH_ARG(
double, alpha) = 0.99;
28 TORCH_ARG(
double, eps) = 1e-8;
29 TORCH_ARG(
double, weight_decay) = 0;
30 TORCH_ARG(
double, momentum) = 0;
31 TORCH_ARG(
bool, centered) =
false;
36 template <
typename ParameterContainer>
38 ParameterContainer&& parameters,
40 :
Optimizer(std::forward<ParameterContainer>(parameters)),
50 std::vector<Tensor> square_average_buffers;
51 std::vector<Tensor> momentum_buffers;
52 std::vector<Tensor> grad_average_buffers;
57 template <
typename Self,
typename Archive>
58 static void serialize(Self&
self, Archive& archive) {
59 _TORCH_OPTIM_SERIALIZE(square_average_buffers);
60 _TORCH_OPTIM_SERIALIZE(momentum_buffers);
61 _TORCH_OPTIM_SERIALIZE(grad_average_buffers);
Optimizer that defines a required step() method that takes no arguments and produces no values...