Skip to content

Commit

Permalink
Merge branch 'master' into triangle
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Vondrick committed Sep 27, 2013
2 parents b49a6a5 + dedb80b commit 1401d96
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/learnpairdict.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
function pd = learnpairdict(stream, n, k, ny, nx, lambda, iters, sbin, fast),

if ~exist('n', 'var'),
n = 100000;
n = 1000000;
end
if ~exist('k', 'var'),
k = 1000;
k = 1024;
end
if ~exist('ny', 'var'),
ny = 5;
Expand Down Expand Up @@ -93,6 +93,7 @@
param.numThreads = 12;
param.verbose = 1;
param.batchsize = 400;
param.posAlpha = true;

fprintf('ihog: lasso\n');
model = struct();
Expand Down
21 changes: 21 additions & 0 deletions internal/pd2txt.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
% pd2txt(out, pd)
%
% Dumps the paired dictionary 'pd' to output file 'file'
function pd2txt(out, pd),

f = fopen(out, 'w');
fprintf(f, '%f\n', pd.lambda);
fprintf(f, '%i %i\n', pd.ny, pd.nx);
fprintf(f, '%i\n', pd.sbin);
fprintf(f, '%i\n', pd.k);
fprintf(f, '\n');
for i=1:pd.k,
fprintf(f, '%f ', pd.dhog(i, :));
fprintf(f, '\n');
end
fprintf(f, '\n');
for i=1:pd.k,
fprintf(f, '%f ', pd.dgray(i, :));
fprintf(f, '\n');
end
fclose(f);
1 change: 1 addition & 0 deletions invertHOG.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
% solve lasso problem
param.lambda = pd.lambda;
param.mode = 2;
param.pos = true;
a = full(mexLasso(single(windows), pd.dhog, param));
recon = pd.dgray * a;

Expand Down

0 comments on commit 1401d96

Please sign in to comment.