필터 지우기
필터 지우기

How to implement nguyen widrow weight initialization ?

조회 수: 5 (최근 30일)
crixus
crixus 2017년 4월 4일
댓글: crixus 2018년 5월 18일
Hi, I'm interested to use nguyen widrow weight initialization but i do not want to use the existing matlab function. I have the pseudo code and I want to try coding it myself. One thing I'm not sure on is how the technique calculate the norm of weights ? suppose I have input weights of [5x3] do i calculate the norm of entire matrix or column ? Thanks in advance

답변 (2개)

Ênio Viana
Ênio Viana 2018년 5월 18일
I want to know this too. Thanks in advance

Ênio Viana
Ênio Viana 2018년 5월 18일
In this link you can see a Matlab code implementation Stack Overflow but I didn't test this. See that code...
a = -1;
b = 1;
% WIDROW weights for Layer Input to Hidden Layer 1
sum_sq_wts = 0;
for k=1:30
iw(:,:) = zeros(num_input, nodes_hidden_layer);
for i=1:num_input
for j=1:nodes_hidden_layer
iw(i,j)=(b-a)*rand(1,1) + a;
sum_sq_wts = sum_sq_wts + (iw(i,j)*iw(i,j));
end
end
norm = sqrt(sum_sq_wts);
beta = 0.7*nodes_hidden_layer.^(1/num_input);
for i=1:num_input
for j=1:nodes_hidden_layer
iw(i,j) = beta*iw(i,j)/norm;
end
end
IW{k}=iw';
end
% WIDROW weights for Hidden Layer 1 to output Layer
sum_sq_wts = 0;
for k=1:30
lw(:,:) = zeros(nodes_hidden_layer,1);
for i=1:nodes_hidden_layer
for j=1:1
iw(i,j)=(b-a)*rand(1,1) + a;
sum_sq_wts = sum_sq_wts + iw(i,j)*iw(i,j);
end
end
norm = sqrt(sum_sq_wts);
beta = 0.7*nodes_hidden_layer.^(1/num_input);
for i=1:nodes_hidden_layer
for j=1:1
lw(i,j) = beta*lw(i,j)/norm;
end
end
LW{k}=lw';
end
WidNgu{1,1} = IW;
WidNgu{1,2} = LW;
  댓글 수: 1
crixus
crixus 2018년 5월 18일
not sure if it's like this
InputWeight=rand(NumberofHiddenNeurons,NumberofInputNeurons)*2-1; beta = 0.7*(NumberofHiddenNeurons^(1/NumberofInputNeurons)); InputWeight = InputWeight/norm(InputWeight) * beta;
xmin=min(min(InputWeight)); xmax=max(max(InputWeight)); BiasofHiddenNeurons=xmin+rand(NumberofHiddenNeurons,1)*(xmax-xmin);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by