Browse Source

fix textcnn accuracy problem

tags/v1.1.0
Yanjun Peng 5 years ago
parent
commit
95ac8549db
2 changed files with 1 additions and 2 deletions
  1. +0
    -1
      model_zoo/official/nlp/textcnn/src/dataset.py
  2. +1
    -1
      model_zoo/official/nlp/textcnn/src/textcnn.py

+ 0
- 1
model_zoo/official/nlp/textcnn/src/dataset.py View File

@@ -202,7 +202,6 @@ class MovieReview:
dataset = ds.GeneratorDataset(source=Generator(input_list=self.train),
column_names=["data", "label"], shuffle=False)
dataset = dataset.batch(batch_size=batch_size, drop_remainder=True)
dataset = dataset.repeat(epoch_size)
return dataset

def create_test_dataset(self, batch_size):


+ 1
- 1
model_zoo/official/nlp/textcnn/src/textcnn.py View File

@@ -90,7 +90,7 @@ class SoftmaxCrossEntropyExpand(Cell):

def make_conv_layer(kernel_size):
return nn.Conv2d(in_channels=1, out_channels=96, kernel_size=kernel_size, padding=1,
pad_mode="pad", weight_init='uniform', has_bias=True)
pad_mode="pad", has_bias=True)


class TextCNN(nn.Cell):


Loading…
Cancel
Save