IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
fext_parallel.m
Go to the documentation of this file.
1 %> @brief Combines features extracted from two or more blocks in parallel
2 classdef fext_parallel < fext
3  properties
4  blocks;
5  end;
6 
7  methods
8  function o = fext_parallel()
9  o.classtitle = 'Parallel';
10  o.flag_ui = 0;
11  o.flag_trainable = 1;
12  end;
13  end;
14 
15  methods(Access=protected)
16  %> Boots every encapsulated block
17  function o = do_boot(o)
18 
19  for i = 1:length(o.blocks)
20  o.blocks{i} = o.blocks{i}.boot();
21  end;
22  end;
23 
24  %> Trains every encapsulated block
25  function o = do_train(o, data)
26 
27  for i = 1:numel(o.blocks)
28  o.blocks{i} = o.blocks{i}.train(data);
29  end;
30  end;
31 
32  %> output of (k-1)-th block is inputted into k-th block. Final output is the output of the end-th block.
33  function data = do_use(o, data)
34  for i = length(o.blocks):-1:1
35  du(i) = o.blocks{i}.use(data);
36  end;
37 
38  data = data_merge_cols(du);
39  end;
40  end;
41 end
function use(in o, in data)
Applies block to data.
Feature Extraction (Fext) base class.
Definition: fext.m:4
Base Block class.
Definition: block.m:2
function boot(in o)
Configures the structure to deal with new type of data.
function data_merge_cols(in datasets)
Combines features extracted from two or more blocks in parallel.
Definition: fext_parallel.m:2
function train(in o, in data, in varargin)
Trains block.