# What does it mean to have epochs=30 in Keras' fit method given certain data?

I have read a lot of information about several notions, like batch_size, epochs, iterations, but because of explanation was without numerical examples and I am not native speaker, I have some kind of problem of understanding still about those terms, so I decided to work with data. Let us suppose we have the following data

Of course, it is just subset of original data, and I want to build a neural network with three hidden layers, the first layer contains 500 nodes, it takes input three variable and on each node, there is sigmoid activation function, next layer contains 100 node and sigmoid activation, the third one contains 50 node and sigmoid again, and finally we have one output with sigmoid to convert the result into 0 or 1 that classify whether a person with those attributes is female or male.

I trained the model using Keras Tensorflow with the following code

model.fit(X_train,y_train,epochs=30)


With this data, what does mean epochs=30? Does it mean that all 177 rows (with 3 input at times) will go to the model 30 times? What about batch_size=None in model.fit parameters?

• Hi dato, I think your question have a lot of irrelevant information, what is your main question? Apr 1 '20 at 23:27
• i wanted to understand following thing : if my train data has size of (177,3) and batch size is 2 , let say, how update process is going? let us suppose neural network takes 3 input and 1 output Apr 1 '20 at 23:28
• @malioboro i have answered and could you please check if it is correct? Apr 1 '20 at 23:56
• Hi and welcome to AI SE! If you're asking how a certain library, method or API works, then your question is off-topic here. See ai.stackexchange.com/help/on-topic for more details. You should ask these questions on Stack Overflow.
– nbro
Apr 2 '20 at 0:53

now about batch size, if we have let say 177 sample(177 row) and 2 batch_size , that means we have approximately $$177/2$$ batch right?update process goes like this:
let us suppose network takes 3 input and produce one output, from first sample of data, three data will go to the network and output will be generated, this output will be compared to the first value of y_train and cost function will be created, then next sample will go(it means next three value) and compared to the second value of y_train, also second cost function will be generated, final cost function for first batch will be sum of those cost functions and using gradient method weights are updated, after that one new batches will go through the network and on the based on updated weights, new weights are generated, when all $$177/2$$ batch will be finished , it will be our 1 epoch right? is that correct?