forked from mindspore-Ecosystem/mindspore
fix textcnn accuracy problem
This commit is contained in:
parent
1d6b5b7c14
commit
95ac8549db
|
@ -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):
|
||||
|
|
|
@ -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…
Reference in New Issue