{
  "id": 98300,
  "title": "Tried my hand on fastai wgan have a look",
  "url": "/competitions/generative-dog-images/discussion/98300",
  "author_name": "",
  "post_date": "2019-07-02T18:51:12.034721400Z",
  "votes": 1,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Tried hand on fastai wgan , and after 50 epoch it has now emerged perfectly as some weird abstract horror something.. Have a look at it .\nI dont yet know how to convert this output and save as images , So feel free to copy, fork and add that part for submission . But keep the kernel public . LoL.</p>\n\n<p><a href=\"https://www.kaggle.com/phoenix9032/fastai-wgan-for-dog-image-generation\">https://www.kaggle.com/phoenix9032/fastai-wgan-for-dog-image-generation</a></p>",
  "messages": [
    {
      "id": "566903",
      "postDate": "07/02/2019 18:51:12",
      "content": "<p>Tried hand on fastai wgan , and after 50 epoch it has now emerged perfectly as some weird abstract horror something.. Have a look at it .\nI dont yet know how to convert this output and save as images , So feel free to copy, fork and add that part for submission . But keep the kernel public . LoL.</p>\n\n<p><a href=\"https://www.kaggle.com/phoenix9032/fastai-wgan-for-dog-image-generation\">https://www.kaggle.com/phoenix9032/fastai-wgan-for-dog-image-generation</a></p>",
      "rawMarkdown": "Tried hand on fastai wgan , and after 50 epoch it has now emerged perfectly as some weird abstract horror something.. Have a look at it .\nI dont yet know how to convert this output and save as images , So feel free to copy, fork and add that part for submission . But keep the kernel public . LoL.\n\n[https://www.kaggle.com/phoenix9032/fastai-wgan-for-dog-image-generation](https://www.kaggle.com/phoenix9032/fastai-wgan-for-dog-image-generation)",
      "votes": null
    },
    {
      "id": "567007",
      "postDate": "07/02/2019 23:17:26",
      "content": "<p>That's a good start. The scenes look like nature landscapes. Now you just need the dogs to show up :-)</p>",
      "rawMarkdown": "That's a good start. The scenes look like nature landscapes. Now you just need the dogs to show up :-)",
      "votes": null
    },
    {
      "id": "567046",
      "postDate": "07/03/2019 01:56:09",
      "content": "<p>Lol Yes ...May be something else will show up  :D </p>",
      "rawMarkdown": "Lol Yes ...May be something else will show up  :D",
      "votes": null
    },
    {
      "id": "567206",
      "postDate": "07/03/2019 07:09:04",
      "content": "<p>I am experimenting with it too. I got some mediocre results the first time I ran it for 30 epoch with all default settings. There were some brown dogish-looking things on some of the generated images. And lots of green blobs. Though I haven't tried to save these images yet. \nI believe 'n_extra_layers=1' should be higher for this task. I am trying 3 to 6 extra layers for now. 3 was pretty stable for me so far, 6 didn't worked out.</p>",
      "rawMarkdown": "I am experimenting with it too. I got some mediocre results the first time I ran it for 30 epoch with all default settings. There were some brown dogish-looking things on some of the generated images. And lots of green blobs. Though I haven't tried to save these images yet. \nI believe 'n_extra_layers=1' should be higher for this task. I am trying 3 to 6 extra layers for now. 3 was pretty stable for me so far, 6 didn't worked out.",
      "votes": null
    },
    {
      "id": "567240",
      "postDate": "07/03/2019 08:16:59",
      "content": "<p>Thanks a ton for the insight . I am very new to this whole concept itself . So trying to learn as i go. I tried to increase the next layers , but it gave me some error in the dimensions . I need to seriously look into it now .  I am getting varying result for different learning rate and different transformations as well .  Best of luck to us !\nI tried to figure out now some option as to how to create and save the images . Looks like learner.get_prediction works here as well to get target images generated . Ofcourse we need to transpose it afterwords. However , I am not sure if I need to process the images further after the prediction . Have to look into that . </p>",
      "rawMarkdown": "Thanks a ton for the insight . I am very new to this whole concept itself . So trying to learn as i go. I tried to increase the next layers , but it gave me some error in the dimensions . I need to seriously look into it now .  I am getting varying result for different learning rate and different transformations as well .  Best of luck to us !\nI tried to figure out now some option as to how to create and save the images . Looks like learner.get_prediction works here as well to get target images generated . Ofcourse we need to transpose it afterwords. However , I am not sure if I need to process the images further after the prediction . Have to look into that .",
      "votes": null
    },
    {
      "id": "567254",
      "postDate": "07/03/2019 08:43:09",
      "content": "<p>You can call generator directly to get images. The code from official starter kernel works just fine, you just need to replace a line or two:</p>\n\n<p>```python\nfor i_batch in range(0, n_images, im_batch_size):\n    gen_z = torch.randn(im_batch_size, 100, 1, 1, device=device)\n    gen_images = generator(gen_z)\n    images = gen_images.to(\"cpu\").clone().detach()\n    images = images.numpy().transpose(0, 2, 3, 1)</p>\n\n<pre><code>for i_image in range(gen_images.size(0)):\n    save_image(gen_images[i_image, :, :, :], os.path.join(OUT_DIR, f'image_{i_batch+i_image:05d}.png'))\n</code></pre>\n\n<p>```</p>",
      "rawMarkdown": "You can call generator directly to get images. The code from official starter kernel works just fine, you just need to replace a line or two:\n\n```python\nfor i_batch in range(0, n_images, im_batch_size):\n    gen_z = torch.randn(im_batch_size, 100, 1, 1, device=device)\n    gen_images = generator(gen_z)\n    images = gen_images.to(\"cpu\").clone().detach()\n    images = images.numpy().transpose(0, 2, 3, 1)\n    \n    for i_image in range(gen_images.size(0)):\n        save_image(gen_images[i_image, :, :, :], os.path.join(OUT_DIR, f'image_{i_batch+i_image:05d}.png'))\n```",
      "votes": null
    },
    {
      "id": "567331",
      "postDate": "07/03/2019 11:03:14",
      "content": "<p>I might be wrong about the number of extra layers. The basic_generator and basic_critic functions already know how many layers need to be added according to the size of the output image.</p>",
      "rawMarkdown": "I might be wrong about the number of extra layers. The basic_generator and basic_critic functions already know how many layers need to be added according to the size of the output image.",
      "votes": null
    },
    {
      "id": "567425",
      "postDate": "07/03/2019 13:54:58",
      "content": "<p>I thought so , it was giving error based on the noise and size that i selected .. So i thought there need to be tweaking and its not as simple .</p>",
      "rawMarkdown": "I thought so , it was giving error based on the noise and size that i selected .. So i thought there need to be tweaking and its not as simple .",
      "votes": null
    },
    {
      "id": "568629",
      "postDate": "07/05/2019 08:42:41",
      "content": "<p>I played a bit with the fast.ai WGAN implementation and decided to drop it. \nFrom what I understand, WGANs are kinda slow and I was able to achieve much better results using public scripts in less time. And they are easier to customize. But some parts of fast.ai library might be usefull though..</p>",
      "rawMarkdown": "I played a bit with the fast.ai WGAN implementation and decided to drop it. \nFrom what I understand, WGANs are kinda slow and I was able to achieve much better results using public scripts in less time. And they are easier to customize. But some parts of fast.ai library might be usefull though..",
      "votes": null
    },
    {
      "id": "568718",
      "postDate": "07/05/2019 10:20:42",
      "content": "<p>Well we both are on the same boat :) .I would take the scenic images and move towards DCGAN or so . May be torch implementation of WGAN-GP is another one in future I want to try .</p>",
      "rawMarkdown": "Well we both are on the same boat :) .I would take the scenic images and move towards DCGAN or so . May be torch implementation of WGAN-GP is another one in future I want to try .",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 567007,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "07/02/2019 23:17:26",
      "content": "<p>That's a good start. The scenes look like nature landscapes. Now you just need the dogs to show up :-)</p>",
      "votes": null,
      "replies": [
        {
          "id": 567046,
          "author_name": "phoenix9032",
          "author_url": "",
          "post_date": "07/03/2019 01:56:09",
          "content": "<p>Lol Yes ...May be something else will show up  :D </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 567206,
      "author_name": "dvorobiev",
      "author_url": "",
      "post_date": "07/03/2019 07:09:04",
      "content": "<p>I am experimenting with it too. I got some mediocre results the first time I ran it for 30 epoch with all default settings. There were some brown dogish-looking things on some of the generated images. And lots of green blobs. Though I haven't tried to save these images yet. \nI believe 'n_extra_layers=1' should be higher for this task. I am trying 3 to 6 extra layers for now. 3 was pretty stable for me so far, 6 didn't worked out.</p>",
      "votes": null,
      "replies": [
        {
          "id": 567240,
          "author_name": "phoenix9032",
          "author_url": "",
          "post_date": "07/03/2019 08:16:59",
          "content": "<p>Thanks a ton for the insight . I am very new to this whole concept itself . So trying to learn as i go. I tried to increase the next layers , but it gave me some error in the dimensions . I need to seriously look into it now .  I am getting varying result for different learning rate and different transformations as well .  Best of luck to us !\nI tried to figure out now some option as to how to create and save the images . Looks like learner.get_prediction works here as well to get target images generated . Ofcourse we need to transpose it afterwords. However , I am not sure if I need to process the images further after the prediction . Have to look into that . </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 567254,
          "author_name": "dvorobiev",
          "author_url": "",
          "post_date": "07/03/2019 08:43:09",
          "content": "<p>You can call generator directly to get images. The code from official starter kernel works just fine, you just need to replace a line or two:</p>\n\n<p>```python\nfor i_batch in range(0, n_images, im_batch_size):\n    gen_z = torch.randn(im_batch_size, 100, 1, 1, device=device)\n    gen_images = generator(gen_z)\n    images = gen_images.to(\"cpu\").clone().detach()\n    images = images.numpy().transpose(0, 2, 3, 1)</p>\n\n<pre><code>for i_image in range(gen_images.size(0)):\n    save_image(gen_images[i_image, :, :, :], os.path.join(OUT_DIR, f'image_{i_batch+i_image:05d}.png'))\n</code></pre>\n\n<p>```</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 567331,
          "author_name": "dvorobiev",
          "author_url": "",
          "post_date": "07/03/2019 11:03:14",
          "content": "<p>I might be wrong about the number of extra layers. The basic_generator and basic_critic functions already know how many layers need to be added according to the size of the output image.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 567425,
          "author_name": "phoenix9032",
          "author_url": "",
          "post_date": "07/03/2019 13:54:58",
          "content": "<p>I thought so , it was giving error based on the noise and size that i selected .. So i thought there need to be tweaking and its not as simple .</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 568629,
          "author_name": "dvorobiev",
          "author_url": "",
          "post_date": "07/05/2019 08:42:41",
          "content": "<p>I played a bit with the fast.ai WGAN implementation and decided to drop it. \nFrom what I understand, WGANs are kinda slow and I was able to achieve much better results using public scripts in less time. And they are easier to customize. But some parts of fast.ai library might be usefull though..</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 568718,
          "author_name": "phoenix9032",
          "author_url": "",
          "post_date": "07/05/2019 10:20:42",
          "content": "<p>Well we both are on the same boat :) .I would take the scenic images and move towards DCGAN or so . May be torch implementation of WGAN-GP is another one in future I want to try .</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "566903": "Tried hand on fastai wgan , and after 50 epoch it has now emerged perfectly as some weird abstract horror something.. Have a look at it .\nI dont yet know how to convert this output and save as images , So feel free to copy, fork and add that part for submission . But keep the kernel public . LoL.\n\n[https://www.kaggle.com/phoenix9032/fastai-wgan-for-dog-image-generation](https://www.kaggle.com/phoenix9032/fastai-wgan-for-dog-image-generation)",
    "567007": "That's a good start. The scenes look like nature landscapes. Now you just need the dogs to show up :-)",
    "567046": "Lol Yes ...May be something else will show up  :D",
    "567206": "I am experimenting with it too. I got some mediocre results the first time I ran it for 30 epoch with all default settings. There were some brown dogish-looking things on some of the generated images. And lots of green blobs. Though I haven't tried to save these images yet. \nI believe 'n_extra_layers=1' should be higher for this task. I am trying 3 to 6 extra layers for now. 3 was pretty stable for me so far, 6 didn't worked out.",
    "567240": "Thanks a ton for the insight . I am very new to this whole concept itself . So trying to learn as i go. I tried to increase the next layers , but it gave me some error in the dimensions . I need to seriously look into it now .  I am getting varying result for different learning rate and different transformations as well .  Best of luck to us !\nI tried to figure out now some option as to how to create and save the images . Looks like learner.get_prediction works here as well to get target images generated . Ofcourse we need to transpose it afterwords. However , I am not sure if I need to process the images further after the prediction . Have to look into that .",
    "567254": "You can call generator directly to get images. The code from official starter kernel works just fine, you just need to replace a line or two:\n\n```python\nfor i_batch in range(0, n_images, im_batch_size):\n    gen_z = torch.randn(im_batch_size, 100, 1, 1, device=device)\n    gen_images = generator(gen_z)\n    images = gen_images.to(\"cpu\").clone().detach()\n    images = images.numpy().transpose(0, 2, 3, 1)\n    \n    for i_image in range(gen_images.size(0)):\n        save_image(gen_images[i_image, :, :, :], os.path.join(OUT_DIR, f'image_{i_batch+i_image:05d}.png'))\n```",
    "567331": "I might be wrong about the number of extra layers. The basic_generator and basic_critic functions already know how many layers need to be added according to the size of the output image.",
    "567425": "I thought so , it was giving error based on the noise and size that i selected .. So i thought there need to be tweaking and its not as simple .",
    "568629": "I played a bit with the fast.ai WGAN implementation and decided to drop it. \nFrom what I understand, WGANs are kinda slow and I was able to achieve much better results using public scripts in less time. And they are easier to customize. But some parts of fast.ai library might be usefull though..",
    "568718": "Well we both are on the same boat :) .I would take the scenic images and move towards DCGAN or so . May be torch implementation of WGAN-GP is another one in future I want to try ."
  },
  "source": "meta"
}