{
  "id": 71747,
  "title": "Is there anyone can help me(keras beginner)?",
  "url": "/competitions/quickdraw-doodle-recognition/discussion/71747",
  "author_name": "upup",
  "post_date": "2018-11-16T07:04:39.717000",
  "votes": 0,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I'm confused about <code>model = MobileNet(input_shape=(size, size, 1), alpha=1., weights=None, classes=NCATS)</code> in the helpful <a href=\"https://www.kaggle.com/gaborfodor/greyscale-mobilenet-lb-0-892/notebook\">kernel created by beluga</a>, because the <a href=\"https://keras.io/applications/#mobilenet\">keras docs</a> say    </p>\n\n<blockquote>\n  <p><code>input_shape</code>: optional shape tuple, only to be specified if <code>include_top</code> is False (otherwise the <code>input_shape</code> has to be (224, 224, 3) (with 'channelslast' data format) or (3, 224, 224) (with 'channelsfirst' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 32. E.g. (200, 200, 3) would be one valid value.</p>\n</blockquote>\n\n<p>Why can this kernel specify the <code>input_shape</code> and <code>include_top=True</code>(default) simultaneously and run without any error？ <br>\n(btw, how to @ someone ?)</p>",
  "messages": [
    {
      "id": 424257,
      "postDate": "2018-11-19T20:02:40.603Z",
      "content": "<ul>\n<li>When you give <code>weights=None</code>,  keras is not loading any weights, so the network need not be fixed by the weight matrix.</li>\n<li>It is just returning the architecture/network, and the input layer <code>input_shape=(size, size, 1)</code> becomes customisable .because Mobilenet/Resnet are CNNs, containing weight matrices which can be multiplied over images of any size.</li>\n<li><code>classes=NCATS</code> can also be variable since output layer of <strong>340 Linear Layer</strong> is created on-the-go, by keras </li>\n<li>In recent architectures, <code>GlobalAveragePooling/AdaptiveAveragePooling</code> is used so any number of conv layers are converted to FC layer.</li>\n</ul>",
      "rawMarkdown": "+ When you give `weights=None`,  keras is not loading any weights, so the network need not be fixed by the weight matrix.\n+ It is just returning the architecture/network, and the input layer `input_shape=(size, size, 1)` becomes customisable .because Mobilenet/Resnet are CNNs, containing weight matrices which can be multiplied over images of any size.\n+ `classes=NCATS` can also be variable since output layer of **340 Linear Layer** is created on-the-go, by keras \n+ In recent architectures, `GlobalAveragePooling/AdaptiveAveragePooling` is used so any number of conv layers are converted to FC layer.",
      "votes": 1
    },
    {
      "id": 422400,
      "postDate": "2018-11-16T07:09:14.290Z",
      "content": "<p>Because its not trying to load pre-trained weights (weights=None) so you are free to do whatever you want with the architecture.</p>",
      "rawMarkdown": "Because its not trying to load pre-trained weights (weights=None) so you are free to do whatever you want with the architecture.",
      "votes": 2
    },
    {
      "id": 422398,
      "postDate": "2018-11-16T07:04:39.717Z",
      "content": "<p>I'm confused about <code>model = MobileNet(input_shape=(size, size, 1), alpha=1., weights=None, classes=NCATS)</code> in the helpful <a href=\"https://www.kaggle.com/gaborfodor/greyscale-mobilenet-lb-0-892/notebook\">kernel created by beluga</a>, because the <a href=\"https://keras.io/applications/#mobilenet\">keras docs</a> say    </p>\n\n<blockquote>\n  <p><code>input_shape</code>: optional shape tuple, only to be specified if <code>include_top</code> is False (otherwise the <code>input_shape</code> has to be (224, 224, 3) (with 'channelslast' data format) or (3, 224, 224) (with 'channelsfirst' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 32. E.g. (200, 200, 3) would be one valid value.</p>\n</blockquote>\n\n<p>Why can this kernel specify the <code>input_shape</code> and <code>include_top=True</code>(default) simultaneously and run without any error？ <br>\n(btw, how to @ someone ?)</p>",
      "rawMarkdown": "I'm confused about `model = MobileNet(input_shape=(size, size, 1), alpha=1., weights=None, classes=NCATS)` in the helpful [kernel created by beluga](https://www.kaggle.com/gaborfodor/greyscale-mobilenet-lb-0-892/notebook), because the [keras docs](https://keras.io/applications/#mobilenet) say    \n&gt; `input_shape`: optional shape tuple, only to be specified if `include_top` is False (otherwise the `input_shape` has to be (224, 224, 3) (with 'channelslast' data format) or (3, 224, 224) (with 'channelsfirst' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 32. E.g. (200, 200, 3) would be one valid value.\n\nWhy can this kernel specify the `input_shape` and `include_top=True`(default) simultaneously and run without any error？   \n(btw, how to @ someone ?)"
    }
  ],
  "comments": [
    {
      "id": 424257,
      "author_name": "remidi",
      "author_url": "",
      "post_date": "2018-11-19T20:02:40.603000",
      "content": "<ul>\n<li>When you give <code>weights=None</code>,  keras is not loading any weights, so the network need not be fixed by the weight matrix.</li>\n<li>It is just returning the architecture/network, and the input layer <code>input_shape=(size, size, 1)</code> becomes customisable .because Mobilenet/Resnet are CNNs, containing weight matrices which can be multiplied over images of any size.</li>\n<li><code>classes=NCATS</code> can also be variable since output layer of <strong>340 Linear Layer</strong> is created on-the-go, by keras </li>\n<li>In recent architectures, <code>GlobalAveragePooling/AdaptiveAveragePooling</code> is used so any number of conv layers are converted to FC layer.</li>\n</ul>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 422400,
      "author_name": "CVxTz",
      "author_url": "",
      "post_date": "2018-11-16T07:09:14.290000",
      "content": "<p>Because its not trying to load pre-trained weights (weights=None) so you are free to do whatever you want with the architecture.</p>",
      "votes": 2,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "424257": "+ When you give `weights=None`,  keras is not loading any weights, so the network need not be fixed by the weight matrix.\n+ It is just returning the architecture/network, and the input layer `input_shape=(size, size, 1)` becomes customisable .because Mobilenet/Resnet are CNNs, containing weight matrices which can be multiplied over images of any size.\n+ `classes=NCATS` can also be variable since output layer of **340 Linear Layer** is created on-the-go, by keras \n+ In recent architectures, `GlobalAveragePooling/AdaptiveAveragePooling` is used so any number of conv layers are converted to FC layer.",
    "422400": "Because its not trying to load pre-trained weights (weights=None) so you are free to do whatever you want with the architecture.",
    "422398": "I'm confused about `model = MobileNet(input_shape=(size, size, 1), alpha=1., weights=None, classes=NCATS)` in the helpful [kernel created by beluga](https://www.kaggle.com/gaborfodor/greyscale-mobilenet-lb-0-892/notebook), because the [keras docs](https://keras.io/applications/#mobilenet) say    \n&gt; `input_shape`: optional shape tuple, only to be specified if `include_top` is False (otherwise the `input_shape` has to be (224, 224, 3) (with 'channelslast' data format) or (3, 224, 224) (with 'channelsfirst' data format). It should have exactly 3 inputs channels, and width and height should be no smaller than 32. E.g. (200, 200, 3) would be one valid value.\n\nWhy can this kernel specify the `input_shape` and `include_top=True`(default) simultaneously and run without any error？   \n(btw, how to @ someone ?)"
  }
}