简体   繁体   中英

Is my neural network suffering from overfitting or underfitting?

I am trying to construct a multi-class neural network that predicts rock paper or scissors as accurately as possible from a data set I created.

As I messed around with various parameters, the training set's loss/accuracy seems to vary widely. However, after a lot of trial and error, this seems to be the best model version. I have looked over other questions relating to mine and I think these graphs seems appropriate, but being as I am a new to machine learning, I am wondering the model is suffering from some issue (over fitting/under fitting) that I am just not seeing.

I understand overfitting refers to the case where as epochs increase, accuracy goes up and the loss goes down, but I am still unsure if there is something obvious on the graph that is escaping my understanding.

This is how I'm currently compiling and fitting the model.

model.compile(loss=['categorical_crossentropy'], optimizer=Adam(.01), metrics=['accuracy'])

history = model.fit(X_train,y_train, epochs=30, verbose=True, validation_split=.33, batch_size=3)

Model Accuracy

Model Loss

Edit:

The model should predict either rock paper or scissors based upon previously decided coefficients being multiplied against 9 features. 5 features being randomly created coefficients representing the Big 5 Personality Dimensions ranging as continuous values from -2 to 2.

The other four are:

  1. If they won or lost.

2, 3, 4) If they won choosing rock, paper, or scissors: and each of those three being multiplied against a coefficient that acts as the bias toward them winning.

The probability of choosing rock paper or scissors have an activation built in that gives a bias toward the respective choice. Scissors has the highest bias.

There are 999 trials (excluded the first since its due to random chance) and each of the 100 trial values, for the Big 5 Personality dimension, remain the same. Only the columns representing Won/Lost and won choosing rock, paper, or scissors change trial by trial.

From the loss and accuracy curve, it does seem like you've fitted your model to the training data very precisely (a sign of overfitting). If you're worried about the overfitting issue then you may adopt some regularization methods like L1/L2 regularizer (weight decay), Dropout, Batch Norm, etc. They will help the model generalize well to the unseen data. Also, methods like "early stopping" are also applicable in such a scenario. Hope it'll help you mitigate your issue of overfitting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM