We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import numpy as np import tf_geometric as tfg import tensorflow as tf
graph = tfg.Graph( x=np.random.randn(5, 20), # 5 nodes, 20 features, edge_index=[[0, 0, 1, 3], [1, 2, 2, 1]] # 4 undirected edges )
print("Graph Desc: \n", graph)
graph.to_directed(inplace=True) # pre-process edges print("Processed Graph Desc: \n", graph) print("Processed Edge Index:\n", graph.edge_index)
gat_layer = tfg.layers.GAT(units=4, num_heads=4, activation=tf.nn.relu) output = gat_layer([graph.x,graph.edge_index]) print("Output of GAT: \n", output)
显示,错误TypeError: 'int' object is not subscriptable
附上所使用的库版本: tensorflow -------2.16.1 scipy ---------- 1.12.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
coding=utf-8
import numpy as np
import tf_geometric as tfg
import tensorflow as tf
graph = tfg.Graph(
x=np.random.randn(5, 20), # 5 nodes, 20 features,
edge_index=[[0, 0, 1, 3],
[1, 2, 2, 1]] # 4 undirected edges
)
print("Graph Desc: \n", graph)
graph.to_directed(inplace=True) # pre-process edges
print("Processed Graph Desc: \n", graph)
print("Processed Edge Index:\n", graph.edge_index)
Multi-head Graph Attention Network (GAT)
gat_layer = tfg.layers.GAT(units=4, num_heads=4, activation=tf.nn.relu)
output = gat_layer([graph.x,graph.edge_index])
print("Output of GAT: \n", output)
显示,错误TypeError: 'int' object is not subscriptable
附上所使用的库版本:
tensorflow -------2.16.1
scipy ---------- 1.12.0
The text was updated successfully, but these errors were encountered: