blob: d1a84a4c34bb7df8e5a6d8d16d29322f26b13657 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
op {
graph_op_name: "ResourceApplyMomentum"
in_arg {
name: "var"
description: <<END
Should be from a Variable().
END
}
in_arg {
name: "accum"
description: <<END
Should be from a Variable().
END
}
in_arg {
name: "lr"
description: <<END
Scaling factor. Must be a scalar.
END
}
in_arg {
name: "grad"
description: <<END
The gradient.
END
}
in_arg {
name: "momentum"
description: <<END
Momentum. Must be a scalar.
END
}
attr {
name: "use_locking"
description: <<END
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.
END
}
attr {
name: "use_nesterov"
description: <<END
If `True`, the tensor passed to compute grad will be
var - lr * momentum * accum, so in the end, the var you get is actually
var - lr * momentum * accum.
END
}
summary: "Update \'*var\' according to the momentum scheme. Set use_nesterov = True if you"
description: <<END
want to use Nesterov momentum.
accum = accum * momentum + grad
var -= lr * accum
END
}
|