Linked Questions

Popular Questions

I have two tensor objects, train and labels. The dataset train has 100 features, and labels has 1 feature. Both train and labels have M entries. Similarly, we have a dev and dev_labels set with the same respective number of features and N entries. After importing Keras from TensorFlow, we creating a neural network as follows:

model = keras.Sequential([
    keras.layers.Flatten(input_shape=[100]),
    keras.layers.Dense(100, activation=tf.nn.relu),
    keras.layers.Dense(10, activation=tf.nn.softmax)
])

model.compile(optimizer='adam', 
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

Now we want to fit the model, with batches of size P for Q epochs.

model.fit(train_X, train_Y, validation_data=(dev_X, dev_Y), epochs=Q, steps_per_epoch=??, validation_steps=??)

After reading the documentation on model.fit, I am still not sure what would be the correct steps_per_epoch or validation_steps here. When using data tensors as input to a model, these parameters must be specified. In this example, what would we specify for steps_per_epoch and validation_steps?

Related Questions