python - CNN model converges very fast -
i training cnn model text dataset(domain names) of 1 million entries. model seem converge fast. gives me 94% accuracy in 1 epoch. ideas why happening?
def build_model(max_features, maxlen): """build cnn model""" model = sequential() model.add(embedding(max_features, 8, input_length=maxlen)) model.add(convolution1d(6, 4, border_mode='same')) model.add(convolution1d(4, 4, border_mode='same')) model.add(convolution1d(2, 4, border_mode='same')) model.add(flatten()) #model.add(dropout(0.2)) #model.add(dense(2,activation='sigmoid')) #model.add(dense(180,activation='sigmoid')) #model.add(dropout(0.2)) model.add(dense(2,activation='softmax')) return model
output during first 3 epochs:
950000/950000 [==============================] - 232s - loss: 0.1764 - categorical_accuracy: 0.9356 - fmeasure: 0.9356 - precision: 0.9356 - recall: 0.9356 - val_loss: 0.1579 - val_categorical_accuracy: 0.9418 - val_fmeasure: 0.9418 - val_precision: 0.9418 - val_recall: 0.9418 epoch 2/3 950000/950000 [==============================] - 232s - loss: 0.1567 - categorical_accuracy: 0.9450 - fmeasure: 0.9450 - precision: 0.9450 - recall: 0.9450 - val_loss: 0.1518 - val_categorical_accuracy: 0.9489 - val_fmeasure: 0.9489 - val_precision: 0.9489 - val_recall: 0.9489 epoch 3/3 950000/950000 [==============================] - 232s - loss: 0.1515 - categorical_accuracy: 0.9474 - fmeasure: 0.9474 - precision: 0.9474 - recall: 0.9474 - val_loss: 0.1474 - val_categorical_accuracy: 0.9472 - val_fmeasure: 0.9472 - val_precision: 0.9472 - val_recall: 0.9472 3392/3801 [=========================>....] - eta: 0s[0.15151389103144666, 0.94817153352462946, 0.94817148384625149, 0.94817153391666209, 0.94817153391666209]
wiki
Comments
Post a Comment