# Redes neuronales

Solo disponible en BuenasTareas
• Páginas : 16 (3873 palabras )
• Descarga(s) : 0
• Publicado : 22 de mayo de 2011

Vista previa del texto
Artificial Neural Networks The Tutorial
With MATLAB

Contents
1. PERCEPTRON ...........................................................................................................................3 1.1. 1.2. 1.3. 1.4. 2.1. 2.2. 2.3. 2.4. 2.5. 3.1. CLASSIFICATION WITH A 2-INPUT PERCEPTRON........................................................................3 CLASSIFICATION WITH A 3-INPUTPERCEPTRON........................................................................5 CLASSIFICATION WITH A 2-NEURON PERCEPTRON....................................................................6 CLASSIFICATION WITH A 2-LAYER PERCEPTRON ......................................................................7 PATTERN ASSOCIATION WITH A LINEAR NEURON.....................................................................9 TRAINING A LINEAR LAYER ....................................................................................................11 ADAPTIVE LINEAR LAYER ......................................................................................................13 LINEARPREDICTION...............................................................................................................14 ADAPTIVE LINEAR PREDICTION ..............................................................................................15 PATTERN ASSOCIATION WITH A LINEAR NEURON ...................................................................17

2. LINEAR NETWORKS...............................................................................................................9

3. BACKPROPAGATIONNETWORKS...................................................................................17

1. Perceptron
1.1. Classification with a 2-input perceptron.

SIMUP - Simulates a perceptron layer. TRAINP - Trains a perceptron layer with perceptron rule. Using the above functions a 2-input hard limit neuron is trained to classify 4 input vectors into two categories. DEFINING A CLASSIFICATIONPROBLEM A row vector P defines four 2-element input vectors: P = [-0.5 -0.5 +0.3 +0.0; -0.5 +0.5 -0.5 +1.0]; A row vector T defines the vector's target categories. T = [1 1 0 0]; PLOTTING THE VECTORS TO CLASSIFY We can plot these vectors with PLOTPV: plotpv(P,T); The perceptron must properly classify the 4 input vectors in P into the two categories defined by T. DEFINE THE PERCEPTRON Perceptrons haveHARDLIM neurons. These neurons are capable of separating an input pace with a straight line into two categories (0 and 1). INITP generates initial weights and biases for our neuron: [W,b] = initp(P,T) INITP - Initializes a perceptron layer. [W,B] = INITP(P,T) P - RxQ matrix of input vectors. T - SxQ matrix of target outputs. Returns weights and biases. INITIAL PERCEPTRON CLASSIFICATION The inputvectors can be replotted... plotpv(P,T) ...with the neuron's initial attempt at classification.

plotpc(W,b) The neuron probably does not yet make a good classification! Fear not...we are going to train it. TRAINING THE PERCEPTRON TRAINP trains perceptrons to classify input vectors. TRAINP returns new weights and biases that will form a better classifier. It also returns the number of epochs theperceptron was trained and the perceptron's errors throughout training. [W,b,epochs,errors] = trainp(W,b,P,T,-1); TRAINP Train perceptron layer with perceptron rule. [W,B,TE,TR] = TRAINP(W,B,P,T,TP) W - SxR weight matrix. B - Sx1 bias vector. P - RxQ matrix of input vectors. T - SxQ matrix of target vectors. TP - Training parameters (optional). Returns: W - New weight matrix. B - New bias vector.TE - Trained epochs. TR - Training record: errors in row vector. Training parameters are: TP(1) - Epochs between updating display, default = 1. TP(2) - Maximum number of epochs to train, default = 100. Missing parameters and NaN's are replaced with defaults. If TP(1) is negative, and a 1-input neuron is being trained the input vectors and classification line are plotted instead of the network...