-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |