fix textcnn accuracy problem

This commit is contained in:
Yanjun Peng 2020-12-19 11:18:14 +08:00
parent 1d6b5b7c14
commit 95ac8549db
2 changed files with 1 additions and 2 deletions

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):

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):