Thursday, May 13, 2021

 Laurence Moroney's first tutorial 



import  tensorflow as tf 
import numpy as np
from tensorflow import keras

xs = np.array([-101,2,3,4,5,6], dtype = float)
ys = np.array([-21 , 4 , 71013,1619], dtype = float)



model  = keras.models.Sequential([
          keras.layers.Dense(units = 1 , input_shape=[1])
])

model.compile(optimizer = "sgd" , loss = "mean_squared_error")

model.fit(xs, ys,epochs = 50)

print(model.predict([10]))

No comments:

Post a Comment

How to check local and global angular versions

 Use the command ng version (or ng v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to f...