from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
# Creating dummy data
X = np.array([[0], [1], [2], [3], [4], [5]])
y = np.array([0, 1, 2, 3, 4, 5])
# Creating a simple neural network model
model = Sequential([
Dense(10, input_dim=1, activation='relu'),
Dense(1) # Output layer
])
# Compiling the model
model.compile(optimizer='adam', loss='mean_squared_error')
# Training the model
model.fit(X, y, epochs=50, verbose=0)
# Making a prediction
print("Prediction for input 6:", model.predict(np.array([[6]])))
ZnJvbSB0ZW5zb3JmbG93LmtlcmFzLm1vZGVscyBpbXBvcnQgU2VxdWVudGlhbApmcm9tIHRlbnNvcmZsb3cua2VyYXMubGF5ZXJzIGltcG9ydCBEZW5zZQppbXBvcnQgbnVtcHkgYXMgbnAKCiMgQ3JlYXRpbmcgZHVtbXkgZGF0YQpYID0gbnAuYXJyYXkoW1swXSwgWzFdLCBbMl0sIFszXSwgWzRdLCBbNV1dKQp5ID0gbnAuYXJyYXkoWzAsIDEsIDIsIDMsIDQsIDVdKQoKIyBDcmVhdGluZyBhIHNpbXBsZSBuZXVyYWwgbmV0d29yayBtb2RlbAptb2RlbCA9IFNlcXVlbnRpYWwoWwogICAgRGVuc2UoMTAsIGlucHV0X2RpbT0xLCBhY3RpdmF0aW9uPSdyZWx1JyksCiAgICBEZW5zZSgxKSAgIyBPdXRwdXQgbGF5ZXIKXSkKCiMgQ29tcGlsaW5nIHRoZSBtb2RlbAptb2RlbC5jb21waWxlKG9wdGltaXplcj0nYWRhbScsIGxvc3M9J21lYW5fc3F1YXJlZF9lcnJvcicpCgojIFRyYWluaW5nIHRoZSBtb2RlbAptb2RlbC5maXQoWCwgeSwgZXBvY2hzPTUwLCB2ZXJib3NlPTApCgojIE1ha2luZyBhIHByZWRpY3Rpb24KcHJpbnQoIlByZWRpY3Rpb24gZm9yIGlucHV0IDY6IiwgbW9kZWwucHJlZGljdChucC5hcnJheShbWzZdXSkpKQo=