Data Science Asked on August 10, 2021
I am new to tensorflow and I saw an example model which was made as following –
l0 = tf.keras.layers.Dense(units=1, input_shape=[1])
model = tf.keras.Sequential([l0])
model.compile(loss = 'mean_squared_error', optimizer = tf.keras.optimizers.Adam(0.1))
history = model.fit(sampl, sampl2, epochs=500, verbose=False)
Now when trained on significantly less data –
celsius_q = np.array([-40, -10, 0, 8, 15, 22, 38], dtype=float)
fahrenheit_a = np.array([-40, 14, 32, 46, 59, 72, 100], dtype=float)
It gave a very close prediction for this data but when I used the following data which is significantly more for celsius to kelvin I get predictions which are very off
sampl = np.random.uniform(low=-50, high=50, size=(200,))
sampl2 = sampl+273
I get the prediction 267 Kelvin for 22 Celsius.
I increased my epochs to 1000 and now the prediction is bang on
The codes are the same for both so why do I see such disparity?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP