From cc0ac9ffa9e1106fc27a4e26e05cc145490e99c0 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Mon, 9 Feb 2026 20:15:21 -0800 Subject: [PATCH] Start work on AI --- main.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 00000000..d4371910 --- /dev/null +++ b/main.py @@ -0,0 +1,21 @@ +import tensorflow as tf +import keras +print( tf.__version__ ) + +from keras.layers import Dense, Flatten, Conv2D +from keras import Model + +mnist = keras.datasets.mnist + +(x_train, y_train), (x_test, y_test) = mnist.load_data() +x_train, x_test = x_train / 255.0, x_test / 255.0 + +# Add a channels dimension +x_train = x_train[..., tf.newaxis].astype("float32") +x_test = x_test[..., tf.newaxis].astype("float32") + +# batch and shuffle the dataset +train_ds = tf.data.Dataset.from_tensor_slices( + (x_train, y_train)).shuffle(10000).batch(32) + +test_ds = tf.data.Dataset.from_tensor_slices((x_test, y_test)).batch(32) \ No newline at end of file