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

Method FOR

include/instance/model/knowledge_graph.h:55–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 Float weight = 1) {
54 auto update = get_update_function<Float, optimizer_type>();
55 FOR(i, dim) {
56 Float h = head[i];
57 Float t = tail[i];
58 Float r = relation[i];
59 Float s = h + r - t > 0 ? 1 : -1;
60 head[i] -= (optimizer.*update)(h, -gradient * s, weight);
61 tail[i] -= (optimizer.*update)(t, gradient * s, weight);
62 relation[i] -= relation_lr_multiplier * (optimizer.*update)(r, -gradient * s, weight);
63 }
64 }
65
66 template<OptimizerType optimizer_type>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected