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

Method FOR

include/instance/model/knowledge_graph.h:135–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 auto update = get_update_function<Float, optimizer_type>();
134 l3_regularization *= 3;
135 FOR(i, dim) {
136 Float h = head[i];
137 Float t = tail[i];
138 Float r = relation[i];
139 head[i] -= (optimizer.*update)(h, gradient * r * t + l3_regularization * abs(h) * h, weight);
140 tail[i] -= (optimizer.*update)(t, gradient * h * r + l3_regularization * abs(t) * t, weight);
141 relation[i] -= relation_lr_multiplier *
142 (optimizer.*update)(r, gradient * h * t + l3_regularization * abs(r) * r, weight);
143 }
144 }
145
146 template<OptimizerType optimizer_type>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected