import tensorflow as tf from tensorflow import keras model = keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])]) model.compile(optimizer='sgd', loss='mean_squared_error') xs = [0, 1, 2, 3, 4] ys = [0, 2, 4, 6, 8] model.fit(xs, ys, epochs=500)In this example, we create a model with a single Dense layer that takes a single input and returns a single output. We use the sgd optimizer and the mean squared error loss function to compile the model for training. The `xs` and `ys` lists are our input and output training data, respectively. We train the model for 500 epochs using the `model.fit()` method. Package library: Tensorflow Python Keras.