Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use matlab Linear Neural Network

Shulou Source: shulou.com Published: 2022-06-01 03:21:31 09月29日 Update

This article introduces the relevant knowledge of "how to use MATLAB linear neural network". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Linear neural network is the simplest kind of neural network, which can be composed of one or more linear neurons. The difference between the linear neural network and the perceptron is that the neuron transfer function of the linear neural network is a linear function, so the output of the linear neural network can take any value, while the output of the perceptron can only be 0 or 1. Linear neural network has higher convergence speed and accuracy than perceptron, but like perceptron, linear neural network can only solve the problem of linear separation. Each input of the perceptron has an output corresponding to it. Referring to the difference between the output vector and the expected output vector, the weights and thresholds of the network are adjusted so that the sum of squares of the training error is minimum or less than a certain value. This learning rule is the Widrow-Hoff learning rule, which is called LMS (Least Mean Square) algorithm. % define variable

% input vector d = [0mem0mem0re0];% expected output vector lr=maxlinlr;% maximum learning rate%% linear network implementation based on input matrix.

Net1=linearlayer (0primel);% create linear network net1=train (net1,P,d);% Linear network training% Perceptron implementation net2=newp ([- 1meme 1 maverick 1], 1memento hardlim');% create perceptron net2=train (net2,P,d);% Perceptron learning

%% display plot ([0recorder 1], [0flore 1],'o');% output hold on;plot from graphics window (1 minus 1],'o');% display y2=-w2 (1) / w2 (2) * x-w1 (3) / w1 (2);% 1 peg 2 is the threshold plot to distinguish between 0 and 1; y2=-w2 (1) / w2 (2) * x-w2 (3) / w2 (2) The% hardlim function outputs 0 or 1plot, respectively, with 0 as the threshold; axis ([- 0.5 meme 2 meme le le 2]) xlabel ('x'); ylabel ('ylabel'); title (' linear neural networks and perceptrons for solving and logic') legend ('linear neural network classification surface', 'perceptron classification surface')

This is the end of the content of "how to use MATLAB Linear Neural Network". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Linear network neural neural network output learning vector function threshold input content more knowledge neurons rules classification expectation training practical maximum Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Technology Apple Redmi MySQL