{
  "id": 169099,
  "title": "Why normalize by 255 ?",
  "url": "/competitions/digit-recognizer/discussion/169099",
  "author_name": "Felipe Oliveira ",
  "post_date": "2020-07-22T23:53:31.590000",
  "votes": 0,
  "comment_count": 9,
  "views": null,
  "content": "<p>One of the image pre-processing techniques is standardized as example images:</p>\n\n<p>X_train = X_train / 255</p>\n\n<p>Why the value 255?</p>",
  "messages": [
    {
      "id": 940469,
      "postDate": "2020-07-23T01:08:17.860Z",
      "content": "<p>From the <a href=\"https://www.kaggle.com/c/digit-recognizer/data\">data description</a>:</p>\n\n<blockquote>\n  <p>Each image is 28 pixels in height and 28 pixels in width, for a total of 784 pixels in total. Each pixel has a single pixel-value associated with it, indicating the lightness or darkness of that pixel, with higher numbers meaning darker. This pixel-value is an integer between 0 and 255, inclusive.</p>\n</blockquote>\n\n<p>Dividing by 255 scales the pixel values to be between 0 and 1 inclusive.</p>",
      "rawMarkdown": "From the [data description](https://www.kaggle.com/c/digit-recognizer/data):\n&gt; Each image is 28 pixels in height and 28 pixels in width, for a total of 784 pixels in total. Each pixel has a single pixel-value associated with it, indicating the lightness or darkness of that pixel, with higher numbers meaning darker. This pixel-value is an integer between 0 and 255, inclusive.\n\nDividing by 255 scales the pixel values to be between 0 and 1 inclusive.",
      "votes": 5,
      "replies": [
        {
          "id": 940544,
          "postDate": "2020-07-23T02:34:10.513Z",
          "content": "<p>Thank you <a href=\"/sahidvelji\">@sahidvelji</a>! I was not understanding.</p>",
          "rawMarkdown": "Thank you @sahidvelji! I was not understanding."
        }
      ]
    },
    {
      "id": 959535,
      "postDate": "2020-08-05T17:10:16.390Z",
      "content": "<p>The pixel range of grey scale image is between 0 to 255. Normalization reduces the range between 0 to 1. This helps quicker optimization of model because of a smaller range.</p>",
      "rawMarkdown": "The pixel range of grey scale image is between 0 to 255. Normalization reduces the range between 0 to 1. This helps quicker optimization of model because of a smaller range.",
      "votes": 2
    },
    {
      "id": 956588,
      "postDate": "2020-08-03T16:03:57.397Z",
      "content": "<p>The training data consists of grey scale image, which means that the shades of grey are represented by integer  values. For example, for the given data set, 0 represents pure black and 255 represents pure white and all other integers in between represents other shades of grey.  For faster training, it is better to normalize  training data. Since the maximum value of each pixel is 255, you need to divide the whole data by 255. so that you will normalize values to 0 - 1.</p>",
      "rawMarkdown": " The training data consists of grey scale image, which means that the shades of grey are represented by integer  values. For example, for the given data set, 0 represents pure black and 255 represents pure white and all other integers in between represents other shades of grey.  For faster training, it is better to normalize  training data. Since the maximum value of each pixel is 255, you need to divide the whole data by 255. so that you will normalize values to 0 - 1.",
      "votes": 2
    },
    {
      "id": 982596,
      "postDate": "2020-08-23T14:09:05.773Z",
      "content": "<p>Normalization make optimization easy,I've explained it all in my notebook check out <br>\n<a href=\"https://www.kaggle.com/alankritamishra/learncnn\" target=\"_blank\">https://www.kaggle.com/alankritamishra/learncnn</a></p>",
      "rawMarkdown": "Normalization make optimization easy,I've explained it all in my notebook check out \nhttps://www.kaggle.com/alankritamishra/learncnn"
    },
    {
      "id": 969220,
      "postDate": "2020-08-13T14:55:33.587Z",
      "content": "<p>Dividing by 255 is pretty common practice for pixel datasets. But normally you would use something like normalize() found in the sklearn model, which achieves the same thing!</p>",
      "rawMarkdown": "Dividing by 255 is pretty common practice for pixel datasets. But normally you would use something like normalize() found in the sklearn model, which achieves the same thing!"
    },
    {
      "id": 949713,
      "postDate": "2020-07-28T20:42:32.610Z",
      "content": "<p>because a grey scale image has pixel intensity values  0-255 and its good practice to normalise all the parameters in between 0-1 so we divide all values by 255 so intensity values become in range 0-1.</p>",
      "rawMarkdown": "because a grey scale image has pixel intensity values  0-255 and its good practice to normalise all the parameters in between 0-1 so we divide all values by 255 so intensity values become in range 0-1."
    },
    {
      "id": 946212,
      "postDate": "2020-07-26T12:45:19.520Z",
      "content": "<p>Because we want all our pixels in the range 0-1. Its a part of normalizing the data. </p>",
      "rawMarkdown": "Because we want all our pixels in the range 0-1. Its a part of normalizing the data. ",
      "replies": [
        {
          "id": 946724,
          "postDate": "2020-07-26T19:11:58.320Z",
          "content": "<p>Thank you <a href=\"/muhammadasim2000\">@muhammadasim2000</a> </p>",
          "rawMarkdown": "Thank you @muhammadasim2000 "
        }
      ]
    },
    {
      "id": 940414,
      "postDate": "2020-07-22T23:53:31.590Z",
      "content": "<p>One of the image pre-processing techniques is standardized as example images:</p>\n\n<p>X_train = X_train / 255</p>\n\n<p>Why the value 255?</p>",
      "rawMarkdown": "One of the image pre-processing techniques is standardized as example images:\n\nX_train = X_train / 255\n\nWhy the value 255?"
    }
  ],
  "comments": [
    {
      "id": 940469,
      "author_name": "Sahid Velji",
      "author_url": "",
      "post_date": "2020-07-23T01:08:17.860000",
      "content": "<p>From the <a href=\"https://www.kaggle.com/c/digit-recognizer/data\">data description</a>:</p>\n\n<blockquote>\n  <p>Each image is 28 pixels in height and 28 pixels in width, for a total of 784 pixels in total. Each pixel has a single pixel-value associated with it, indicating the lightness or darkness of that pixel, with higher numbers meaning darker. This pixel-value is an integer between 0 and 255, inclusive.</p>\n</blockquote>\n\n<p>Dividing by 255 scales the pixel values to be between 0 and 1 inclusive.</p>",
      "votes": 5,
      "replies": [
        {
          "id": 940544,
          "author_name": "Felipe Oliveira ",
          "author_url": "",
          "post_date": "2020-07-23T02:34:10.513000",
          "content": "<p>Thank you <a href=\"/sahidvelji\">@sahidvelji</a>! I was not understanding.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 959535,
      "author_name": "Soumya Ranjan Nayak",
      "author_url": "",
      "post_date": "2020-08-05T17:10:16.390000",
      "content": "<p>The pixel range of grey scale image is between 0 to 255. Normalization reduces the range between 0 to 1. This helps quicker optimization of model because of a smaller range.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 956588,
      "author_name": "Akhil Johnson",
      "author_url": "",
      "post_date": "2020-08-03T16:03:57.397000",
      "content": "<p>The training data consists of grey scale image, which means that the shades of grey are represented by integer  values. For example, for the given data set, 0 represents pure black and 255 represents pure white and all other integers in between represents other shades of grey.  For faster training, it is better to normalize  training data. Since the maximum value of each pixel is 255, you need to divide the whole data by 255. so that you will normalize values to 0 - 1.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 982596,
      "author_name": "Alankrita Mishra",
      "author_url": "",
      "post_date": "2020-08-23T14:09:05.773000",
      "content": "<p>Normalization make optimization easy,I've explained it all in my notebook check out <br>\n<a href=\"https://www.kaggle.com/alankritamishra/learncnn\" target=\"_blank\">https://www.kaggle.com/alankritamishra/learncnn</a></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 969220,
      "author_name": "kaizen",
      "author_url": "",
      "post_date": "2020-08-13T14:55:33.587000",
      "content": "<p>Dividing by 255 is pretty common practice for pixel datasets. But normally you would use something like normalize() found in the sklearn model, which achieves the same thing!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 949713,
      "author_name": "Anmol Shrivastava",
      "author_url": "",
      "post_date": "2020-07-28T20:42:32.610000",
      "content": "<p>because a grey scale image has pixel intensity values  0-255 and its good practice to normalise all the parameters in between 0-1 so we divide all values by 255 so intensity values become in range 0-1.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 946212,
      "author_name": "Muhammad Asim Khaskheli",
      "author_url": "",
      "post_date": "2020-07-26T12:45:19.520000",
      "content": "<p>Because we want all our pixels in the range 0-1. Its a part of normalizing the data. </p>",
      "votes": 0,
      "replies": [
        {
          "id": 946724,
          "author_name": "Felipe Oliveira ",
          "author_url": "",
          "post_date": "2020-07-26T19:11:58.320000",
          "content": "<p>Thank you <a href=\"/muhammadasim2000\">@muhammadasim2000</a> </p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "940469": "From the [data description](https://www.kaggle.com/c/digit-recognizer/data):\n&gt; Each image is 28 pixels in height and 28 pixels in width, for a total of 784 pixels in total. Each pixel has a single pixel-value associated with it, indicating the lightness or darkness of that pixel, with higher numbers meaning darker. This pixel-value is an integer between 0 and 255, inclusive.\n\nDividing by 255 scales the pixel values to be between 0 and 1 inclusive.",
    "959535": "The pixel range of grey scale image is between 0 to 255. Normalization reduces the range between 0 to 1. This helps quicker optimization of model because of a smaller range.",
    "956588": " The training data consists of grey scale image, which means that the shades of grey are represented by integer  values. For example, for the given data set, 0 represents pure black and 255 represents pure white and all other integers in between represents other shades of grey.  For faster training, it is better to normalize  training data. Since the maximum value of each pixel is 255, you need to divide the whole data by 255. so that you will normalize values to 0 - 1.",
    "982596": "Normalization make optimization easy,I've explained it all in my notebook check out \nhttps://www.kaggle.com/alankritamishra/learncnn",
    "969220": "Dividing by 255 is pretty common practice for pixel datasets. But normally you would use something like normalize() found in the sklearn model, which achieves the same thing!",
    "949713": "because a grey scale image has pixel intensity values  0-255 and its good practice to normalise all the parameters in between 0-1 so we divide all values by 255 so intensity values become in range 0-1.",
    "946212": "Because we want all our pixels in the range 0-1. Its a part of normalizing the data. ",
    "940414": "One of the image pre-processing techniques is standardized as example images:\n\nX_train = X_train / 255\n\nWhy the value 255?"
  }
}