The process of training map is as follows :

 

Training results :

Training loss Very low , And the accuracy rate is already very high , But on the validation set ,loss Relatively high , And the accuracy is very low , It's not stable .

 

Causes :

Put the data sets of each category together , And the data tags are also very centralized
model.fit(train_data, train_label, batch_size = 32, epochs = 100,
validation_split = 0.2, shuffle = True)
stay module Of fit Function , Although there are shuffle , But it doesn't feel right , So we still need to scramble the data in advance .

 

resolvent :

Scrambling data , But pay attention , In the middle of chaos , Make sure you mess up the labels , Ensure that the scrambled data and tags are one-to-one correspondence Of .
np.random.seed(200) np.random.shuffle(train_data) np.random.seed(200)
np.random.shuffle(train_label) np.random.seed(200) np.random.shuffle(test_data)
np.random.seed(200) np.random.shuffle(test_label)
Solution results :

theory shuffle The importance of !!!

 

Technology