rasmusbergpalm / DeepLearnToolbox

Matlab/Octave toolbox for deep learning. Includes Deep Belief Nets, Stacked Autoencoders, Convolutional Neural Nets, Convolutional Autoencoders and vanilla Neural Nets. Each method has examples to get you started.
BSD 2-Clause "Simplified" License
3.8k stars 2.28k forks source link

Issue with the file nnff.m #148

Open bnaman50 opened 9 years ago

bnaman50 commented 9 years ago

I was using this toolbox for implementing a simple neural network. But I have a doubt. The way you are calculating the output of the hidden layers is ( nn.a{i} = sigm(nn.a{i - 1} * nn.W{i - 1}'); ), ignoring the bias term 'b'. Can you help me out with that or tell me if it's required or not.

tambetm commented 9 years ago

Bias term is simulated by having one of the inputs 1 all time. Then bias corresponds to weight of this item. These lines in the start of nnff.m implement it:

x = [ones(m,1) x];
nn.a{1} = x;
bnaman50 commented 9 years ago

Thanks a lot for your help.