chandrakant_singh asked . 2021-05-10

Help in viewing the output of a neural network

I used nftool in Matlab 2012 and trained a network. I gave the training inputs as x=[250:1] and targets as t=[250:1]. I used 10 hidden layers. I trained the network and got the results and exported the data to workspace. I finally got net as the variable in the workspace. I want to realize this network in hardware. So, I want the exact weights and bias values. I searched the net and typed net.IW and got 10 values, net.LW and got yet another 10 values and net.b and got 11 values. My network diagram is as shown below:
Output Neural Net
If IW is the Input Weight and LW is the Layer Weight, I realized the network diagram as shown below:
My realization of output Neural Network
I got 10 values for IW, which would fit into 10 hidden layers, and 10 values for LW, which will fit into 10 hidden layers according to my realization. I got 11 values for bias, which will fit in to my network, since there are 11 (b) blocks in the network. But, i am missing one IW and one LW value.
I want to know whether there is a mistake in my realization of the output of the network or I missed any of the values. Please help.
 

deep learning , matlab , simulink ,

Expert Answer

Neeta Dsouza answered . 2024-05-18 08:55:51

> Help in viewing the output of a neural network
> Asked by sundar on 2 Feb 2014 at 11:01
> I used nftool in Matlab 2012 and trained a network. I gave the training inputs as x=[250:1] and targets as t=[250:1].
% Syntax error:
 
 x = [250:1]

 x =  Empty matrix: 1-by-0
> I used 10 hidden layers.
%Terminology Error
You used 1 hidden layer with 10 hidden nodes
>I trained the network and got the results and exported the data to workspace. I finally got net as the variable in the workspace. I want to realize this network in hardware. So, I want the exact weights and bias values. I searched the net and typed net.IW and got 10 values, net.LW and got yet another 10 values and net.b and got 11 values. My network diagram is as shown below:
> Output Neural Net
% Diagram Omitted. See above.
> If IW is the Input Weight and LW is the Layer Weight, I realized the network diagram as shown below:
% Diagram Omitted. See above.
The 4-block diagram is somewhat mislabeled and misleading:
 
 1. Unfortunately, the standard terminology for this type of NN 
    is two-layer Multilayer Perceptron. 
     a. It corresponds to the two weight-layers or, equivalently, the 
     two neuron(i.e., activation-function)-layers.
     b. In particular, it is called a two-layer network even though 
     there are three layers of nodes: input, hidden, and output.
     c. Since the signals are represented by the nodes, I would 
     prefer to call it a three (node) layer net. So, to avoid confusion, 
     I simply refer to the net as a single hidden layer net.

 2.The 1st box represents an input fan-in unit (node layer) with as 
    many input nodes as the dimensionality of the input vector.
  3. The hidden neuron layer signal is represented by the output 
    of the 2nd box  
 4.   The output neuron layer signal is represented by the output 
    of the 3rd box.
  5. The existence of the 4th box is misleading. So, just imagine it 
    does not exist and label the arrow coming from the 3rd box as the 
    output signal.
   6. The weight and bias subboxes in the hidden layer box are 
    usually labeled IW and b1. 
   7. The weight and bias subboxes in the output layer box are 
    usually labelled LW and b2.
    8. My personal preference for diagramming would be to replace 
    the 1st and 4th boxes with arrows labelled x(input) and y(output).
    The arrow between the 2nd and 3rd boxes would be labelled 
    h(hidden).
> My realization of output Neural Network
> I got 10 values for IW, which would fit into 10 hidden layers, and 10 values for LW, which will fit into 10 hidden layers according to my realization. I got 11 values for bias, which will fit in to my network, since there are 11 (b) blocks in the network. But, i am missing one IW and one LW value.
> I want to know whether there is a mistake in my realization of the output of the network or I missed any of the values
You used the term "layers" instead of "nodes"
 
 [ 10 1 ] = size(IW)% IW connects the 1-D input and the 10-D hidden layer signal
 [ 10 1 ] = size(b1) % b1 connects the 1-D input bias and the 10-D hidden layer signal

 h = tansig( b1 + IW*x); % [ 10 1 ] = size(h)

 [ 1 10 ] = size(LW)% LW connects and the 10-D hidden layer signal and the the 1-D output 
 [ 1 1 ] = size(b2) % b2 connects the 1-D output bias and the 1-D output layer signal

 y = purelin( b2 + LW*h); % [ 1 1 ] = size(y); purelin(z) = z

 


Not satisfied with the answer ?? ASK NOW

Frequently Asked Questions

MATLAB offers tools for real-time AI applications, including Simulink for modeling and simulation. It can be used for developing algorithms and control systems for autonomous vehicles, robots, and other real-time AI systems.

MATLAB Online™ provides access to MATLAB® from your web browser. With MATLAB Online, your files are stored on MATLAB Drive™ and are available wherever you go. MATLAB Drive Connector synchronizes your files between your computers and MATLAB Online, providing offline access and eliminating the need to manually upload or download files. You can also run your files from the convenience of your smartphone or tablet by connecting to MathWorks® Cloud through the MATLAB Mobile™ app.

Yes, MATLAB provides tools and frameworks for deep learning, including the Deep Learning Toolbox. You can use MATLAB for tasks like building and training neural networks, image classification, and natural language processing.

MATLAB and Python are both popular choices for AI development. MATLAB is known for its ease of use in mathematical computations and its extensive toolbox for AI and machine learning. Python, on the other hand, has a vast ecosystem of libraries like TensorFlow and PyTorch. The choice depends on your preferences and project requirements.

You can find support, discussion forums, and a community of MATLAB users on the MATLAB website, Matlansolutions forums, and other AI-related online communities. Remember that MATLAB's capabilities in AI and machine learning continue to evolve, so staying updated with the latest features and resources is essential for effective AI development using MATLAB.

Without any hesitation the answer to this question is NO. The service we offer is 100% legal, legitimate and won't make you a cheater. Read and discover exactly what an essay writing service is and how when used correctly, is a valuable teaching aid and no more akin to cheating than a tutor's 'model essay' or the many published essay guides available from your local book shop. You should use the work as a reference and should not hand over the exact copy of it.

Matlabsolutions.com provides guaranteed satisfaction with a commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been empanelled after extensive research and quality check.

Matlabsolutions.com provides undivided attention to each Matlab assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work done at the best price in industry.