'Why my ecpohs is showing 647 when i have a data set of 23000 where 2300 is for validation, should it be 21000 ?(batch size = 32, epochs = 5)

my code :

model = Sequential()
model.add(Conv2D(64,(3,3), activation='relu'))
model.add(MaxPooling2D((2,2)))

model.add(Conv2D(64,(3,3), activation='relu'))
model.add(MaxPooling2D((2,2)))

model.add(Flatten())
model.add(Dense(128,input_shape = x.shape[1:], activation = 'relu'))

model.add(Dense(2,activation = 'softmax'))
model.compile(optimizer= 'adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
model.fit(x,y,epochs=5, validation_split= 0.1, callbacks=[tensorboard])

[jupyter screenshot of output][1] [1]: https://i.stack.imgur.com/otNTZ.png



Solution 1:[1]

Your Code :

model.fit(x,y,epochs=5, validation_split= 0.1, callbacks=[tensorboard])

You set the validation_split=0.1, it means 10% of your training data will be use as the validation set.

And you set your batch size as 32 (you said that at the title).

So the data will be split to np.ceil((23000*0.9)/32), this is way you get 647/647 when you training.

enter image description here

I think this picture can explain the training process.

English is not my native language, there may be grammar errors, please forgive me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1