sar-gupta / deep-dream-pytorch

Pytorch implementation of DeepDream on VGG16 Network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deep-dream-pytorch

Pytorch implementation of DeepDream on VGG16 Network

Understanding the code

The code consists of mainly two functions:

  1. deep_dream_vgg : This is a recursive function. It is used to create octaves, and to merge (or blend) the image generated by a recursive call with the image at one (recursive) level higher.

  2. dd_helper : This is the actual code for deep dream. The gradients at a particular layer are set equal to the activation of that layer. This results in the maximization of the activations at that particular layer. In other words, we are enhancing the features detected by a layer. Gradient ascent is applied to the input images (i.e. octaves).

Requirements

  • pytorch
  • torchvision
  • PIL
  • numpy
  • matplotlib

Note : In case you don't have a GPU, remove all instances of .cuda() from the code.

Running locally

  • Clone this repository
  • Change into this directory cd deep-dream-pytorch
  • Run a jupyter notebook

References

  1. https://research.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html
  2. https://www.youtube.com/watch?v=ws-ZbiFV1Ms
  3. https://github.com/google/deepdream

About

Pytorch implementation of DeepDream on VGG16 Network

License:MIT License


Languages

Language:Jupyter Notebook 100.0%