{
  "id": 147411,
  "title": "tensorflow code !",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/147411",
  "author_name": "Yaheaal",
  "post_date": "2020-04-30T15:18:55.859000",
  "votes": 0,
  "comment_count": 2,
  "views": 0,
  "content": "<p><code>\ntf.data.Dataset\n        .from_tensor_slices((train_paths, train_labels))\n        .map(decode_image, num_parallel_calls=AUTO)\n        .repeat()\n        .cache()\n        .shuffle(SEED)\n        .batch(BATCH_SIZE)\n        .prefetch(AUTO)\n</code>\nI have been using this code from a while, and because I am from keras background , it was hard for me to understand it, I searched in google but i didn't find good explain for the code above .\nCan anyone explain for me the code line by line , and why do we use this line ?\nThanks :)</p>",
  "messages": [
    {
      "id": 827937,
      "postDate": "2020-04-30T16:44:43.313Z",
      "content": "<p><a href=\"/yaheaal\">@yaheaal</a> that's new tf.data format. To learn more check the docs and Check out the excellent talk by <a href=\"/spsayakpaul\">@spsayakpaul</a> here:</p>\n\n<p><a href=\"https://youtu.be/fc0_eLmxm0E\">Talk link</a>\n<a href=\"https://docs.google.com/presentation/d/1j50c2oXttYEUdrhgEs86kI5vKE1bj8O5L4YXLMbMmF4/edit#slide=id.g6fc5c43911_0_20\">Deck link</a></p>\n\n<p><a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/145959\">source</a></p>",
      "rawMarkdown": "@yaheaal that's new tf.data format. To learn more check the docs and Check out the excellent talk by @spsayakpaul here:\n\n[Talk link](https://youtu.be/fc0_eLmxm0E)\n[Deck link](https://docs.google.com/presentation/d/1j50c2oXttYEUdrhgEs86kI5vKE1bj8O5L4YXLMbMmF4/edit#slide=id.g6fc5c43911_0_20)\n\n[source](https://www.kaggle.com/c/flower-classification-with-tpus/discussion/145959)\n",
      "votes": 1,
      "replies": [
        {
          "id": 828029,
          "postDate": "2020-04-30T18:02:14.717Z",
          "content": "<p>Thanks alot :)</p>",
          "rawMarkdown": "Thanks alot :)"
        }
      ]
    },
    {
      "id": 827842,
      "postDate": "2020-04-30T15:18:55.860Z",
      "content": "<p><code>\ntf.data.Dataset\n        .from_tensor_slices((train_paths, train_labels))\n        .map(decode_image, num_parallel_calls=AUTO)\n        .repeat()\n        .cache()\n        .shuffle(SEED)\n        .batch(BATCH_SIZE)\n        .prefetch(AUTO)\n</code>\nI have been using this code from a while, and because I am from keras background , it was hard for me to understand it, I searched in google but i didn't find good explain for the code above .\nCan anyone explain for me the code line by line , and why do we use this line ?\nThanks :)</p>",
      "rawMarkdown": "```\ntf.data.Dataset\n        .from_tensor_slices((train_paths, train_labels))\n        .map(decode_image, num_parallel_calls=AUTO)\n        .repeat()\n        .cache()\n        .shuffle(SEED)\n        .batch(BATCH_SIZE)\n        .prefetch(AUTO)\n```\nI have been using this code from a while, and because I am from keras background , it was hard for me to understand it, I searched in google but i didn't find good explain for the code above .\nCan anyone explain for me the code line by line , and why do we use this line ?\nThanks :)"
    }
  ],
  "comments": [
    {
      "id": 827937,
      "author_name": "Kurian Benoy",
      "author_url": "",
      "post_date": "2020-04-30T16:44:43.313000",
      "content": "<p><a href=\"/yaheaal\">@yaheaal</a> that's new tf.data format. To learn more check the docs and Check out the excellent talk by <a href=\"/spsayakpaul\">@spsayakpaul</a> here:</p>\n\n<p><a href=\"https://youtu.be/fc0_eLmxm0E\">Talk link</a>\n<a href=\"https://docs.google.com/presentation/d/1j50c2oXttYEUdrhgEs86kI5vKE1bj8O5L4YXLMbMmF4/edit#slide=id.g6fc5c43911_0_20\">Deck link</a></p>\n\n<p><a href=\"https://www.kaggle.com/c/flower-classification-with-tpus/discussion/145959\">source</a></p>",
      "votes": 1,
      "replies": [
        {
          "id": 828029,
          "author_name": "Yaheaal",
          "author_url": "",
          "post_date": "2020-04-30T18:02:14.717000",
          "content": "<p>Thanks alot :)</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "827937": "@yaheaal that's new tf.data format. To learn more check the docs and Check out the excellent talk by @spsayakpaul here:\n\n[Talk link](https://youtu.be/fc0_eLmxm0E)\n[Deck link](https://docs.google.com/presentation/d/1j50c2oXttYEUdrhgEs86kI5vKE1bj8O5L4YXLMbMmF4/edit#slide=id.g6fc5c43911_0_20)\n\n[source](https://www.kaggle.com/c/flower-classification-with-tpus/discussion/145959)\n",
    "827842": "```\ntf.data.Dataset\n        .from_tensor_slices((train_paths, train_labels))\n        .map(decode_image, num_parallel_calls=AUTO)\n        .repeat()\n        .cache()\n        .shuffle(SEED)\n        .batch(BATCH_SIZE)\n        .prefetch(AUTO)\n```\nI have been using this code from a while, and because I am from keras background , it was hard for me to understand it, I searched in google but i didn't find good explain for the code above .\nCan anyone explain for me the code line by line , and why do we use this line ?\nThanks :)"
  }
}