EMJian
/
Solving-full-wave-nonlinear-inverse-scattering-problems-with-back-propagation-scheme
Public
forked from eleweiz/Solving-full-wave-nonlinear-inverse-scattering-problems-with-back-propagation-scheme
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit_weight_test.m
19 lines (18 loc) · 838 Bytes
/
init_weight_test.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function weights = init_weight_test(opts, h, w, in, out, type)
% -------------------------------------------------------------------------
% See K. He, X. Zhang, S. Ren, and J. Sun. Delving deep into
% rectifiers: Surpassing human-level performance on imagenet
% classification. CoRR, (arXiv:1502.01852v1), 2015.
switch lower(opts.weightInitMethod) % lower: transfer capital letter to lower letter;
case 'gaussian'
sc = 0.01/opts.scale ;
weights = randn(h, w, in, out, type)*sc;
case 'xavier'
sc = sqrt(3/(h*w*in)) ;
weights = (rand(h, w, in, out, type)*2 - 1)*sc ;
case 'xavierimproved'
sc = sqrt(2/(h*w*out)) ;
weights = randn(h, w, in, out, type)*sc ;
otherwise
error('Unknown weight initialization method''%s''', opts.weightInitMethod) ;
end