<jupyter_start><jupyter_text><jupyter_code>%tensorflow_version 2.x
import tensorflow as tf
import numpy as np

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)
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(celsius_q,fahrenheit_a,epochs=500,verbose=False)

import matplotlib.pyplot as plt
plt.xlabel('Epoch Number')
plt.ylabel('Loss Magnitude')
plt.plot(history.history['loss'])
print(model.predict([100.0]))
l0.get_weights()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17117117117117117, 'fraction_numerical': 0.06306306306306306, 'mean_word_length': 9.261538461538462, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '409090', 'license': 'MIT', 'n_tokens_mistral': 303, 'n_tokens_neox': 274, 'n_words': 36, 'path': 'Celsius_to_Fahrenheit.ipynb', 'repo_name': 'soumilbaldota/TensorFlow_Notebooks_101', 'size': '666'}