keras-cv icon indicating copy to clipboard operation
keras-cv copied to clipboard

Implement overfit test for models

Open LukeWood opened this issue 2 years ago • 2 comments

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 avatar Jul 13 '22 21:07 LukeWood

@LukeWood assign me this issue.

sayakpaul avatar Jul 14 '22 03:07 sayakpaul

Assigned! Thank you Sayak!

LukeWood avatar Jul 14 '22 08:07 LukeWood

Since this involves actual training, which might be too heavy for a unit test. Should we reconsider whether this is needed?

qlzh727 avatar Oct 21 '22 17:10 qlzh727

@sayakpaul , Considering the above comment, please clarify if we are still going ahead with this implementation.

sachinprasadhs avatar Jan 10 '24 23:01 sachinprasadhs

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.

github-actions[bot] avatar Feb 10 '24 01:02 github-actions[bot]

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

github-actions[bot] avatar Feb 25 '24 01:02 github-actions[bot]