📄 init_operation_def.m~
字号:
% init_operation_def.m%% Define necessary parameters (namely p, q, r, and c), depending on% the operation type. In general, the operation will be of the% form:% y = sum(f1.*(x.^p))./(c+sum(f2.*(x.^q)).^r);% When p < qr, the operation will make a bell-shaped tuning, and% when p > qr, the operation will be max-like (in fact, p=q+1, r=1 define% soft-max operation). %% Available operations are% fulmax: full max (with do_sp1)% nullop: null operation (with do_sp1)% gaussf: gaussian function (with do_sp1)% sftmax: soft max% normsp: normalized (sqrt of summed squares)% normdp: tuning operation% % Note: operation def are in comp_crop_or_zeropad and% comp_get_next_layer.switch type case ('gaussf') case ('fulmax') case ('normsp') % This is L2-norm dot-product. p = 1; q = 2; r = 1/2; c = repmat(eps, [1 siz(4)]); y_max = repmat(1, [1 siz(4)]); case ('normdp') % Normalized dot product, where [p,q,r] can be some other % values. c and y_max values are obtained by taking first % derivative. p = 1; q = 2; r = 1; w = f1.^(q-p); c = (sum(w.^(q/(q-p))).^r)*(q*r/p-1); y_max = p/q/r./(sum(w.^(q/(q-p))).^(r-1)); case ('sftmax') % Softmax. p = 3; q = 2; r = 1; c = repmat(eps, [1 siz(4)]); y_max = repmat(1, [1 siz(4)]); otherwise error('error: undefined operation');endsigmoid_a = -1; % No sigmoid for <0.if (type=='normdp') sigmoid_a = sqrt(size(f1,1)^(q*r/p)); sigmoid_a = sqrt(size(f1,1)); sigmoid_b = 0.9; sigmoid_b = 0.2;end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -