I have a bit of a special situation that I hope someone can help with.
I wish to create a neural network y=f(x), where f is the network, x is input and y is output. However the network should be made in such a way that it can effectively be split in two parts.
lets say f() = g(h()). The idea is that h is the feature extracting part of the network, while g is the classifying part of the network.
I now wish to be able to call either g, h, or f on my data. However I can’t quite figure out how to do this, since each neural network seems to be able to only have 1 forward routine.
I guess one way to achieve this would be to write two separate neural networks, g and h. I take it the autograd wouldn’t have any problem with several neural networks like that. Would there be any performance hits in this approach or is there another more elegant approach?