Skip to content

Commit

Permalink
Revise the function to simplify the pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Ren committed Oct 6, 2015
1 parent 3460e9c commit b29ca2d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions layers_adapters/mask2conv.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
function mask2conv(in)
function mask2conv()
global config mem;
curr_layer_idx = config.misc.current_layer;
in = mem.mask_li{curr_layer_idx};
for m = 1:config.batch_size
for n = 1:config.chs
mem.mask_inputs{1}((n-1)*config.kernel_size(1, 1)*config.kernel_size(1, 2)+1:n*config.kernel_size(1, 1)*config.kernel_size(1, 2), (m-1)*(size(mem.mask_inputs{1}, 2)/config.batch_size)+1:m*size(mem.mask_inputs{1}, 2)/config.batch_size) = ...
mem.mask_inputs{curr_layer_idx}((n-1)*config.kernel_size(1, 1)*config.kernel_size(1, 2)+1:n*config.kernel_size(1, 1)*config.kernel_size(1, 2), (m-1)*(size(mem.mask_inputs{curr_layer_idx}, 2)/config.batch_size)+1:m*size(mem.mask_inputs{curr_layer_idx}, 2)/config.batch_size) = ...
config.IM2COL(in(:,:,n,m), [config.kernel_size(1, 1), config.kernel_size(1, 2)]);
end
end
% only for SR now
gen_mask_patch_cat_idx_for_super_res(mem.mask_inputs{1});
end

0 comments on commit b29ca2d

Please sign in to comment.