@Operator(group="train") public final class ResourceSparseApplyAdagrad extends PrimitiveOp
That is for rows we have grad for, we update var and accum as follows: accum += grad * grad var -= lr * grad * (1 / sqrt(accum))
Modifier and Type | Class and Description |
---|---|
static class |
ResourceSparseApplyAdagrad.Options
Optional attributes for
ResourceSparseApplyAdagrad |
operation
Modifier and Type | Method and Description |
---|---|
static <T,U extends Number> |
create(Scope scope,
Operand<?> var,
Operand<?> accum,
Operand<T> lr,
Operand<T> grad,
Operand<U> indices,
ResourceSparseApplyAdagrad.Options... options)
Factory method to create a class wrapping a new ResourceSparseApplyAdagrad operation.
|
static ResourceSparseApplyAdagrad.Options |
updateSlots(Boolean updateSlots) |
static ResourceSparseApplyAdagrad.Options |
useLocking(Boolean useLocking) |
equals, hashCode, op, toString
public static <T,U extends Number> ResourceSparseApplyAdagrad create(Scope scope, Operand<?> var, Operand<?> accum, Operand<T> lr, Operand<T> grad, Operand<U> indices, ResourceSparseApplyAdagrad.Options... options)
scope
- current scopevar
- Should be from a Variable().accum
- Should be from a Variable().lr
- Learning rate. Must be a scalar.grad
- The gradient.indices
- A vector of indices into the first dimension of var and accum.options
- carries optional attributes valuespublic static ResourceSparseApplyAdagrad.Options useLocking(Boolean useLocking)
useLocking
- If `True`, updating of the var and accum tensors will be protected
by a lock; otherwise the behavior is undefined, but may exhibit less
contention.public static ResourceSparseApplyAdagrad.Options updateSlots(Boolean updateSlots)
updateSlots
- Copyright © 2022. All rights reserved.