|
320 | 320 | "source": [ |
321 | 321 | "## Hyperparameters\n", |
322 | 322 | "\n", |
323 | | - "We will use an instance of `HParams` to inclue various hyperparameters and\n", |
| 323 | + "We will use an instance of `HParams` to include various hyperparameters and\n", |
324 | 324 | "constants used for training and evaluation. We briefly describe each of them\n", |
325 | 325 | "below:\n", |
326 | 326 | "\n", |
|
402 | 402 | "\n", |
403 | 403 | "In the input layer of our model, we will extract not just the 'words' and the\n", |
404 | 404 | "'label' features from each sample, but also corresponding neighbor features\n", |
405 | | - "based on the `hparams.num_neighbors`. Instances with fewer neighbors than\n", |
| 405 | + "based on the `hparams.num_neighbors` value. Instances with fewer neighbors than\n", |
406 | 406 | "`hparams.num_neighbors` will be assigned dummy values for those non-existent\n", |
407 | 407 | "neighbor features." |
408 | 408 | ] |
|
425 | 425 | "\n", |
426 | 426 | " Returns:\n", |
427 | 427 | " A pair whose first value is a dictionary containing relevant features\n", |
428 | | - " and whose second value contains the ground truth labels.\n", |
| 428 | + " and whose second value contains the ground truth label.\n", |
429 | 429 | " \"\"\"\n", |
430 | 430 | " # The 'words' feature is a multi-hot, bag-of-words representation of the\n", |
431 | 431 | " # original raw text. A default value is required for examples that don't\n", |
|
459 | 459 | " [1], tf.float32, default_value=tf.constant([0.0]))\n", |
460 | 460 | "\n", |
461 | 461 | " features = tf.io.parse_single_example(example_proto, feature_spec)\n", |
462 | | - "\n", |
463 | | - " labels = features.pop('label')\n", |
464 | | - " return features, labels\n", |
| 462 | + " label = features.pop('label')\n", |
| 463 | + " return features, label\n", |
465 | 464 | "\n", |
466 | 465 | "\n", |
467 | 466 | "def make_dataset(file_path, training=False):\n", |
|
0 commit comments