What does children mean?

Hi. I was wondering if anyone could explain about this code.
I was looking at the open source code where srgan is implented.
This FeatureExtractor is in the part of generator net.
what does the children mean in this code? any document that I could look at?

Maybe this might help!

In your specific case, this is the list of modules registered in cnn.

Thanks for the reply!! may I ask another question if not a problem??
How do I know which layer to extract? In my case, am I extracting all the layers from start to 12th layer?
Do I have to extract layers just before the last layer? need help…thanks :slight_smile :slight_smile:

I haven’t read the SRGAN paper, but I’ll do my best to explain your code (If I’m correct, your code is taken from this repo).

In a typical image-classification DCNN architecture (Alex, VGG*, DenseNet etc), it is conventional to call the Conv layers the ‘feature extractors’, and the final FC layers as the actual ‘classifier’. Your current FeatureExtractor module is simply a wrapper to extract some number the initial layers (typically this is till the last conv, but this is not the case in your repo I think).

After looking at the repo, it looks like it is only the first 12 out of the 36 children modules for a pre-trained VGG19, to obtain low-level features. These are then used to compute a ‘content’ loss within the feature space. I don’t think these are being used by the Generator / Discriminator directly since these have different architectures. I have highlighted some lines (here and here) that might help.

If this is not your repo, I’ll correct this post as needed.

1 Like