<jupyter_start><jupyter_text>See what happens by experimenting with different epoch numbers<jupyter_code>import tensorflow as tf 

from tensorflow import keras

fashion_mnist = tf.keras.datasets.fashion_mnist

(train_data , train_label) , (test_data , test_label ) = fashion_mnist.load_data()
import numpy as np 
np.set_printoptions(linewidth=200)
import matplotlib.pyplot as plt
plt.imshow(train_data[0])
print(train_data[0])
print(train_label[0])
print(train_data.shape)
train_data =  train_data/255.0
test_data = test_data/255.0
class mycallback(tf.keras.callbacks.Callback):
  def on_epoch_end(self, epoch, logs={}):
    if(logs.get('loss')< 0.18):
      self.model.stop_training = True
callbacks = mycallback()
model = tf.keras.Sequential([keras.layers.Flatten() ,
                            tf.keras.layers.Dense(512, activation=tf.nn.relu),
                                    tf.keras.layers.Dense(256, activation=tf.nn.relu),
                            keras.layers.Dense(10, activation=tf.nn.softmax)])
model.compile(optimizer=tf.optimizers.Adam() , loss ='sparse_categorical_crossentropy', metrics = ['accuracy'] )
model.fit(train_data,train_label , epochs = 10, callbacks = [callbacks])
model.evaluate(test_data,test_label)
classifications = model.predict(test_data)
print(classifications[2])
print(test_data[2])

plt.imshow(test_data[2])<jupyter_output>[8.4558029e-16 1.0000000e+00 9.6381389e-15 2.3417441e-13 2.7887484e-15 7.5842103e-25 1.5091079e-14 7.8753645e-31 2.0755844e-17 1.0108925e-23]
[[0.         0.         0.         0.         0.         0.         0.         0.         0.00392157 0.         0.2627451  0.69411765 0.50588235 0.6        0.45882353 0.50588235 0.57254902
  0.55294118 0.68627451 0.         0.         0.         0.         0.         0.         0.         0.         0.        ]
 [0.         0.         0.         0.         0.         0.         0.         0.         0.00784314 0.         0.76862745 1.         1.         1.         0.94509804 0.98431373 1.
  0.96078431 1.         0.29803922 0.         0.         0.         0.         0.         0.         0.         0.        ]
 [0.         0.         0.         0.         0.         0.         0.         0.         0.         0.         0.95294118 0.92941176 0.85098039 0.89411765 0.90588235 0.87058824 0.85490196
  0.85882353 1.         0.45490196 0.         0.   [...]
{'fraction_non_alphanumeric': 0.11799410029498525, 'fraction_numerical': 0.1685630004214075, 'mean_word_length': 1.7476851851851851, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '261070', 'license': 'MIT', 'n_tokens_mistral': 1072, 'n_tokens_neox': 859, 'n_words': 163, 'path': 'Changingepochs.ipynb', 'repo_name': 'deathstar1/Exploration', 'size': '2373'}