MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Adagrad

Function Adagrad

tensorflow/core/kernels/training_ops_test.cc:117–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115BENCHMARK(BM_SGD)->Arg(128 << 10)->Arg(256 << 10);
116
117static void Adagrad(int32 n, Graph** init_g, Graph** train_g) {
118 {
119 Graph* g = new Graph(OpRegistry::Global());
120 auto var = Var(g, n);
121 auto accum = Var(g, n);
122 auto zero = Zeros(g, n);
123 test::graph::Assign(g, var, zero);
124 test::graph::Assign(g, accum, zero);
125 *init_g = g;
126 }
127 {
128 Graph* g = new Graph(OpRegistry::Global());
129 auto var = Var(g, n);
130 auto accum = Var(g, n);
131 auto lr = Scalar(g, 0.01);
132 auto grad = Random(g, n);
133 test::graph::Multi(g, "ApplyAdagrad", {var, accum, lr, grad});
134 *train_g = g;
135 }
136}
137
138static void BM_Adagrad(int iters, int params) {
139 const int64 tot = static_cast<int64>(iters) * params;

Callers 1

BM_AdagradFunction · 0.70

Calls 6

ScalarFunction · 0.85
RandomFunction · 0.85
MultiFunction · 0.85
VarFunction · 0.70
ZerosFunction · 0.70
AssignClass · 0.70

Tested by

no test coverage detected