# What am I doing wrong? GCN embeddings

**URL:** <https://discuss.ai.google.dev/t/what-am-i-doing-wrong-gcn-embeddings/29813>\
**Category:** General Discussion\
**Tags:** graph, tfjs, help\_request\
**Created:** [February 5, 2022, 1:47am UTC](https://discuss.ai.google.dev/t/what-am-i-doing-wrong-gcn-embeddings/29813 "2022-02-05T01:47:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Matthews](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/greg_matthews/32/10023_2.png) [@Greg\_Matthews](https://discuss.ai.google.dev/u/Greg_Matthews)\
**Post date:** [February 5, 2022, 1:47am UTC](https://discuss.ai.google.dev/t/what-am-i-doing-wrong-gcn-embeddings/29813/1 "2022-02-05T01:47:06Z")

</div>

So, i’m successfully using tensorflow.js to predict nodes and edges in a graph, but now wanting to improve this by taking a GCN approach.

I’ve tried to create GCN embeddings by using a message passing approach to generate the embeddings for each node, but I then get totally incorrect recommendations.

In my graph, there are 20+ different node types and 10+ different edge types, and edges are directional, so if I want to create a message passing based representation of nodes, in order to predict edges between 2 given nodes, what should the node embeddings look like? e.g.

say there’s a 2 node graph A, and B, and let’s say its 3 different node types, not 20 for this example  
A = [0, 0, 1]  
B = [0, 1, 0]

and there’s an edge from B → A

would the embedding for A after 1 round of message passing be:

1. [0, 0.5, 0.5] i.e. using an averaging
2. [0, 0, 1, 0, 1, 0], i.e. concatenation, where the last 3 onehot slots would be the average of all incoming neighbours.

Thanks a lot,  
Greg
