Skip to content
Snippets Groups Projects
Commit 94f2cdb7 authored by marti's avatar marti
Browse files

Solved bug in saving gaoptions

parent 5447e86a
No related branches found
No related tags found
No related merge requests found
...@@ -12,11 +12,11 @@ close all; ...@@ -12,11 +12,11 @@ close all;
%% Global parameters %% Global parameters
DMDdirectory = '.\data\DMD_patterns\'; % DMD patterns folder, don't forget the last forward (or backward in Windows) slash DMDdirectory = '.\data\DMD_patterns\'; % DMD patterns folder, don't forget the last forward (or backward in Windows) slash
PICdirectory = '.\data\PIC_Merc2\'; % Pictures folder, don't forget the last forward (or backward in Windows) slash PICdirectory = '.\data\PIC_Merc2\'; % Pictures folder, don't forget the last forward (or backward in Windows) slash
filename_results = '.\results.mat'; % write results to this file filename_results = '.\results.mat'; % write results to this file
filename_init = '.\results.mat'; % use results from previous run to initialize this run filename_init = 'results.mat'; % use results from previous run to initialize this run
file_index = 2; % DMD/Picture to use for learning (1=large TU Wien logo). Indexed as in variable PICfiles. file_index = 2; % DMD/Picture to use for learning (1=large TU Wien logo). Indexed as in variable PICfiles.
reflection = true; % true (false): force optimization to det(A)<0 (>0) reflection = true; % true (false): force optimization to det(A)<0 (>0)
genetic_opt = true; % run (or not) genetic optimization (set to false if you only want very fine tuning) genetic_opt = false; % run (or not) genetic optimization (set to false if you only want very fine tuning)
PIC_format = '.png'; % picture format PIC_format = '.png'; % picture format
invertDMD = false; % if necessary, set this to true to use the negative of DMD invertDMD = false; % if necessary, set this to true to use the negative of DMD
invertPIC = false; % if necessary, set this to true to use the negative of PIC invertPIC = false; % if necessary, set this to true to use the negative of PIC
...@@ -144,11 +144,20 @@ disp(log(infidelity(model_parameters.parvec, DMD{file_index}, PIC{file_index}))) ...@@ -144,11 +144,20 @@ disp(log(infidelity(model_parameters.parvec, DMD{file_index}, PIC{file_index})))
%% Save results %% Save results
metadata = struct('DMDfiles',DMDfiles,'PICfiles',PICfiles,... if genetic_opt
'reflection',reflection,'index',file_index,'optflag',exitflag,... metadata = struct('DMDfiles',DMDfiles,'PICfiles',PICfiles,...
'optoutput',optoutput,'gaoptions',gaoptions,'nmoptions',nmoptions,... 'reflection',reflection,'index',file_index,'optflag',exitflag,...
'DMDsize', size(DMD{file_index}), 'PICsize', size(PIC{file_index}),... 'optoutput',optoutput,'gaoptions',gaoptions,'nmoptions',nmoptions,...
'original_DMDsize', original_DMDsize, 'original_PICsize', original_PICsize); 'DMDsize', size(DMD{file_index}), 'PICsize', size(PIC{file_index}),...
'original_DMDsize', original_DMDsize, 'original_PICsize', original_PICsize);
else
metadata = struct('DMDfiles',DMDfiles,'PICfiles',PICfiles,...
'reflection',reflection,'index',file_index,'optflag',exitflag,...
'optoutput',optoutput,'nmoptions',nmoptions,...
'DMDsize', size(DMD{file_index}), 'PICsize', size(PIC{file_index}),...
'original_DMDsize', original_DMDsize, 'original_PICsize', original_PICsize);
end
% A collection of useful prepackaged functions: % A collection of useful prepackaged functions:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment