tensorflow:: ops:: ResourceSparseApplyMomentum

#include <training_ops.h>

모멘텀 계획에 따라 '*var' 및 '*accum'의 관련 항목을 업데이트합니다.

요약

네스테로프 모멘텀을 사용하려면 use_nesterov = True로 설정하십시오.

즉, grad 값이 있는 행의 경우 var와 accum을 다음과 같이 업데이트합니다.

누적 = 누적 * 모멘텀 + 그라데이션 var -= lr * 누적

논거:

  • 범위: Scope 객체
  • var: Variable()에서 가져온 값이어야 합니다.
  • accum: Variable()에서 가져와야 합니다.
  • lr: 학습률. 스칼라 값이어야 합니다.
  • grad: 기울기.
  • 인덱스: var와 accum의 첫 번째 차원에 대한 인덱스 벡터입니다.
  • 운동량: 운동량. 스칼라 값이어야 합니다.

선택적 속성( Attrs 참조):

  • use_locking: True 로 설정하면 변수 및 누적 텐서 업데이트가 락으로 보호됩니다. 그렇지 않으면 동작이 정의되지 않지만 경합이 줄어들 수 있습니다.
  • use_nesterov: True 설정하면 grad를 계산하기 위해 전달되는 텐서는 var - lr * momentum * accum이 되므로 최종적으로 얻는 var 값은 실제로 var - lr * momentum * accum이 됩니다.

보고:

생성자와 소멸자

ResourceSparseApplyMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input momentum)
ResourceSparseApplyMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input momentum, const ResourceSparseApplyMomentum::Attrs & attrs)

공개 속성

operation

공공 기능

operator::tensorflow::Operation () const

공개 정적 함수

UseLocking (bool x)
UseNesterov (bool x)

구조

텐서플로우:: ops:: ResourceSparseApplyMomentum:: Attrs

ResourceSparseApplyMomentum 에 대한 선택적 속성 설정기입니다.

공개 속성

작업

Operation operation

공공 기능

리소스 스파스페이드애플리모멘텀

 ResourceSparseApplyMomentum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input var,
  ::tensorflow::Input accum,
  ::tensorflow::Input lr,
  ::tensorflow::Input grad,
  ::tensorflow::Input indices,
  ::tensorflow::Input momentum
)

리소스 스파스페이드애플리모멘텀

 ResourceSparseApplyMomentum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input var,
  ::tensorflow::Input accum,
  ::tensorflow::Input lr,
  ::tensorflow::Input grad,
  ::tensorflow::Input indices,
  ::tensorflow::Input momentum,
  const ResourceSparseApplyMomentum::Attrs & attrs
)

연산자::텐서플로우::작업

 operator::tensorflow::Operation() const 

공개 정적 함수

잠금 사용

Attrs UseLocking(
  bool x
)

네스테로프를 사용하세요

Attrs UseNesterov(
  bool x
)