I’m trying to make model which will classify text into about 500 different classes. I think that I have to customize architecture of the Pooling Classifier which looks now like this:

(1): PoolingLinearClassifier(
(layers): Sequential(
   (0): BatchNorm1d(1200, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
   (1): Dropout(p=0.2, inplace=False)
   (2): Linear(in_features=1200, out_features=50, bias=True)
   (3): ReLU(inplace=True)
   (4): BatchNorm1d(50, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
   (5): Dropout(p=0.1, inplace=False)
   (6): Linear(in_features=50, out_features=498, bias=True)

I think that I have to change in (2): Linear layer to have more out_features because in the last (6) Linear layer I predict more out_features than I’ve got in_features. What do you think?

Best regards


Try pooling in between, that will reduce size so that its compactible. Have a look here

  • 1
    $\begingroup$ But is it wrong that in last linear layer I want to predict 498 classes from only 50 "in_features", isn't it? $\endgroup$
    – maliniaki
    Mar 11 '20 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.