MCPcopy
hub / github.com/tensorflow/tfjs / constructor

Method constructor

tfjs-core/src/optimizers/adam_optimizer.ts:49–62  ·  view source on GitHub ↗
(
      protected learningRate: number, protected beta1: number,
      protected beta2: number, protected epsilon: number = null)

Source from the content-addressed store, hash-verified

47 private accumulatedSecondMoment: OptimizerVariable[] = [];
48
49 constructor(
50 protected learningRate: number, protected beta1: number,
51 protected beta2: number, protected epsilon: number = null) {
52 super();
53 tidy(() => {
54 // accB* will be updated by batch.
55 this.accBeta1 = scalar(beta1).variable();
56 this.accBeta2 = scalar(beta2).variable();
57 });
58
59 if (epsilon == null) {
60 this.epsilon = ENGINE.backend.epsilon();
61 }
62 }
63
64 applyGradients(variableGradients: NamedVariableMap|NamedTensor[]) {
65 const varNames = Array.isArray(variableGradients) ?

Callers

nothing calls this directly

Calls 4

tidyFunction · 0.90
scalarFunction · 0.90
variableMethod · 0.80
epsilonMethod · 0.45

Tested by

no test coverage detected