keras-cv
keras-cv copied to clipboard
Implement overfit test for models
Something like:
from keras_cv.models import MLPMixerB16
from tensorflow import keras
import tensorflow as tf
# constants
batch_size = 10
height = width = 224
num_channels = 3
# model
mixer = MLPMixerB16(include_rescaling=True, include_top=True, classes=10)
mixer.compile(optimizer="adam", loss="sparse_categorical_crossentropy", metrics=["accuracy"])
# data
random_images = tf.random.normal((batch_size, height, width, num_channels))
random_labels = tf.random.uniform((batch_size, ), 0, 5, dtype="int32")
# train
mixer.fit(
random_images, random_labels,
validation_data=(random_images, random_labels),
epochs=3
)
Originally posted by @sayakpaul in https://github.com/keras-team/keras-cv/issues/529#issuecomment-1179463713
To make sure we can overfit a randomly generated dataset
@LukeWood assign me this issue.
Assigned! Thank you Sayak!
Since this involves actual training, which might be too heavy for a unit test. Should we reconsider whether this is needed?
@sayakpaul , Considering the above comment, please clarify if we are still going ahead with this implementation.
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.
This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.