Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Why does this program not work The program you will prepare must have an interface, Inputs (inputs.xlsx) and outputs (targets.xlsx) will be read from the

Why does this program not work image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
The program you will prepare must have an interface,
Inputs (inputs.xlsx) and outputs (targets.xlsx) will be read from the files given to you in the program. The program will automatically determine the number of inputs and outputs according to the data read.
There will be only one hidden layer in the program,
The user will be able to determine the number of neurons in the hidden layer, the training rate, the number of epochs, and the data rates to be used for training and testing,
Training and test data will be randomly selected according to the determined rate,
The neurons in the hidden layer will use the sigmoid activation function, and the neuron in the output layer will use the linear activation (k=1) function,
When the program starts, the initial weight values of the artificial neural network will be determined as random real numbers between -5 and 5.
Backpropagation algorithm will be used for training.
After the user-specified amount of training data and the desired epoch number are completed, the weights of the trained network should be displayed in the program.
After the training is completed, the success of the test data will be graphically displayed using the trained network and test data. The metric to be used to determine success will be the Mean squared error.
image text in transcribed
Untitled.m x kentrol 1.m x/+ CiUsersiX1Desktoplmiluntitled.m Untitled.m kontrol inputs=xlsread(a.xlsx):targets=xlsread(b.xlsx): sGet number of inputs and outputs numinputs = size (inputs, 2 ); numoutputs = size ( targets, 2); sGet user input numHidden = input ('enter number of neurons in hidden layer:'): trainingRate = input('enter training rate:'); numEpochs = input ('entr number of epochs:'); trainRate = input ('enter train rate:"): testrate = input ('enter test rate: "); finitialize welghts \( w_{\text {_input }}=-5+(5+5) \times \) rand (numhidden, numInputs); W.output =5+(5+5) * rand (numoutputs, numhidden): Editor-CiUsers XYD DeshtopymiUntitled.m Untitledim kontrolim Fsplit data into train and test stes train_inputs = inputs (1; round ( si 2e( inputs, 1) trainRate), :) : train targets = targets (1:round (size (targots, 1) *trainRate ),;): test. inputs = inputs (round ( size ( inputs, 1) ttrainRate ) :end, :): test_targets = taegets (round ( size ( targets, 1) trainkato) :end, ); *wrain network Ior epochs = 1:numEpochs FForward propagation h_in-= train_inputs : W.input': h out = activation func (hin) : O_in = h_out w output'; o_out = activation func \( \left(0_{\text {_ }} ight. \) in) : bicaleulate error error-train targets - o out; mse =(1/size( train tarqets, 1))+sun( error. 2) : Editor - CIUSersYXIDesktoplmiUntitled.m Untitiedm kontrol 1.m + f. Backward propagation delta o - error * activation_fune_deriv(o_in) ; F Adjust weights W output = W_output + trainingrate ' h_out' " delta_o; W_input = W input + trainingRate * train_inputs" * delta h; end * Display weights disp(W_input): disp (W_output): kevaluate test data h_in = test_inputs * W input'; hout = activation_func (h_in): o_in = h_out " W output': -out =activation func(o in) : Editor - CYUsersXXIDesktop \milUntitied.m Untitled.m x kontrol 1.m

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions