Neural Network Sine Function Approximation

preview_player
Показать описание
from numpy import asarray
from matplotlib import pyplot
import math
import numpy
# define the dataset
# reshape arrays into into rows and cols
# separately scale the input and output variables
scale_x = MinMaxScaler()
scale_y = MinMaxScaler()
# design the neural network model
model = Sequential()
# define the loss function and optimization algorithm
# ft the model on the training dataset
# make predictions for the input data
# inverse transforms
# report model error
print('MSE: %.3f' % mean_squared_error(y_plot, yhat_plot))
# plot x vs y
# plot x vs yhat
Рекомендации по теме
Комментарии
Автор

How can I randomly give input and check the output in case of your code?

abhishekb
Автор

I mean after training and testing... I want to check whether it works fine or not so how can I check the output of this perceptron like sine(0.5)

abhishekb