I am new to Pytorch. Here is my problem,  I train a lstm classifier
my training precision don’t increase in a tiny dataset.
the classifier seems to guess the max num of label of the dataset for all the example.
epoch 0 total_loss = 1.409505
train data precision:58/100 = 58.00%
valid data precision:92/401 = 22.94%
save model
epoch 1 total_loss = 1.146850
train data precision:58/100 = 58.00%
valid data precision:92/401 = 22.94%
epoch 2 total_loss = 1.060287
train data precision:58/100 = 58.00%
valid data precision:92/401 = 22.94%
epoch 3 total_loss = 1.019745
train data precision:58/100 = 58.00%
valid data precision:92/401 = 22.94%
epoch 4 total_loss = 0.997164
train data precision:59/100 = 59.00%
valid data precision:92/401 = 22.94%
save model
epoch 5 total_loss = 0.983069
train data precision:59/100 = 59.00%
valid data precision:92/401 = 22.94%
epoch 6 total_loss = 0.973470
train data precision:59/100 = 59.00%
valid data precision:92/401 = 22.94%
epoch 7 total_loss = 0.966532
train data precision:59/100 = 59.00%
valid data precision:92/401 = 22.94%
epoch 8 total_loss = 0.961307
train data precision:59/100 = 59.00%
valid data precision:92/401 = 22.94%
here is my code.

  
      github.com
  
  
    lonelydancer/intent/blob/master/intent.py 1
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence

train_filename = '../data/a'
#train_filename = '../data/train.data'
#train_filename = '../data/intent.data'
valid_filename = '../data/valid.data'
batch_size = 128
#batch_size = 16
input_dim = 128
hidden_dim = 64
train_model = sys.argv[1]
save_path = '../model/model.test'
epoch_num = 200



  This file has been truncated. show original