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

 using Microsoft.AspNetCore.Mvc; using System.Xml.Linq; using System.Xml.XPath; //<table class="common-table medium js-table js-stre...