Given a pre trained Network hNet001
I would like its output to be a feature for hNet002
.
How could I do that in the forward
method hNet002
?
The forward
method of hNet002
should be something like:
def forward(self, x):
y = hNet001(x)
x = self.layer1(x)
x = self.layer2(x)
x = torch.cat((x, y), 1)
x = self.layer(x)
return x
Yet I want y
to be treated as input (Namely no update or back propogation on hNet001
).
Moreover, How could I send hNet001
as a parameter to the hNet002
network?
Could I do it in the __init__
method?