Saturday, 4 January 2014

Some function you need to know for implementing neural nets in matlab

While starting out with neural nets in MATLAB I encountered a hand full of unknown creepy MATLAB functions. I started making a list of these functions and their descriptions for future reference. I am posting some of these MATLAB functions you need to know. Much formal definitions of these functions can be found in the matlab documentation.

newff: Create a feed-forward backpropagation network
feval: Evaluate function
network: Create custom neural network
view: View neural network
configure: Configure network inputs and outputs to best match input and target data. More info can be found here
train: Train neural network
net=perceptron : creates a perceptron network and assigns it
randn:Uniformly distributed pseudorandom numbers
randi: Normally distributed pseudorandom integers
rand: Normally distributed pseudorandom numbers
zeros: Create array of all zeros
ones: Create array of allones.
figure: Create figure graphics object
plot: 2-D line plot
plot3: 3-D line plot
plotpv: Plot perceptron input/target vectors
plotpc: Plot classification line on perceptron vector plot
hold on: retains the current graph and adds another graph to it. MATLAB adjusts the axes limits, tick marks, and tick labels as necessary to display the full range of the added graphgrid on: adds major grid lines to the current axes.
epoch: An epoch is the number of times all of the training vectors are used once to update the weights. An epoch corresponds to the entire training set going through the entire network once. It can be useful to limit this, e.g. to fight overfitting.
repmat: Replicate and tile array.
b=repmat(array,m,n): creates a m x n tilling of a and stores in b.
b=repmat(array,n): same as b=repmat(array,n,n)

Parameters of the network:

net=feedforwardnet

net.layerConnect: 
The rows represent the destination layer, and the columns represent the source layer.

No comments:

Post a Comment