In [1]:
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt

# Generate a sample sin wave
X = np.array([np.linspace(0,100,1000)])
y = np.sin(X)

# Plot the sample sin wave
plt.plot(y[0])
plt.show()

# Define a model to fit the above data
model = tf.keras.Sequential([
    tf.keras.layers.Dropout(rate=0.2, input_shape=X.shape[1:]),
    tf.keras.layers.Dense(units=64, activation='sigmoid'),
    tf.keras.layers.Dropout(rate=0.2),
    tf.keras.layers.Dense(units=1000, activation='sigmoid')
])

# Compile the model
model.compile(loss='mse',
            optimizer='adam',
            metrics=['accuracy'])

# Fit the model
model.fit(X,y, epochs=10)

# Get the prediction
y_hat = model.predict(X)

# Plot the results
plt.plot(y_hat[0])
plt.show()


---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-aa1ebbd05f01> in <module>
      1 import numpy as np
----> 2 import tensorflow as tf
      3 import matplotlib.pyplot as plt
      4 
      5 # Generate a sample sin wave

ModuleNotFoundError: No module named 'tensorflow'

In [ ]: