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

Method forward

include/instance/model/knowledge_graph.h:208–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206
207 __host__ __device__
208 static void forward(const Vector &head, const Vector &tail, const Vector &relation, Float &output,
209 float l3_regularization) {
210 output = 0;
211 FOR(i, dim / 2) {
212 Float h_re = head[i * 2];
213 Float h_im = head[i * 2 + 1];
214 Float t_re = tail[i * 2];
215 Float t_im = tail[i * 2 + 1];
216 Float r_re = relation[i * 2];
217 Float r_im = relation[i * 2 + 1];
218 Float product_re = h_re * r_re - h_im * r_im;
219 Float product_im = h_re * r_im + h_im * r_re;
220 output += product_re * t_re + product_im * t_im;
221 }
222 output = SUM(output);
223 }
224
225 template<OptimizerType optimizer_type>
226 __host__ __device__

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected