log0 / neural-style-painting

Implementing of the "A Neural Algorithm of Artistic Style"
236 stars 100 forks source link

Doubt in Content/Style Loss Functions #11

Open ShivamDuggal4 opened 6 years ago

ShivamDuggal4 commented 6 years ago

Hi, I have . a doubt regarding the loss functions. How is the current value of the genearted image(by current, I mean the updated Variable) compared with the actual content/style image.

def content_loss_func(sess, model):
return _content_loss(sess.run(model['conv4_2']), model['conv4_2'])

In this function, sess.run(model['conv4_2']) is basically sess.run(model['conv4_2'],feed_dict={input_image = content_image})

Shouldn't the second parameter be sess.run(model['conv4_2'],feed_dict={input_image = generated_image})

How does just running model['conv4_2'] pick up the latest value of the tensor ' conv4_2' with input as generated image

Same with the style loss function.