leongatys / DeepTextures

Code to synthesise textures using convolutional neural networks as described in Gatys et al. 2015 (http://arxiv.org/abs/1505.07376)
273 stars 82 forks source link

Activations Issue #4

Closed noshaba closed 8 years ago

noshaba commented 8 years ago

Hi Leon!

I wanted to try your other Loss Function, so I changed

for l,layer in enumerate(tex_layers):
     constraints[layer] = constraint([LossFunctions.gram_mse_loss],
                                    [{'target_gram_matrix': 
                                      gram_matrix(net.blobs[layer].data),
                                     'weight': tex_weights[l]}])

to

for l,layer in enumerate(tex_layers):
     constraints[layer] = constraint([LossFunctions.meanfm_mse_loss],
                                    [{'target_activations': net.blobs[layer].data,
                                     'weight': tex_weights[l]}])

but then I get as a loss in my first Iteration 0 and the activations are always equal to the target activations.

noshaba commented 8 years ago

Oh found the problem... I had to use net.blobs[layer].data.copy() instead of net.blobs[layer].data... :)