filt_get_c1.m

来自「Standard model object recognition matlab」· M 代码 · 共 71 行

M
71
字号
function f = filt_get_C1% FUNCTION f = filt_get_C1%% Here, we define which scales and spatial positions to pool, so% that C1 units are translation and scale invariant complex cells% in V1.  Many parameters (eg. number of scales/orientations) are% carried over from S1 filter parameters.f = [];num_scale = 8; % there are 8 scales in S1.for i = 1:num_scale  scale_tag = ['s' num2str(i)];  [f1, f2, shift] = get_C1_filters(i);  f = filt_package (f, f1, f2, shift, scale_tag);endfunction [f1, f2, shift] = get_C1_filters (which_scale)% FUNCTION [f1, f2, shift] = get_C1_filters (which_scale)% % Defines C1 filter parameters, so make sure the parameters match% with the definitions from S1 filters.% In the old, HMAX parameters (Nature Neurosci. 1999), %    pooling_ranges = [4 6 9 12];%    shift          = ceil(pooling_range/2);% shift values are hard-coded to make the receptive field sizes of% C1 units (S1 filter size plus pooling range) divided by the shift% values are constant (eg. same overlap factors or sampling across% different scales).  This is important for scale invariance. % Parameter with T. Serre.%shifts = [3 5 7 8 10 12 13 15];% However, below is more correct.%shifts = round([16 22 28 34 40 46 52 59]/3);%shifts = [3 4 5 7 8 9 10 12];%shift  = shifts(which_scale);num_orientation = 4;[a,b,c] = init_filter_def(2); % Grab C1 definitions.pooling_ranges = b(1,:);num_old_feats  = b(3,:);num_new_feats  = b(4,:);shifts         = c;pooling_range  = pooling_ranges(which_scale);num_old_feat   = num_old_feats(which_scale);num_new_feat   = num_new_feats(which_scale);shift          = c(which_scale);max_fs       = pooling_range; % max filter sizef = zeros(max_fs,max_fs,num_old_feat,num_new_feat);switch which_scale  % Based on S1 filter parameters  case 8    num_scale = 3;  otherwise    num_scale = 2;endfor i = 1:num_orientation  f(:,:,[1:num_scale]+(i-1)*num_scale,i) = 1;endf1 = f;f2 = f;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?