How can i combine multi label classifier and multi class classifier into one multi task learning classifier using transfer learning?

I have successfully trained a multi label classifier and a multi class classifier, both of the classifiers are using transfer learning(resent50). However, I don't know how to modify the model part to combine this two classifiers in order to achieve the result that this architecture (the architecture of a multi task learning ) can accomplish.

muti label classifiers: there are 15 attributes(labels) in every single input

model=models.resnet50(pretrained=True)
for params in model.parameters():
  params.requires_grad=False
model.fc=nn.Sequential(
    nn.Linear(2048,15),
    nn.Sigmoid()
    )

multi class classifier: there are 10 classes in the multi class classifier

model=models.resnet101(pretrained=True)
for params in model.parameters():
    params.requires_grad=False
model.fc=nn.Linear(2048,10)



Read more here: https://stackoverflow.com/questions/64941102/how-can-i-combine-multi-label-classifier-and-multi-class-classifier-into-one-mul

Content Attribution

This content was originally published by Jacky Lin at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: