-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollect_data.m
18 lines (14 loc) · 895 Bytes
/
collect_data.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function results = collect_data(rep,partition,run_data,cfg,results)
%% COLLECT_DATA collects NEAT results
% Population and elites
results.popArr{rep,partition} = run_data.population;
results.eliteArr{rep,partition} = run_data.elite;
% Connections and Nodes
results.connsArr(rep,partition,:,:) = [run_data.conns repmat(run_data.conns(:,end),1,cfg.maxGen - size(run_data.nodes,2))];
results.nodesArr(rep,partition,:,:) = [run_data.nodes repmat(run_data.nodes(:,end),1,cfg.maxGen - size(run_data.nodes,2))];
% Train and test errors
results.train_error(cfg.data.num_partitions*(rep-1) + partition,:) = ...
[[run_data.elite.error] repmat(run_data.elite(end).error,1,cfg.maxGen - size(run_data.nodes,2))];
results.test_error(cfg.data.num_partitions*(rep-1) + partition,:) = ...
[[run_data.elite.error_test] repmat(run_data.elite(end).error_test,1,cfg.maxGen - size(run_data.nodes,2))];
end