Reputation: 11
Can a model maintain the order of predictions in loss function based on the order of the batch of input features given to it while training.? if not how can i make it remember the order because i need this order in my custom loss function currently its failing which i think is because its not following the order. for example input features are 45,12,23 and ground truth of 1,2,3 so in predictions i want the same order Such that loss function gets the predictions in the same order as the input features were.
Upvotes: 1
Views: 745
Reputation: 4289
If you're using tf.keras.Sequential
, the fit()
method has a shuffle
argument which is set to True
by default.
You may set to False
to avoid shuffling of samples. Note, this argument has no effect when steps_per_epoch
argument is None
. See the docs.
Upvotes: 1