18.03.2014 Views

Recognition of facial expressions - Knowledge Based Systems ...

Recognition of facial expressions - Knowledge Based Systems ...

Recognition of facial expressions - Knowledge Based Systems ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• The basic vanilla version back-propagation algorithm minimizes the<br />

squared error cost function and uses the three-layer elementary back<br />

propagation topology. Also known as the generalized delta rule.<br />

Advantages<br />

- it is capable <strong>of</strong> storing many more patterns than the number <strong>of</strong> FA dimensions<br />

- it is able to acquire complex nonlinear mappings<br />

Limitations<br />

- it requires extremely long training time<br />

- <strong>of</strong>fline encoding<br />

- inability to know how to precisely generate any arbitrary mapping procedure<br />

The C++ class that handles the operations related to the ANN is presented in Listing 3.<br />

//-----------------------------<br />

1: class nn<br />

2: {<br />

3: model&m;<br />

4: int ni,nh,no;<br />

5: float i[NI],h[NH],o[NO],eh[NH],eo[NO],w1[NI][NH],w2[NH][NO];<br />

6: public:<br />

7: nn(model&,int,int,int);<br />

8: void train(void);<br />

9: void test(void);<br />

10: void save(char*);<br />

11: void load(char*);<br />

12: private:<br />

13: void randomWeights(void);<br />

14: float f(float);<br />

15: float df(float);<br />

16: void pass();<br />

17: float trainSample(int);<br />

18: };<br />

//-----------------------------<br />

Listing 3. C++ class to handle the ANN<br />

The class presented <strong>of</strong>fers the possibility to save a defined structure <strong>of</strong> ANN including<br />

the weights and to load an already developed one. The source <strong>of</strong> the ANN routines is<br />

presented in the appendix.<br />

- 51 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!