execGCN = (network, {normalizedAdjMatrix, nodeFeatures}, applyActivationToFinalOutput=false) => tf.tidy(() => {
const layers = network.layers
const adj = tf.tensor(normalizedAdjMatrix)
let x = tf.tensor(nodeFeatures)
for(const layer of network.layers) {
const res = layer.apply([x])
const connected = adj.matMul(res)
if(!applyActivationToFinalOutput && layer == layers[layers.length - 1]) return connected
x = tf.relu(connected)
}
return x
})