diff --git a/Deepdream_vgg16_pytorch.ipynb b/Deepdream_vgg16_pytorch.ipynb new file mode 100644 index 0000000..0e1754e --- /dev/null +++ b/Deepdream_vgg16_pytorch.ipynb @@ -0,0 +1,70 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "pycharm": { + "name": "#%% md\n" + } + }, + "source": [ + "# Deep dream with VGG16 model" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "outputs": [], + "source": [ + "import os\n", + "import torch\n", + "import numpy as np\n", + "from matplotlib import pyplot as plt\n", + "from torch.autograd import Variable\n", + "%matplotlib inline\n", + "import torchvision\n", + "from torchvision.models import vgg16\n", + "from torchvision.transforms import transforms\n", + "from torchsummary import summary\n", + "torch.manual_seed(0)\n", + "torch.backends.cudnn.deterministic = True\n", + "torch.backends.cudnn.benchmark = False\n", + "np.random.seed(0)\n", + "\n", + "def imshow(img):\n", + " npimg = img.numpy()\n", + " plt.figure(figsize = (200,50))\n", + " plt.imshow(np.transpose(npimg, (1, 2, 0)))\n", + " plt.show()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file