Fitting the model

The fit parameter initiates the training session, and hence should be thought of as synonymous to training our model. It takes your training features, their corresponding training labels, the number of times the model sees your data, and the number of learning examples your model sees per training iteration as training measures, respectively:

model.fit(x_train, y_train, epochs=5, batch_size = 2) #other arguments                               validation split=0.33, batch_size=10

You can also have additional arguments to shuffle your data, create validation splits, or give custom weights to output classes. Shuffling training data before each epoch can be useful, especially to ensure that your model does not learn any random non-predictive sequences in ...

Get Hands-On Neural Networks with Keras now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.