Statistics
| Branch: | Revision:

chunker-player / chunker_player / QoE_Estimator.c @ 47943338

History | View | Annotate | Download (3.92 KB)

1 01f952d0 GiuseppeTropea
/*
2
 *  Copyright (c) 2009-2011 Carmelo Daniele, Dario Marchese, Diego Reforgiato, Giuseppe Tropea
3
 *  developed for the Napa-Wine EU project. See www.napa-wine.eu
4
 *
5
 *  This is free software; see lgpl-2.1.txt
6
 */
7
8 e11386c0 CsabaKiraly
/**
9
 Generated by Multiple Back-Propagation Version 2.2.2
10
 Multiple Back-Propagation can be freely obtained at http://dit.ipg.pt/MBP
11
*/
12
13
#include <math.h>
14
/**
15
 inputs  - should be an array of 3 element(s), containing the network input(s).
16
 outputs - should be an array of 1 element(s), that will contain the network output(s).
17
 Note : The array inputs will also be changed.Its values will be rescaled between -1 and 1.
18
*/
19
void QoE_Estimator(double * inputs, double * outputs) {
20
        double mainWeights[] = {-0.788223989025525, -0.094474566726867, 1.496739847656628, 1.763686040718159, -1.903030984102726, 0.642334326063278, -1.151808104642765, 0.195778993761345, -2.438147799676302, -0.593447767630059, 0.602159330161696, 1.841888272109078, -1.668291515410757, 1.132531695902347, 1.770256249167634, -1.543624462297342, -0.300179501200067, 0.218045746602884, 0.549917901597161, -0.420158477741495, 0.165459965494116, 0.626640712066218, -0.317482940512069, -0.165924553270408, -3.316089679297547, 0.901781718110168, -2.227550874229060, -0.468212813041442, -0.254505118375575, 1.753316060915204, -0.471577244624611, 0.276860328465251, -8.533724138983054, -7.815997751844567, 0.062513227206194, -0.028703413820191, -0.355241766960234, -1.014473189203496, 0.239401342551138, -0.891442488512514, 0.040038287080412, 1.014695308785556, 1.716301939415027, -1.836208299980111, -2.218906644053716, -0.002026100423785, 0.325609116530568, 2.762985101033591, 1.081971585914914, -6.798320012264649, -0.435605988610366};
21
        double * mw = mainWeights;
22
        double hiddenLayer1outputs[10];
23
        int c;
24
25
        inputs[0] = -1.0 + (inputs[0] - 128.000000000000000) / 1436.000000000000000;
26
        inputs[1] = -1.0 + (inputs[1] - 0.000000000000000) / 10.000000000000000;
27
        inputs[2] = -1.0 + (inputs[2] - 0.000000000000000) / 5.000000000000000;
28
        hiddenLayer1outputs[0] = *mw++;
29
        for(c = 0; c < 3; c++) hiddenLayer1outputs[0] += *mw++ * inputs[c];
30
        hiddenLayer1outputs[0] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[0]));
31
        hiddenLayer1outputs[1] = *mw++;
32
        for(c = 0; c < 3; c++) hiddenLayer1outputs[1] += *mw++ * inputs[c];
33
        hiddenLayer1outputs[1] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[1]));
34
        hiddenLayer1outputs[2] = *mw++;
35
        for(c = 0; c < 3; c++) hiddenLayer1outputs[2] += *mw++ * inputs[c];
36
        hiddenLayer1outputs[2] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[2]));
37
        hiddenLayer1outputs[3] = *mw++;
38
        for(c = 0; c < 3; c++) hiddenLayer1outputs[3] += *mw++ * inputs[c];
39
        hiddenLayer1outputs[3] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[3]));
40
        hiddenLayer1outputs[4] = *mw++;
41
        for(c = 0; c < 3; c++) hiddenLayer1outputs[4] += *mw++ * inputs[c];
42
        hiddenLayer1outputs[4] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[4]));
43
        hiddenLayer1outputs[5] = *mw++;
44
        for(c = 0; c < 3; c++) hiddenLayer1outputs[5] += *mw++ * inputs[c];
45
        hiddenLayer1outputs[5] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[5]));
46
        hiddenLayer1outputs[6] = *mw++;
47
        for(c = 0; c < 3; c++) hiddenLayer1outputs[6] += *mw++ * inputs[c];
48
        hiddenLayer1outputs[6] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[6]));
49
        hiddenLayer1outputs[7] = *mw++;
50
        for(c = 0; c < 3; c++) hiddenLayer1outputs[7] += *mw++ * inputs[c];
51
        hiddenLayer1outputs[7] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[7]));
52
        hiddenLayer1outputs[8] = *mw++;
53
        for(c = 0; c < 3; c++) hiddenLayer1outputs[8] += *mw++ * inputs[c];
54
        hiddenLayer1outputs[8] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[8]));
55
        hiddenLayer1outputs[9] = *mw++;
56
        for(c = 0; c < 3; c++) hiddenLayer1outputs[9] += *mw++ * inputs[c];
57
        hiddenLayer1outputs[9] = 1.0 / (1.0 + exp(-hiddenLayer1outputs[9]));
58
        outputs[0] = *mw++;
59
        for(c = 0; c < 10; c++) outputs[0] += *mw++ * hiddenLayer1outputs[c];
60
        outputs[0] = 1.0 / (1.0 + exp(-outputs[0]));
61
        outputs[0] = 28.546600000000002 + (outputs[0] - 0.000000) * 16.112199999999998;
62
}