fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
17.95k stars 8.48k forks source link

Question concerning visualising convent filters #193

Open PelFritz opened 2 years ago

PelFritz commented 2 years ago

Hi @fchollet , I have a small question concerning the code in post processing of images to visualise convent filters. Somewhere in the code we scaled the image by 64 and shifted it by 128

image *= 64 image +=128

Is there a reason to choose 64 and 128 ?

MohammedHAlali commented 2 years ago

I'm assuming you're referring to Listing 9.11 on page 265, which is here:

https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter09_part03_interpreting-what-convnets-learn.ipynb

PelFritz commented 2 years ago

Hi @MohammedHAlali , yes that. This function

def deprocess_image(image):

I wish to know why we scaled by 64 and shifted by 128