Good day,
Question as in the title, how can I add new input nodes to a pretrained model?
An example as you can see in the image below. Let’s say I have trained ModelA and I would like to add new input nodes to pretrained ModelA as in ModelB.

ask701×431 36.6 KB

Example code.
import torch

class ModelA(torch.nn.Module):
    def __init__(self):
        self.fc1 = torch.nn.Linear(4,3)
        self.fc2 = torch.nn.Linear(3,1)

    def forward(self, x):
         return self.fc2(self.fc1(x))
 
class ModelB(torch.nn.Module):
     pass
     # how do I contruct ModelB?

Thanks in advance.