Fork I’ve just published a repository (https://github.com/giuseppebonaccorso/keras_deepdream) with a Jupyter notebook containing a Deepdream (https://github.com/google/deepdream) experiment created with Keras and a pre-trained VGG19 convolutional network. The experiment (which is a work in progress) is based on some suggestions provided by the Deepdream team in this blog post but works in a slightly different way. I use a Gaussian Pyramid and average the rescaled results of a layer with the next one. A total variation loss could be employed too, but after some experiments, I’ve preferred to remove it because of its blur effect. Some examples obtained with different settings in terms of layers and number of iterations: It’s possible to create amazing videos by zooming into the same image. This in an example created with 1500 frames: Deepdream animation with Keras and VGG19 This video has been created using the notebook https://github.com/giuseppebonaccorso/keras_deepdream which is a Deepdream experiment based on some suggestions provided […]
Fork I’ve just moved my Keras-based Neural Artistic Style Transfer GIST to a dedicated repository: https://github.com/giuseppebonaccorso/Neural_Artistic_Style_Transfer. Please refer always to it because the GIST is not more maintained. See also: Neural artistic style transfer experiments with Keras – Giuseppe Bonaccorso Artistic style transfer using neural networks is a technique proposed by Gatys, Ecker and Bethge in the paper: arXiv:1508.06576 [cs.CV] which exploits a trained convolutional network in order to reconstruct the elements of a picture adopting the artistic style of a particular painting.
In this benchmark, I’ve used a Windows 10 Pro 64 Bit computer with Intel Core i7 6700HQ 2.60 GHz with 32 Gb RAM and NVIDIA GeForce GTX 960M. As a programming environment, I’ve used Python 2.7 (Anaconda distribution) and Jupyter. The task is very simple, integrating this expression (simple but effective): The code I’ve written is this (without matplotlib functions and float32 numbers, in order to use the GPU): import math from datetime import datetime import numpy as np import matplotlib.pyplot as plt import theano import theano.tensor as T from theano import function, shared # Define constants a = 0 b = math.pi precision = 10000000.0 delta = ((b-a) / precision) # Define x linear space xs = np.linspace(a, b, num=precision).astype(np.float32) # Define Theano function xss = shared(xs, ‘xss’) deltas = shared(delta, ‘delta’) sinvx = T.sum(T.sin(xss) * deltas) sf = function(, sinvx) # Number of iterations num_executions = 500 execution_times = […]