MATCH (n {name: 'Andy'})
SET (CASE WHEN n.age = 55 THEN n END).worksIn = 'Malmo'
RETURN n.name, n.worksIn
# equation (4) | |
print('\n\nNeighborhood aggregation (GCN) scaled with attention scores (GAT). Shape(n, emb)\n') | |
ND_GAT = A_scaled.dot(z1) | |
print(ND_GAT) |
# equation (3) | |
print('\n\n----- Edge scores as matrix. Shape(n,n)\n') | |
e_matr = np.zeros(A.shape) | |
e_matr[edge_coords[0], edge_coords[1]] = e.reshape(-1,) | |
print(e_matr) | |
print('\n\n----- For each node, normalize the edge (or neighbor) contributions using softmax\n') | |
alpha0 = softmax(e_matr[:,0][e_matr[:,0] != 0]) | |
alpha1 = softmax(e_matr[:,1][e_matr[:,1] != 0]) | |
alpha2 = softmax(e_matr[:,2][e_matr[:,2] != 0]) |
# equation (2) - Second part | |
print('\n\n----- Attention coefficients. Shape(1, len(emb.concat(emb)))\n') | |
att = np.random.rand(1, z2.shape[1]) | |
print(att) | |
print('\n\n----- Edge representations combined with the attention coefficients. Shape(1, number of edges)\n') | |
z2_att = z2.dot(att.T) | |
print(z2_att) | |
print('\n\n----- Leaky Relu. Shape(1, number of edges)') |
# equation (2) - First part | |
print('\n\n----- Concat hidden features to represent edges. Shape(len(emb.concat(emb)), number of edges)\n') | |
edge_coords = np.where(A==1) | |
h_src_nodes = z1[edge_coords[0]] | |
h_dst_nodes = z1[edge_coords[1]] | |
z2 = np.concatenate((h_src_nodes, h_dst_nodes), axis=1) |
# equation (1) | |
print('\n\n----- Linear Transformation. Shape(n, emb)\n') | |
z1 = X.dot(W.T) | |
print(z1) |
print('\n\n----- One-hot vector representation of nodes. Shape(n,n)\n') | |
X = np.eye(5, 5) | |
n = X.shape[0] | |
np.random.shuffle(X) | |
print(X) | |
print('\n\n----- Embedding dimension\n') | |
emb = 3 | |
print(emb) |
This gist includes a curriculum to prepare your application for Research Scientist positions, focusing on Natural Language Understanding (NLU) and Graph Neural Networks (GNNs).
The approach adopted for this curriculum is code-first, teach later, theory in the middle.
Many curricula available on the Web suggest beginning with the theory (a lot of theory) before creating something. However, many books provide details using only math and statistics, which require a lot of time and energy for understanding. Math is fundamental. But after days spent on a few pages of a book, you risk not having a real insight into how things work. Moreover, to internalize some tricky concepts, the best solution is to teach those concepts to someone who does not know much about the topic.
For this reason, the learning framework adopted in this curriculum will be structured according to the following steps:
- Searching articles, tutorials, and videos on the Web help you build intuition and start
Keep your master aligned with the original master | |
``` | |
git remote add upstream https://github.com/some_user/some_repo | |
git fetch upstream | |
git checkout master | |
git reset --hard upstream/master | |
git push origin master --force | |
``` |