import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers # Define the model architecture model = keras.Sequential([ layers.Dense(64, activation='relu', input_shape=(784,)), layers.Dense(10, activation='softmax') ]) # Compile the model model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.fit(x_train, y_train, batch_size=32, epochs=10, validation_data=(x_val, y_val)) predictions = model.predict(x_test)