6

I am using Tensorflow to predict whether the given sentence is positive and negative. I have take 5000 samples of positive sentences and 5000 samples of negative sentences. 90% of the data I used it for training the neural network and rest 10% for testing.

Below is the parameter initialisation. Batch size = 100 Epochs = 30 Number of hidden layers = 3 Nodes in each hidden layer = 100 epochs = 30

I could see in each epoch the cost function is getting reduced reasonably. However the accuracy of the model on test set is poor (only 56%)

```
Epoch 1 completed out of 30 loss : 22611.10902404785
Epoch 2 completed out of 30 loss : 12377.467597961426
Epoch 3 completed out of 30 loss : 8659.753067016602
Epoch 4 completed out of 30 loss : 6678.618850708008
Epoch 5 completed out of 30 loss : 5391.995906829834
Epoch 6 completed out of 30 loss : 4476.406986236572
Epoch 7 completed out of 30 loss : 3776.497922897339
-------------------------------------------------------
Epoch 25 completed out of 30 loss : 478.93606185913086
Epoch 26 completed out of 30 loss : 450.8017848730087
Epoch 27 completed out of 30 loss : 435.0913710594177
Epoch 28 completed out of 30 loss : 452.10553523898125
Epoch 29 completed out of 30 loss : 539.5199084281921
Epoch 30 completed out of 30 loss : 685.9198244810104
Accuracy of Train : 0.88155556
Accuracy of Test : 0.524
```

Is there any parameter that can be tuned to increase the accuracy of the model considering the same number of data set.

How about to do regularization to simplify your fitting model? I believe it can improve your accuracy. – MinSama – 2018-05-05T10:46:15.897

@MinSama I will try to insert the regularization parameter and update here. Also I am looking for more samples of data as the below answers say. – deepguy – 2018-05-11T02:20:54.503