Closed gdunstone closed 6 years ago
I am not in favor of letting end user changing this. Because generated model files won't be reloadable if the parameters change. If someone more advanced wants to play with these, it is possible but he will change parameters directly.
That sounds perfectly fine reasoning to me. If I did want to do it, is what I did above the correct way to do it?
Actually, there is no "correct" shape for the NN. The shape of each layer, and the global shape of the network can be almost whatever you want. The shape is to be tweaked until you get a result corresponding to what you expect.
After that I'm not experienced enough to tell you if there is a flaw in what you suggest. You should try and see what you get from it ;-)
I don't think a configuration where you can only configure the amount of conv-layers would be helpful.
Just adding conv-layers probably won't improve the model. Considering the current IMAGE_SHAPE
and as of how the conv-layers are constructed, the input for the layer x = self.conv(1024)(x)
has the shape (8, 8, 512)
and the output the shape (4, 4, 1024)
. Learning features of the size 2x2
pixel in following conv-layers probably won't do anything if not worsen the NN.
Tweaking the NN with pooling-layers or changing the strides
and kernel_size
s of the conv-layers would be the better approach here (Besides other common tweaks for NNs, like dropout, ...). But that is always trial and error.
But as @Clorr already mentioned this is something only advanced users would do and a config parameter for that would be more complex, than just changing the code.
Thanks so much for all your help, I'll have a play around with it and see how it goes.
I want to add a cli parameter for NN layers, but I don't know how to tweak that within the model plugins.
I think its here: https://github.com/deepfakes/faceswap/blob/68ef3b992674d87d0c73da9c29a4c5a0e735f04b/plugins/Model_Original.py#L48
This is my rough draft of the encoder...