0
$\begingroup$

I was trying to implement SRGAN in PyTorch and I have to write a Content loss function that required me to fetch activations from intermediate layers for both the Generated Image & Original Image.
I'm using pretrained VGG-19 and according to the paper I need the ReLU activations
Can anybody guide me on how can I achieve this?

enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

You can save the activations for intermediate layers into a variable within your forward method and then return them in addition to the output value.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.