Mercurial > hg > machine-learning-hw4
view randInitializeWeights.m @ 5:08072e7b3e9f
Fix randInitializeWeights
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Fri, 11 Nov 2011 17:50:52 -0500 |
parents | 8e8089d5a55b |
children |
line wrap: on
line source
function W = randInitializeWeights(L_in, L_out) ##RANDINITIALIZEWEIGHTS Randomly initialize the weights of a layer with L_in ##incoming connections and L_out outgoing connections ## W = RANDINITIALIZEWEIGHTS(L_in, L_out) randomly initializes the weights ## of a layer with L_in incoming connections and L_out outgoing ## connections. ## ## Note that W should be set to a matrix of size(L_out, 1 + L_in) as ## the first row of W handles the "bias" terms ## ## Randomly initialize the weights to small values epsilon_init = 0.12; W = rand(L_out, 1 + L_in)*2*epsilon_init - epsilon_init; endfunction