MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / backward

Method backward

include/instance/model/graph.h:48–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47 template<OptimizerType optimizer_type>
48 __host__ __device__
49 static void backward(Vector &vertex, Vector &context,
50 Float gradient, const Optimizer &optimizer, Float weight = 1) {
51 auto update = get_update_function < Float, optimizer_type>();
52 FOR(i, dim) {
53 Float v = vertex[i];
54 Float c = context[i];
55 vertex[i] -= (optimizer.*update)(v, gradient * c, weight);
56 context[i] -= (optimizer.*update)(c, gradient * v, weight);
57 }
58 }
59
60 template<OptimizerType optimizer_type>
61 __host__ __device__

Callers 1

linear_classificationFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected