HI, all,
I am working on a multi-task learning project.
I need to tuning hyperparameters in MTL model. I have try Gridserchcv in sk-learn. it cannot work.
how do I  optimize hyperparameters?
class MTLnet(nn.Module):
def __init__(self):
    super(MTLnet, self).__init__()
    self.sharedlayer = nn.Sequential(
        nn.Linear(feature_size, shared_layer_size),
        nn.ReLU(),
        nn.Dropout()
    )
    self.tower1 = nn.Sequential(
        nn.Linear(shared_layer_size, tower_h1),
        nn.ReLU(),
        nn.Dropout(),
        nn.Linear(tower_h1, tower_h2),
        nn.ReLU(),
        nn.Dropout(),
        nn.Linear(tower_h2, output_size)
    )
    self.tower2 = nn.Sequential(
        nn.Linear(shared_layer_size, tower_h1),
        nn.ReLU(),
        nn.Dropout(),
        nn.Linear(tower_h1, tower_h2),
        nn.ReLU(),
        nn.Dropout(),
        nn.Linear(tower_h2, output_size)
    )    

def forward(self, x1,x2):
    out1 = self.tower1(x1)
    out2 = self.tower2(x2)
    return out1, out2

Thank you!