Skip to content

Commit

Permalink
bug_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yechengxi committed May 9, 2017
1 parent 76c0e5f commit 71c779d
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CoreModules/layers/bnorm.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
end

if ~isfield(opts.parameters, 'mom_bn')
opts.parameters.mom_bn=0.999;
opts.parameters.mom_bn=0.1;% this one needs to be small
end

if ~isfield(opts.parameters, 'simple_bn')
Expand Down
9 changes: 3 additions & 6 deletions CoreModules/layers/conv_layer_2d.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,27 +136,24 @@
fk=permute(opts.layer{opts.current_layer}.fk,[1,2,4,3]);

for i=1:in
fft_corr=fdzdy.*conj(fk(:,:,:,i));
fft_corr=conj(fk(:,:,:,i)).*fdzdy;
y(:,:,i,:)=sum(fft_corr,3);
end
y=real(ifft2(y));

%next line is a dirty circular shift, according to matlab fft implementation.
%next line is a 'dirty' circular shift.
y=circshift(y,[(k1-1),(k2-1)]);

if(~isempty(pad))
y=y(1+pad(1):pad(1)+original_size_r,1+pad(3):pad(3)+original_size_c,:,:);
end



%%%dzdw
dzdw=zeros(k1,k2,in,out,'like',I);


for o=1:out

fft_corr=opts.layer{opts.current_layer}.fI.*conj(fdzdy(:,:,o,:));
fft_corr=conj(fdzdy(:,:,o,:)).*opts.layer{opts.current_layer}.fI;
fft_corr=mean(fft_corr,4); %minibatch averaging
fft_corr=real(ifft2(fft_corr));
dzdw(:,:,:,o)= fft_corr(1:k1,1:k2,:,:);% requires thorough understanding of fft, and the shifts
Expand Down
Binary file removed Documentations/lightnet-intro.pdf
Binary file not shown.
Binary file modified Documentations/lightnet-supplementary-materials.pdf
Binary file not shown.
Binary file added Documentations/lightnet-versatile-standalone.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion Log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@
20170328
1. Thanks to the help from Mathworks (J.H. Wang) we have used the implicit expansion feature (introduced in Matlab R2016b) to replace bsxfun in LightNet.
20170411
1. 1d convolution layer added.
1. 1d convolution layer added.

1 change: 0 additions & 1 deletion RNN/Main_Char_RNN.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
save([fullfile(opts.output_dir2,[opts.output_name2,num2str(ep),'.mat'])],'net','parameters','results');
end

copyfile(fullfile(opts.output_dir2,[opts.output_name2,num2str(ep),'.mat']),fullfile(opts.output_dir,opts.output_name));



Expand Down

0 comments on commit 71c779d

Please sign in to comment.