Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ from the command line:

3. `sh install_<your os>.sh`

4. `matlab2011 -nodesktop -nosplash -nojvm -r runFullSims` *(if you're on brie. Otherwise it's just `matlab -nodesktop -nosplash -r runFullSims`)*
4. `matlab2011 -nodesktop -nosplash -r runFullSims` *(if you're on brie. Otherwise it's just `matlab -nodesktop -nosplash -r runFullSims`)*
40 changes: 30 additions & 10 deletions runAnnealBayes.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,46 @@
end
end

for t = 1:T
erdosAnnealRes = cell(I, J, T);
wishAnnealRes = cell(J, T);
matlabpool(4)
parfor t = 1:T
disp(['cur t:' num2str(t) ' out of ' num2str(T)]);
for j = 1:J
load(files{(t-1)*J+j});
da = load(files{(t-1)*J+j});
data = da.data;
dslice = erdosAnnealRes(:,:,t);
for k=1:length(erdosPs)
[covMat bestLP] = simAnnealErdos(@erdosPost,data,numOptRuns,erdosPs(k),.4);
dslice{j,k} = covMat;
erdosAnnealRes(:,:,t) = dslice;
end
if runWish
[wishCovMat bestLP] = simAnneal(@wishPost,data,numOptRuns,b,10*eye(N));
wishAnnealRes{j,t} = wishCovMat;
end
end
disp(['t:' num2str(t) ' finished.']);
end
matlabpool close

% add to bayesSigs
disp('processing annealing results...');
for t = 1:T
for j = 1:J
for k = 1:length(erdosPs)
covMat = erdosAnnealRes{k,j,t};
bayesSigs{k,j}(:,:,t) = reshape(covMat, [ N N 1]);
tBDists(k,j,t) = covMatDist(reshape(bayesSigs{k,j}(:,:,t), [N N]), ...
reshape(trueSigs{j}(:,:,t), [N N]));
reshape(trueSigs{j}(:,:,t), [N N]));
end
if runWish
[covMat bestLP] = simAnneal(@wishPost,data,numOptRuns,b,10*eye(N));
bayesSigs{length(erdosPs)+1,j}(:,:,t) = reshape(covMat, [N N 1]);
wishCovMat = wishAnnealRes{j,t};
bayesSigs{length(erdosPs)+1,j}(:,:,t) = reshape(wishCovMat, [N N 1]);

tBDists(length(erdosPs)+1,j,t) = covMatDist(reshape(bayesSigs{length(erdosPs)+1,j}(:,:,t), [N N]), ...
reshape(trueSigs{j}(:,:,t), [N N]));
reshape(trueSigs{j}(:,:,t), [N N]));
end
end
end


end

disp('finished processing annealing runs');