资源算法shampoo.pytorch

shampoo.pytorch

2019-09-19 | |  91 |   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

用户评价
全部评价

热门资源

  • seetafaceJNI

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

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • shih-styletransfer

    shih-styletransfer Code from Style Transfer ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...