From 346eac247e49f2ca2084616875fafe1e22c46a43 Mon Sep 17 00:00:00 2001 From: "Alex J. Champandard" Date: Sun, 24 Apr 2016 16:49:00 +0200 Subject: [PATCH] Runs to completion, good results but slightly different as before. --- doodle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doodle.py b/doodle.py index a360304..dda2cba 100755 --- a/doodle.py +++ b/doodle.py @@ -71,7 +71,7 @@ def error(message, *lines): # Load the underlying deep learning libraries based on the device specified. If you specify THEANO_FLAGS manually, # the code assumes you know what you are doing and they are not overriden! os.environ.setdefault('THEANO_FLAGS', 'floatX=float32,device={},force_device=True,'\ - 'print_active_device=False'.format(args.device)) + 'print_active_device=False,optimizer=fast_compile'.format(args.device)) # Scientific Libraries import numpy as np @@ -373,12 +373,12 @@ def do_match_patches(self, layer): dist = self.matcher_outputs[layer] dist = dist.reshape((dist.shape[1], -1)) - offset = self.matcher_history[layer] + offset = self.matcher_history[layer].reshape((-1, 1)) scores = (dist - offset * args.variety) matches = scores.argmax(axis=0) # Pick the best style patches for each patch in the current image, the result is an array of indices. - return [dist.argmax(axis=0), scores.max(axis=0), dist.max(axis=1)] + return [matches, scores.max(axis=0), dist.max(axis=1)] #------------------------------------------------------------------------------------------------------------------