0
$\begingroup$

I am training CNN on kaggle and my training and test datasets shapes are as follows:

(12271, 100, 100, 1) train shape
(3068, 1, 100, 100) test shape

(12271,) train target shape
(3068,) test target shape

But when I am training my network with below code, I am getting fllowing output while training, what does it mean. Does it mean validation score is only calculated on 95 samples instead of 3068? I am not sure what does this number 95 denotes at the start of each epoch? Why is it happening?


for i in range(len(model)):
    model[i].fit_generator(datagen.flow(x_train,y_train, batch_size=batch_size),
                                        epochs = epochs, steps_per_epoch=x_train.shape[0] // batch_size,
                                        validation_data = (x_test,y_test), 
                                        callbacks=[ReduceLROnPlateau(monitor='loss', patience=3, factor=0.1)], 
                                        verbose=2)
    models.append(model[i])

Epoch 1/700
95/95 - 12s - loss: 3.4509 - accuracy: 0.3898 - val_loss: 2.8512 - val_accuracy: 0.4198
Epoch 2/700
95/95 - 11s - loss: 3.2385 - accuracy: 0.4420 - val_loss: 4.5017 - val_accuracy: 0.0975
Epoch 3/700
95/95 - 12s - loss: 2.7225 - accuracy: 0.4928 - val_loss: 4.3058 - val_accuracy: 0.4654
Epoch 4/700
95/95 - 11s - loss: 2.5231 - accuracy: 0.5203 - val_loss: 3.7107 - val_accuracy: 0.4501
Epoch 5/700
95/95 - 11s - loss: 2.2600 - accuracy: 0.5358 - val_loss: 1.9277 - val_accuracy: 0.5639
Epoch 6/700
95/95 - 12s - loss: 2.0255 - accuracy: 0.5529 - val_loss: 1.7618 - val_accuracy: 0.5896
Epoch 7/700
95/95 - 11s - loss: 1.8013 - accuracy: 0.5756 - val_loss: 1.4528 - val_accuracy: 0.6040
Epoch 8/700
95/95 - 11s - loss: 1.6182 - accuracy: 0.5942 - val_loss: 1.1788 - val_accuracy: 0.6858
```
$\endgroup$
0
$\begingroup$

95 is not number of samples, it equals to testset divided by batch_size: testset // batch_size in other words steps in per epoch

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.