I want to extract a equation from neural network (in MATLAB) which is function of the weights, biases and activation function, (for example, y=ax+b). please use a simple code and explain step by step.
Reza:
Lets suppose that you want to train a NN for regression, some inputs and one target like this:
hiddenLayerSize = [6 2]; %two hidden layers with 6 and 2 hidden units
net = fitnet(hiddenLayerSize);
[net,tr] = train(net,inputs,targets);
The following code in MATLAB should print the NN configuration, weights, activation function and bias. Then you can build your equation...
clc;
fprintf('Network Configuration\n');
fprintf('Internal weights for each layer\n\n');
fprintf(':::: Input Layer/Hidden1 ::::\n');
for R=1:net.inputs{1}.size
fprintf('X%d\n',R)
for S=1:hiddenLayerSize(1)
fprintf('W(%d,%d)=%f\n',R,S,net.IW{1}(S,R));
end
fprintf('-------\n');
fprintf('Node Bias\n');
for R=1:net.layers{1}.dimensions
fprintf('b(%d)=%f\n',R,net.b{1}(R));
fprintf('Activation function: %s\n',net.layers{1}.transferFcn);
fprintf('*********************************\n');
for R=2:net.numLayers-1
fprintf(':::: Input Hidden %d ::::\n',R);
%fprintf('%d,%d\n',R,R-1);
[NODES,IN_NODES]=size(net.LW{R,R-1});
for K=1:IN_NODES
fprintf('Node %d \n',K)
for S=1:NODES
fprintf('W(%d,%d)=%f\n',K,S,net.LW{R,R-1}(S,K));
for m=1:net.layers{R}.dimensions
fprintf('b(%d)=%f\n',m,net.b{R}(m));
fprintf('Activation function: %s\n',net.layers{R}.transferFcn);
fprintf('---------------------------------\n');
fprintf(':::: Output Layer ::::\n');
R=R+1;
fprintf('Output bias\n');
fprintf('b=%f\n',net.b{net.numLayers}(1));
fprintf('Done...!\n');
Thanks for your good response.
There are good methods for modeling of water to water, Water to Air and Air to Air Heat pump, like parameter estimation and equation fit, but I couldn't find any method for modeling this Air To...
05 June 2014 8,647 4 View
If you know free software or method, share your experience.
02 March 2014 5,564 8 View
Photovoltaic Cells, solar heating, cooling and etc , in your opinion ,are they reliable especially in Autumn and Winter? Please share your experiences with this, in home or your office.
01 February 2014 2,075 14 View
There are a lot of researchers that have trouble like this. Please tell me your experiences and your efforts with this or introduce some references.
31 December 2013 1,554 62 View
I have one parameter that is dependent to other parameter (like a(T) ) the value of T in my before written m-file is obtained by solving some nonlinear equation and I cannot update value of 'a(T)"...
31 December 2013 5,353 6 View
I want to model predict output power from pv cells.
31 December 2013 2,242 12 View
We only know the entering temperature to the heat exchanger (T_in=0), it doesn't change with time, and also we have an analytical relation (see attached schematic).
11 December 2013 4,936 7 View
In computing temperature changes in wall of the borehole when i use the fast Fourier transform, values obtained from this are very large, for example they should be: 0
10 November 2013 5,469 3 View
I'm targeting to deploy a mesh network and manually configure MANET routing protocols. I'm preparing scenarios, architectures, and hard devices needed to do that. Are there some step-by-step...
03 March 2021 1,931 5 View
Is there a powerful system for the security of the systems distributed on IoT systems?
02 March 2021 3,858 10 View
Hello, Could you please share any interesting research explaining how to choose the number of hidden layers and nodes per layer in case of regression problems using ANN? Thank you, any help would...
01 March 2021 6,200 3 View
Hi, We culture neural progenitor cells in T175 culture flasks coated with PLO-Laminin. We have successfully grown these cells with our protocol for months. Recently, we observed large sheets...
25 February 2021 3,443 4 View
I am working on creating deep neural network on geospatial dataset and wanted to know how to do the sampling so that I can increase the presence of solar panels in the images. I cannot use entire...
25 February 2021 3,936 6 View
Hello, I am a master's student studying in Yonsei Univeristy, Korea. I am trying to estimate the state of satellite, using Neural Network. Below is a simple flow of my study. 1. Train (t0 ~ t1)...
23 February 2021 6,383 3 View
Dear scholars, I was wondering if there are any scientific methods to train a neural network or ANFIS when one of the input variables is stochastic (random) and more importantly non-measurable?...
17 February 2021 1,909 3 View
Are there papers that talk about the possible advantages and disadvantages of using autoencoders instead of CNNs for feature extraction in neural network?
15 February 2021 6,952 3 View
The data collected from various measurement devices often contains erroneous values - such as noise, missing values, etc. What are the popular techniques for pre-processing measurement data in...
14 February 2021 4,642 2 View
14 February 2021 4,194 3 View