Skip to content

Commit 0cf3c29

Browse files
fixed typos in examples/graph &examples.keras_recipes. (#1776)
1 parent e00944a commit 0cf3c29

27 files changed

+242
-270
lines changed

examples/graph/gat_node_classification.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
## Introduction
1212
1313
[Graph neural networks](https://en.wikipedia.org/wiki/Graph_neural_network)
14-
is the prefered neural network architecture for processing data structured as
14+
is the preferred neural network architecture for processing data structured as
1515
graphs (for example, social networks or molecule structures), yielding
1616
better results than fully-connected networks or convolutional networks.
1717
@@ -131,7 +131,7 @@
131131
aggregated information of *N*-hops (where *N* is decided by the number of layers of the
132132
GAT). Importantly, in contrast to the
133133
[graph convolutional network](https://arxiv.org/abs/1609.02907) (GCN)
134-
the GAT makes use of attention machanisms
134+
the GAT makes use of attention mechanisms
135135
to aggregate information from neighboring nodes (or *source nodes*). In other words, instead of simply
136136
averaging/summing node states from source nodes (*source papers*) to the target node (*target papers*),
137137
GAT first applies normalized attention scores to each source node state and then sums.

examples/graph/gnn_citations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def call(self, inputs):
521521
1. Apply preprocessing using FFN to the node features to generate initial node representations.
522522
2. Apply one or more graph convolutional layer, with skip connections, to the node representation
523523
to produce node embeddings.
524-
3. Apply post-processing using FFN to the node embeddings to generat the final node embeddings.
524+
3. Apply post-processing using FFN to the node embeddings to generate the final node embeddings.
525525
4. Feed the node embeddings in a Softmax layer to predict the node class.
526526
527527
Each graph convolutional layer added captures information from a further level of neighbours.

examples/graph/ipynb/gat_node_classification.ipynb

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"## Introduction\n",
2424
"\n",
2525
"[Graph neural networks](https://en.wikipedia.org/wiki/Graph_neural_network)\n",
26-
"is the prefered neural network architecture for processing data structured as\n",
26+
"is the preferred neural network architecture for processing data structured as\n",
2727
"graphs (for example, social networks or molecule structures), yielding\n",
2828
"better results than fully-connected networks or convolutional networks.\n",
2929
"\n",
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"cell_type": "code",
54-
"execution_count": 0,
54+
"execution_count": null,
5555
"metadata": {
5656
"colab_type": "code"
5757
},
@@ -89,7 +89,7 @@
8989
},
9090
{
9191
"cell_type": "code",
92-
"execution_count": 0,
92+
"execution_count": null,
9393
"metadata": {
9494
"colab_type": "code"
9595
},
@@ -142,7 +142,7 @@
142142
},
143143
{
144144
"cell_type": "code",
145-
"execution_count": 0,
145+
"execution_count": null,
146146
"metadata": {
147147
"colab_type": "code"
148148
},
@@ -167,7 +167,7 @@
167167
},
168168
{
169169
"cell_type": "code",
170-
"execution_count": 0,
170+
"execution_count": null,
171171
"metadata": {
172172
"colab_type": "code"
173173
},
@@ -204,7 +204,7 @@
204204
"aggregated information of *N*-hops (where *N* is decided by the number of layers of the\n",
205205
"GAT). Importantly, in contrast to the\n",
206206
"[graph convolutional network](https://arxiv.org/abs/1609.02907) (GCN)\n",
207-
"the GAT makes use of attention machanisms\n",
207+
"the GAT makes use of attention mechanisms\n",
208208
"to aggregate information from neighboring nodes (or *source nodes*). In other words, instead of simply\n",
209209
"averaging/summing node states from source nodes (*source papers*) to the target node (*target papers*),\n",
210210
"GAT first applies normalized attention scores to each source node state and then sums."
@@ -239,7 +239,7 @@
239239
},
240240
{
241241
"cell_type": "code",
242-
"execution_count": 0,
242+
"execution_count": null,
243243
"metadata": {
244244
"colab_type": "code"
245245
},
@@ -336,8 +336,7 @@
336336
" else:\n",
337337
" outputs = tf.reduce_mean(tf.stack(outputs, axis=-1), axis=-1)\n",
338338
" # Activate and return node states\n",
339-
" return tf.nn.relu(outputs)\n",
340-
""
339+
" return tf.nn.relu(outputs)\n"
341340
]
342341
},
343342
{
@@ -357,7 +356,7 @@
357356
},
358357
{
359358
"cell_type": "code",
360-
"execution_count": 0,
359+
"execution_count": null,
361360
"metadata": {
362361
"colab_type": "code"
363362
},
@@ -425,8 +424,7 @@
425424
" # Update metric(s)\n",
426425
" self.compiled_metrics.update_state(labels, tf.gather(outputs, indices))\n",
427426
"\n",
428-
" return {m.name: m.result() for m in self.metrics}\n",
429-
""
427+
" return {m.name: m.result() for m in self.metrics}\n"
430428
]
431429
},
432430
{
@@ -440,7 +438,7 @@
440438
},
441439
{
442440
"cell_type": "code",
443-
"execution_count": 0,
441+
"execution_count": null,
444442
"metadata": {
445443
"colab_type": "code"
446444
},
@@ -499,7 +497,7 @@
499497
},
500498
{
501499
"cell_type": "code",
502-
"execution_count": 0,
500+
"execution_count": null,
503501
"metadata": {
504502
"colab_type": "code"
505503
},
@@ -562,4 +560,4 @@
562560
},
563561
"nbformat": 4,
564562
"nbformat_minor": 0
565-
}
563+
}

0 commit comments

Comments
 (0)