Skip to content

Commit

Permalink
fixed typos in examples/graph &examples.keras_recipes. (#1776)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuryanarayanaY authored Feb 27, 2024
1 parent e00944a commit 0cf3c29
Show file tree
Hide file tree
Showing 27 changed files with 242 additions and 270 deletions.
4 changes: 2 additions & 2 deletions examples/graph/gat_node_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## Introduction
[Graph neural networks](https://en.wikipedia.org/wiki/Graph_neural_network)
is the prefered neural network architecture for processing data structured as
is the preferred neural network architecture for processing data structured as
graphs (for example, social networks or molecule structures), yielding
better results than fully-connected networks or convolutional networks.
Expand Down Expand Up @@ -131,7 +131,7 @@
aggregated information of *N*-hops (where *N* is decided by the number of layers of the
GAT). Importantly, in contrast to the
[graph convolutional network](https://arxiv.org/abs/1609.02907) (GCN)
the GAT makes use of attention machanisms
the GAT makes use of attention mechanisms
to aggregate information from neighboring nodes (or *source nodes*). In other words, instead of simply
averaging/summing node states from source nodes (*source papers*) to the target node (*target papers*),
GAT first applies normalized attention scores to each source node state and then sums.
Expand Down
2 changes: 1 addition & 1 deletion examples/graph/gnn_citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def call(self, inputs):
1. Apply preprocessing using FFN to the node features to generate initial node representations.
2. Apply one or more graph convolutional layer, with skip connections, to the node representation
to produce node embeddings.
3. Apply post-processing using FFN to the node embeddings to generat the final node embeddings.
3. Apply post-processing using FFN to the node embeddings to generate the final node embeddings.
4. Feed the node embeddings in a Softmax layer to predict the node class.
Each graph convolutional layer added captures information from a further level of neighbours.
Expand Down
28 changes: 13 additions & 15 deletions examples/graph/ipynb/gat_node_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"## Introduction\n",
"\n",
"[Graph neural networks](https://en.wikipedia.org/wiki/Graph_neural_network)\n",
"is the prefered neural network architecture for processing data structured as\n",
"is the preferred neural network architecture for processing data structured as\n",
"graphs (for example, social networks or molecule structures), yielding\n",
"better results than fully-connected networks or convolutional networks.\n",
"\n",
Expand Down Expand Up @@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -89,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -142,7 +142,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand All @@ -167,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -204,7 +204,7 @@
"aggregated information of *N*-hops (where *N* is decided by the number of layers of the\n",
"GAT). Importantly, in contrast to the\n",
"[graph convolutional network](https://arxiv.org/abs/1609.02907) (GCN)\n",
"the GAT makes use of attention machanisms\n",
"the GAT makes use of attention mechanisms\n",
"to aggregate information from neighboring nodes (or *source nodes*). In other words, instead of simply\n",
"averaging/summing node states from source nodes (*source papers*) to the target node (*target papers*),\n",
"GAT first applies normalized attention scores to each source node state and then sums."
Expand Down Expand Up @@ -239,7 +239,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -336,8 +336,7 @@
" else:\n",
" outputs = tf.reduce_mean(tf.stack(outputs, axis=-1), axis=-1)\n",
" # Activate and return node states\n",
" return tf.nn.relu(outputs)\n",
""
" return tf.nn.relu(outputs)\n"
]
},
{
Expand All @@ -357,7 +356,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -425,8 +424,7 @@
" # Update metric(s)\n",
" self.compiled_metrics.update_state(labels, tf.gather(outputs, indices))\n",
"\n",
" return {m.name: m.result() for m in self.metrics}\n",
""
" return {m.name: m.result() for m in self.metrics}\n"
]
},
{
Expand All @@ -440,7 +438,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -499,7 +497,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab_type": "code"
},
Expand Down Expand Up @@ -562,4 +560,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
Loading

0 comments on commit 0cf3c29

Please sign in to comment.