I’ve run into a strange problem where I need to take an arbitrary existing pytorch model and add a 2nd output head of the same kind as the original output head then have the model.forward() produce outputs from both output heads (e.g. head1_output, head2_output = model.forward(X)).
Alternatively it would also work if there was a way to increase the output channel/feature dimension of an existing arbitrary model.
Model Agnostic Constraints:
- We cannot assume the outputs have a certain size which is consistent across inputs.
- We also can’t assume particular model architecture (e.g. transformer vs CNN, vs fully-connected model).
Any ideas?