资源算法shampoo.pytorch

shampoo.pytorch

2019-09-19 | |  115 |   0 |   0

shampoo.pytorch

An implementation of shampoo, proposed in Shampoo : Preconditioned Stochastic Tensor Optimization by Vineet Gupta, Tomer Koren and Yoram Singer.

algorithm.png

#  Suppose the size of the tensor grad (i, j, k),#  dim_id = 1 and dim = jgrad = grad.transpose_(0, dim_id).contiguous()  # (j, i, k)transposed_size = grad.size()grad = grad.view(dim, -1)  # (j, i x k)grad_t = grad.t()  # (i x k, j)precond.add_(grad @ grad_t)  # (j, j)inv_precond.copy_(_matrix_power(state[precond, -1 / order))  # (j, j)grad = grad = inv_precond @ grad  # (j, i x k)grad = grad.view(transposed_size)   # (j, i, k)


上一篇:reseg-pytorch

下一篇:ram

用户评价
全部评价

热门资源

  • TensorFlow-Course

    This repository aims to provide simple and read...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • mxnet_VanillaCNN

    This is a mxnet implementation of the Vanilla C...

  • DuReader_QANet_BiDAF

    Machine Reading Comprehension on DuReader Usin...

  • Klukshu-Sockeye-...

    KLUKSHU SOCKEYE PROJECTS 2016 This repositor...