How to create amazing Tensorflow model in few lines of code

Photo by Umberto on Unsplash

Although TensorFlow looks very hare but it is very easy to create a machine learning model using this library in very easy and few steps. In this tutorial I will share how to create a machine learning model in minimum lines of code

import tensorflow as tf
mnist = tf.keras.datasets.mnist
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dense(10)
])
model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test,  y_test, verbose=2)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store