text_plain_output_1.png
import numpy as np

import numpy as np

import tensorflow as tf

import tensorflow as tf

import tensorflow as tf

import tensorflow as tf

def solution_model():
    xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0], dtype=float)
    ys = np.array([5.0, 6.0, 7.0, 8.0, 9.0, 10.0], dtype=float)
    model = tf.keras.Sequential([tf.keras.layers.Dense(1, input_shape=[1])])
    model.compile(loss='mean_squared_error', optimizer='sgd')
    model.fit(xs, ys, epochs=1000)
    return model

if __name__ == '__main__':
    model = solution_model()
    model.save('mymodel.h5')