Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mark Harris
Opus
Commits
08d6653e
Commit
08d6653e
authored
13 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Adds low-energy feature, training with noise
parent
e84fce86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/analysis.c
+45
-21
45 additions, 21 deletions
src/analysis.c
src/mlp_data.c
+58
-120
58 additions, 120 deletions
src/mlp_data.c
src/mlp_train.c
+1
-0
1 addition, 0 deletions
src/mlp_train.c
with
104 additions
and
141 deletions
src/analysis.c
+
45
−
21
View file @
08d6653e
...
...
@@ -84,7 +84,11 @@ typedef struct {
float
cmean
[
8
];
float
std
[
9
];
float
music_prob
;
float
Etracker
;
float
lowECount
;
int
E_count
;
int
last_music
;
int
last_transition
;
int
count
;
}
TonalityAnalysisState
;
...
...
@@ -103,7 +107,7 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
float
band_tonality
[
NB_TBANDS
];
float
logE
[
NB_TBANDS
];
float
BFCC
[
8
];
float
features
[
27
];
float
features
[
100
];
float
frame_tonality
;
float
frame_noisiness
;
const
float
pi4
=
M_PI
*
M_PI
*
M_PI
*
M_PI
;
...
...
@@ -111,10 +115,13 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
float
frame_stationarity
;
float
relativeE
;
float
frame_prob
;
float
alpha
;
float
alpha
,
alphaE
;
float
frame_loudness
;
celt_encoder_ctl
(
celt_enc
,
CELT_GET_MODE
(
&
mode
));
tonal
->
last_transition
++
;
alpha
=
1
.
f
/
IMIN
(
20
,
1
+
tonal
->
count
);
alphaE
=
1
.
f
/
IMIN
(
50
,
1
+
tonal
->
count
);
if
(
tonal
->
count
<
4
)
tonal
->
music_prob
=
.
5
;
...
...
@@ -193,6 +200,7 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
relativeE
=
0
;
info
->
boost_amount
[
0
]
=
info
->
boost_amount
[
1
]
=
0
;
info
->
boost_band
[
0
]
=
info
->
boost_band
[
1
]
=
0
;
frame_loudness
=
0
;
for
(
b
=
0
;
b
<
NB_TBANDS
;
b
++
)
{
float
E
=
0
,
tE
=
0
,
nE
=
0
;
...
...
@@ -209,7 +217,9 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
tonal
->
E
[
tonal
->
E_count
][
b
]
=
E
;
frame_noisiness
+=
nE
/
(
1e-15
+
E
);
logE
[
b
]
=
log
(
E
+
EPSILON
);
frame_loudness
+=
sqrt
(
E
+
1e-10
);
/* Add a reasonable noise floor */
logE
[
b
]
=
log
(
E
+
1e-10
);
tonal
->
lowE
[
b
]
=
MIN32
(
logE
[
b
],
tonal
->
lowE
[
b
]
+
.
01
);
tonal
->
highE
[
b
]
=
MAX32
(
logE
[
b
],
tonal
->
highE
[
b
]
-
.
1
);
if
(
tonal
->
highE
[
b
]
<
tonal
->
lowE
[
b
]
+
1
)
...
...
@@ -250,6 +260,11 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
}
tonal
->
prev_band_tonality
[
b
]
=
band_tonality
[
b
];
}
frame_loudness
=
20
*
log10
(
frame_loudness
);
tonal
->
Etracker
=
MAX32
(
tonal
->
Etracker
-
.
03
,
frame_loudness
);
tonal
->
lowECount
*=
(
1
-
alphaE
);
if
(
frame_loudness
<
tonal
->
Etracker
-
30
)
tonal
->
lowECount
+=
alphaE
;
for
(
i
=
0
;
i
<
8
;
i
++
)
{
...
...
@@ -288,21 +303,21 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
tonal
->
count
++
;
info
->
tonality
=
frame_tonality
;
for
(
i
=
0
;
i
<
5
;
i
++
)
for
(
i
=
0
;
i
<
4
;
i
++
)
features
[
i
]
=
-
0
.
12299
*
(
BFCC
[
i
]
+
tonal
->
mem
[
i
+
24
])
+
0
.
49195
*
(
tonal
->
mem
[
i
]
+
tonal
->
mem
[
i
+
16
])
+
0
.
69693
*
tonal
->
mem
[
i
+
8
]
-
1
.
4349
*
tonal
->
cmean
[
i
];
for
(
i
=
0
;
i
<
5
;
i
++
)
tonal
->
cmean
[
i
]
=
(
1
-
alpha
)
*
tonal
->
cmean
[
i
]
+
alpha
*
(
i
==
0
)
*
BFCC
[
i
];
for
(
i
=
0
;
i
<
4
;
i
++
)
tonal
->
cmean
[
i
]
=
(
1
-
alpha
)
*
tonal
->
cmean
[
i
]
+
alpha
*
BFCC
[
i
];
for
(
i
=
0
;
i
<
5
;
i
++
)
features
[
5
+
i
]
=
0
.
63246
*
(
BFCC
[
i
]
-
tonal
->
mem
[
i
+
24
])
+
0
.
31623
*
(
tonal
->
mem
[
i
]
-
tonal
->
mem
[
i
+
16
]);
for
(
i
=
0
;
i
<
4
;
i
++
)
features
[
10
+
i
]
=
0
.
53452
*
(
BFCC
[
i
]
+
tonal
->
mem
[
i
+
24
])
-
0
.
26726
*
(
tonal
->
mem
[
i
]
+
tonal
->
mem
[
i
+
16
])
-
0
.
53452
*
tonal
->
mem
[
i
+
8
];
features
[
4
+
i
]
=
0
.
63246
*
(
BFCC
[
i
]
-
tonal
->
mem
[
i
+
24
])
+
0
.
31623
*
(
tonal
->
mem
[
i
]
-
tonal
->
mem
[
i
+
16
]);
for
(
i
=
0
;
i
<
3
;
i
++
)
features
[
8
+
i
]
=
0
.
53452
*
(
BFCC
[
i
]
+
tonal
->
mem
[
i
+
24
])
-
0
.
26726
*
(
tonal
->
mem
[
i
]
+
tonal
->
mem
[
i
+
16
])
-
0
.
53452
*
tonal
->
mem
[
i
+
8
];
if
(
tonal
->
count
>
5
)
{
for
(
i
=
0
;
i
<
9
;
i
++
)
tonal
->
std
[
i
]
=
(
1
-
alpha
)
*
tonal
->
std
[
i
]
+
alpha
*
features
[
5
+
i
]
*
features
[
5
+
i
];
tonal
->
std
[
i
]
=
(
1
-
alpha
)
*
tonal
->
std
[
i
]
+
alpha
*
features
[
i
]
*
features
[
i
];
}
for
(
i
=
0
;
i
<
8
;
i
++
)
...
...
@@ -312,36 +327,45 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
tonal
->
mem
[
i
+
8
]
=
tonal
->
mem
[
i
];
tonal
->
mem
[
i
]
=
BFCC
[
i
];
}
features
[
14
]
=
info
->
tonality
;
features
[
15
]
=
info
->
activity
;
features
[
16
]
=
frame_stationarity
;
features
[
17
]
=
info
->
tonality_slope
;
for
(
i
=
0
;
i
<
9
;
i
++
)
features
[
18
+
i
]
=
sqrt
(
tonal
->
std
[
i
]);
features
[
11
+
i
]
=
sqrt
(
tonal
->
std
[
i
]);
features
[
20
]
=
info
->
tonality
;
features
[
21
]
=
info
->
activity
;
features
[
22
]
=
frame_stationarity
;
features
[
23
]
=
info
->
tonality_slope
;
features
[
24
]
=
tonal
->
lowECount
;
#ifndef FIXED_POINT
mlp_process
(
&
net
,
features
,
&
frame_prob
);
/* Adds a "probability dead zone", with a cap on certainty */
frame_prob
=
.
90
*
frame_prob
*
frame_prob
*
frame_prob
;
frame_prob
=
.
5
*
(
frame_prob
+
1
);
frame_prob
=
MAX16
(.
01
f
,
MIN16
(
0
.
99
f
,
frame_prob
));
/*frame_prob = .45*frame_prob + .55*frame_prob*frame_prob*frame_prob;*/
/*printf("%f\n", frame_prob);*/
{
float
tau
,
beta
;
float
p0
,
p1
;
tau
=
.
0001
;
float
max_certainty
;
/* One transition every 3 minutes */
tau
=
.
00005
;
beta
=
.
1
;
max_certainty
=
1
.
f
/
(
10
+
1
*
tonal
->
last_transition
);
p0
=
(
1
-
tonal
->
music_prob
)
*
(
1
-
tau
)
+
tonal
->
music_prob
*
tau
;
p1
=
tonal
->
music_prob
*
(
1
-
tau
)
+
(
1
-
tonal
->
music_prob
)
*
tau
;
p0
*=
pow
(
1
-
frame_prob
,
beta
);
p1
*=
pow
(
frame_prob
,
beta
);
tonal
->
music_prob
=
MAX16
(
0
.
01
f
,
MIN16
(
0
.
99
f
,
p1
/
(
p0
+
p1
)));
tonal
->
music_prob
=
MAX16
(
max_certainty
,
MIN16
(
1
-
max_certainty
,
p1
/
(
p0
+
p1
)));
info
->
music_prob
=
tonal
->
music_prob
;
/*printf("%f %f\n", frame_prob, info->music_prob);*/
}
if
(
tonal
->
last_music
!=
(
tonal
->
music_prob
>
.
5
))
tonal
->
last_transition
=
0
;
tonal
->
last_music
=
tonal
->
music_prob
>
.
5
;
#else
info
->
music_prob
=
0
;
#endif
/*for (i=0;i<2
7
;i++)
/*for (i=0;i<2
5
;i++)
printf("%f ", features[i]);
printf("\n");*/
...
...
This diff is collapsed.
Click to expand it.
src/mlp_data.c
+
58
−
120
View file @
08d6653e
#include
"mlp.h"
/* RMS error was 0.
069845
, seed was 13220
25605
*/
/* RMS error was 0.
213119
, seed was 13220
73261
*/
static
const
float
weights
[
58
1
]
=
{
static
const
float
weights
[
27
1
]
=
{
/* hidden layer */
1
.
52937
,
0
.
240116
,
-
0
.
0808422
,
-
0
.
01
9036
,
-
0
.
199579
,
-
0
.
07772
84
,
0
.
05061
83
,
-
0
.
01557
93
,
-
0
.
181522
,
0
.
032
96
,
-
0
.
0133165
,
0
.
179916
,
-
0
.
122064
,
-
0
.
0236
821
,
-
0
.
192921
,
-
7
.
41934
,
-
0
.
1775
,
3
.
17407
,
6
.
74356
,
-
0
.
976582
,
-
0
.
206271
,
-
2
.
36372
,
-
0
.
187823
,
0
.
07213
86
,
0
.
182445
,
1
.
05044
,
0
.
0536177
,
-
0
.
07
9352
,
-
7
.
53152
,
-
0
.
000
840837
,
0
.
16012
,
-
0
.
737235
,
0
.
907956
,
-
0
.
977085
,
-
0
.
20257
,
0
.
240006
,
-
0
.
125651
,
0
.
02
92286
,
0
.
0881101
,
-
0
.
004200
89
,
0
.
144169
,
-
0
.
411473
,
0
.
518353
,
24
.
7599
,
7
.
13795
,
-
0
.
198564
,
-
8
.
46416
,
1
.
62151
,
1
.
97394
,
1
.
06731
,
0
.
212259
,
-
0
.
294498
,
-
1
.
43245
,
-
1
.
7405
,
-
2
.
24067
,
0
.
108053
,
-
7
.
95142
,
-
0
.
124435
,
-
0
.
022073
9
,
-
0
.
0720463
,
0
.
034474
8
,
0
.
05431
95
,
-
0
.
027
8653
,
-
0
.
00
880633
,
-
0
.
0800235
,
-
0
.
062
8277
,
0
.
01
8996
,
-
0
.
136465
,
-
0
.
0202
844
,
-
0
.
0871884
,
-
0
.
0011625
8
,
-
1
.
47936
,
0
.
305648
,
2
.
91397
,
-
0
.
628477
,
0
.
379082
,
1
.
010
97
,
0
.
108782
,
0
.
719828
,
1
.
80274
,
-
0
.
180042
,
-
1
.
30241
,
-
0
.
645234
,
0
.
208385
,
0
.
838486
,
0
.
214029
,
-
0
.
0075
8414
,
0
.
418987
,
0
.
325509
,
-
0
.
350113
,
-
0
.
229126
,
0
.
064
8517
,
-
0
.
061675
,
-
0
.
146279
,
-
0
.
026
9004
,
0
.
117271
,
-
0
.
105326
,
0
.
345759
,
0
.
143439
,
-
3
.
98419
,
0
.
755833
,
-
1
.
65706
,
-
0
.
890625
,
1
.
08994
,
0
.
87214
,
1
.
44122
,
-
0
.
243985
,
-
0
.
952904
,
-
0
.
838194
,
-
1
.
98792
,
-
0
.
638013
,
0
.
597385
,
5
.
6797
,
0
.
04361
89
,
-
0
.
013
998
,
0
.
031
9089
,
-
0
.
0968088
,
-
0
.
017217
8
,
0
.
04
81363
,
-
0
.
041
8244
,
-
0
.
0131255
,
-
0
.
0462
831
,
0
.
04
83697
,
0
.
0402757
,
-
0
.
127525
,
0
.
0414
987
,
-
0
.
187244
,
3
.
89027
,
-
4
.
62985
,
0
.
516058
,
-
1
.
22865
,
-
0
.
190653
,
-
0
.
165429
,
0
.
100515
,
-
1
.
0322
8
,
-
0
.
321134
,
0
.
0992221
,
0
.
606127
,
0
.
0554443
,
1
.
45482
,
-
0
.
253561
,
0
.
096237
,
-
0
.
02466
94
,
0
.
371363
,
-
0
.
0914336
,
0
.
103553
,
0
.
01
89161
,
-
0
.
010524
9
,
0
.
0604053
,
0
.
0411006
,
0
.
063
9854
,
0
.
109094
,
-
0
.
00
979879
,
0
.
324731
,
-
0
.
0567231
,
-
2
.
01
856
,
1
.
16363
,
1
.
30608
,
-
0
.
289826
,
0
.
159106
,
-
0
.
0876134
,
0
.
327582
,
0
.
0923214
,
-
0
.
247681
,
0
.
253649
,
0
.
138327
,
-
0
.
872563
,
-
2
.
63221
,
0
.
86812
,
0
.
0144657
,
0
.
0157262
,
0
.
02
86942
,
0
.
02
95632
,
0
.
047
8701
,
-
0
.
003
98791
,
0
.
05216
85
,
0
.
0127316
,
-
0
.
066
8749
,
-
0
.
03
83492
,
-
0
.
00
951385
,
-
0
.
00556075
,
0
.
0322671
,
0
.
00116312
,
10
.
1702
,
0
.
908796
,
0
.
344389
,
-
9
.
78791
,
-
0
.
0103152
,
-
0
.
814278
,
0
.
224774
,
-
0
.
84427
,
-
1
.
20048
,
0
.
111694
,
1
.
02544
,
0
.
475563
,
0
.
18777
,
-
1
.
12989
,
0
.
04354
92
,
-
0
.
121442
,
0
.
275871
,
0
.
16293
,
-
0
.
544925
,
0
.
508003
,
1
.
13018
,
0
.
472551
,
-
0
.
270614
,
0
.
65337
,
0
.
57463
,
0
.
597287
,
0
.
351477
,
0
.
122146
,
-
13
.
7731
,
-
1
.
05173
,
-
0
.
607099
,
-
1
.
8646
,
-
0
.
185848
,
-
0
.
17991
,
-
0
.
247395
,
0
.
270694
,
0
.
674929
,
0
.
138423
,
0
.
542756
,
-
0
.
399379
,
-
2
.
26304
,
0
.
474791
,
0
.
107511
,
0
.
280356
,
-
0
.
76117
,
-
0
.
711896
,
2
.
34404
,
-
0
.
246417
,
-
0
.
0171513
,
-
0
.
743835
,
0
.
221894
,
-
0
.
06
88801
,
0
.
769435
,
-
0
.
172876
,
0
.
02757
87
,
-
1
.
09694
,
43
.
5206
,
4
.
98303
,
9
.
28984
,
-
9
.
0177
8
,
0
.
412928
,
0
.
797472
,
0
.
504419
,
0
.
143125
,
-
2
.
30534
,
0
.
187757
,
0
.
060060
8
,
0
.
03
96294
,
2
.
83625
,
-
2
.
27696
,
0
.
0577414
,
0
.
025
9672
,
-
0
.
20545
,
0
.
0843962
,
-
0
.
241982
,
-
0
.
181173
,
-
0
.
0303534
,
0
.
368835
,
-
0
.
325961
,
0
.
300561
,
-
0
.
0341177
,
0
.
0938862
,
-
0
.
123384
,
-
0
.
0835186
,
-
6
.
73898
,
1
.
21737
,
2
.
19072
,
1
.
0447
9
,
0
.
0516565
,
-
0
.
809079
,
0
.
149924
,
-
0
.
397419
,
-
2
.
47109
,
-
0
.
320068
,
-
0
.
0366
975
,
-
0
.
18933
,
0
.
952215
,
2
.
08882
,
0
.
015015
9
,
0
.
00712614
,
0
.
139391
,
-
0
.
0632642
,
-
0
.
0045
8523
,
0
.
0274453
,
0
.
00354731
,
-
0
.
0144
94
,
-
0
.
00060
8929
,
0
.
0232
959
,
0
.
0061573
8
,
0
.
0222414
,
0
.
109995
,
-
0
.
0635244
,
1
.
51811
,
-
0
.
00460
887
,
0
.
899197
,
1
.
56449
,
-
0
.
00
806591
,
0
.
310737
,
-
0
.
441759
,
-
0
.
615191
,
0
.
305784
,
-
0
.
118165
,
-
0
.
690831
,
-
0
.
932832
,
-
0
.
468231
,
0
.
869044
,
0
.
074
8202
,
-
0
.
07
80407
,
0
.
07
80088
,
0
.
02460
9
,
-
0
.
0051
9675
,
-
0
.
06
87518
,
0
.
044041
,
-
0
.
0570666
,
0
.
037407
,
-
0
.
14082
,
0
.
034
8575
,
-
0
.
14069
,
0
.
180557
,
-
0
.
0571276
,
-
32
.
4574
,
-
0
.
0710406
,
-
5
.
39569
,
2
.
65794
,
0
.
181025
,
0
.
493114
,
0
.
111346
,
0
.
506378
,
1
.
16452
,
-
0
.
563642
,
-
0
.
278853
,
-
0
.
447802
,
0
.
232193
,
-
6
.
42728
,
-
0
.
109856
,
0
.
022
866
,
-
0
.
0839836
,
-
0
.
0839169
,
-
0
.
319109
,
-
0
.
902373
,
-
0
.
157901
,
0
.
298015
,
-
0
.
16787
,
0
.
0928949
,
-
0
.
71114
,
0
.
03731
98
,
-
0
.
072261
9
,
-
0
.
122185
,
-
17
.
1527
,
4
.
88383
,
2
.
38947
,
8
.
88169
,
-
0
.
00
947956
,
0
.
0823654
,
0
.
799126
,
1
.
28023
,
0
.
526565
,
-
0
.
014
9172
,
-
1
.
12657
,
-
0
.
24462
,
-
3
.
23915
,
0
.
005
8726
,
0
.
127453
,
0
.
29968
,
-
0
.
208872
,
0
.
0242737
,
0
.
479791
,
-
3
.
21354
,
1
.
52516
,
-
0
.
692431
,
-
0
.
165378
,
-
0
.
731346
,
0
.
314575
,
-
0
.
569414
,
-
0
.
0801118
,
0
.
086923
,
8
.
02
887
,
-
0
.
235296
,
-
0
.
276748
,
-
7
.
72231
,
-
0
.
115556
,
-
0
.
976338
,
0
.
0980647
,
-
2
.
55159
,
-
0
.
410249
,
0
.
968147
,
-
0
.
131815
,
-
0
.
511169
,
0
.
0891097
,
-
1
.
20927
,
-
0
.
013714
,
0
.
210441
,
0
.
0838065
,
0
.
161028
,
-
0
.
01217
,
-
0
.
003525
92
,
0
.
0893854
,
-
0
.
07
87796
,
0
.
065172
9
,
-
0
.
021
9344
,
-
0
.
000346421
,
0
.
180829
,
0
.
0847809
,
0
.
116443
,
0
.
0632044
,
-
1
.
31752
,
1
.
0611
,
-
1
.
73675
,
-
0
.
072
8349
,
0
.
183918
,
0
.
0451227
,
-
0
.
525749
,
-
0
.
255804
,
0
.
10796
,
-
0
.
300506
,
0
.
595564
,
0
.
697484
,
-
1
.
05565
,
0
.
0174366
,
0
.
273086
,
0
.
00330
815
,
0
.
133234
,
-
0
.
0170445
,
0
.
385873
,
-
0
.
392262
,
0
.
441475
,
-
0
.
244255
,
0
.
159125
,
0
.
102305
,
0
.
271859
,
-
0
.
04773
84
,
0
.
0994522
,
12
.
1298
,
-
1
.
23951
,
1
.
33346
,
-
0
.
669615
,
0
.
0928112
,
0
.
301609
,
-
0
.
0872949
,
-
0
.
530852
,
-
0
.
791418
,
-
0
.
211807
,
0
.
233519
,
0
.
0077
9643
,
-
0
.
208301
,
-
11
.
4151
,
-
0
.
0142366
,
0
.
0636537
,
0
.
0716135
,
-
0
.
0404406
,
-
0
.
116361
,
-
0
.
172063
,
-
0
.
229208
,
-
0
.
0866464
,
-
0
.
134274
,
0
.
047322
9
,
-
0
.
190149
,
-
0
.
112906
,
-
0
.
054
8081
,
-
0
.
15995
,
-
0
.
761112
,
6
.
38996
,
0
.
687383
,
-
5
.
54174
,
0
.
27056
,
0
.
156832
,
0
.
410845
,
1
.
73844
,
0
.
868191
,
-
0
.
415126
,
-
0
.
362902
,
-
0
.
488269
,
-
0
.
679177
,
2
.
90133
,
0
.
0325332
,
-
0
.
13787
,
-
0
.
099454
,
-
0
.
125178
,
0
.
03124
95
,
0
.
0215725
,
-
0
.
01
80029
,
0
.
0007
86626
,
-
0
.
0165
868
,
0
.
0022
8741
,
0
.
04
89981
,
-
0
.
142374
,
-
0
.
070654
,
-
0
.
0980396
,
-
5
.
4804
,
-
1
.
42786
,
0
.
370574
,
5
.
29591
,
-
0
.
103996
,
-
0
.
291983
,
-
0
.
220591
,
-
0
.
445399
,
0
.
153502
,
0
.
0372166
,
0
.
181633
,
0
.
06167
84
,
0
.
69087
,
-
0
.
246005
,
0
.
179546
,
-
0
.
055365
9
,
0
.
04
86791
,
-
0
.
429761
,
0
.
379239
,
-
0
.
293269
,
0
.
370228
,
-
0
.
232783
,
0
.
192865
,
-
0
.
153421
,
0
.
412135
,
-
0
.
181689
,
0
.
0816143
,
-
0
.
245055
,
0
.
851942
,
-
0
.
771025
,
-
1
.
52187
,
-
0
.
656314
,
0
.
638177
,
0
.
882082
,
-
0
.
466803
,
-
0
.
193064
,
0
.
233788
,
1
.
40801
,
0
.
388835
,
-
0
.
206663
,
1
.
3398
,
-
10
.
2146
,
-
0
.
086454
,
-
0
.
33979
,
-
0
.
11021
,
-
0
.
044777
,
0
.
03
83833
,
-
0
.
171588
,
-
0
.
06
86855
,
0
.
045220
9
,
0
.
057
8143
,
0
.
0676435
,
-
0
.
24006
,
-
0
.
40246
,
-
0
.
054
9284
,
0
.
007
86321
,
-
11
.
5892
,
13
.
4008
,
-
0
.
148449
,
1
.
4845
,
-
0
.
198285
,
-
0
.
280658
,
-
2
.
56881
,
-
0
.
597918
,
0
.
071303
9
,
-
0
.
012
9557
,
0
.
907337
,
-
1
.
36003
,
0
.
357266
,
0
.
693025
,
0
.
12016
,
-
0
.
2263
,
0
.
254033
,
-
0
.
128153
,
0
.
14498
,
-
0
.
139098
,
0
.
160911
,
-
0
.
101749
,
-
0
.
04
95703
,
-
0
.
064263
,
0
.
05
83359
,
0
.
00431
816
,
0
.
137356
,
0
.
199892
,
0
.
0859346
,
-
0
.
159615
,
-
0
.
109472
,
-
0
.
483732
,
-
0
.
0564564
,
-
0
.
1935
,
1
.
94157
,
0
.
975237
,
-
1
.
99915
,
-
0
.
566324
,
0
.
457616
,
1
.
05455
,
-
0
.
0896938
,
0
.
119609
,
-
0
.
135437
,
0
.
04
85118
,
-
0
.
168008
,
0
.
099568
,
-
0
.
164749
,
0
.
0837494
,
0
.
043713
,
-
0
.
002
98809
,
0
.
031252
9
,
0
.
012
8313
,
0
.
021767
9
,
-
0
.
01
85004
,
0
.
0452
,
-
0
.
02
87335
,
-
0
.
0872755
,
0
.
145857
,
-
0
.
534325
,
0
.
255553
,
1
.
68378
,
-
0
.
212433
,
-
0
.
416954
,
0
.
558858
,
0
.
295516
,
2
.
43878
,
0
.
105586
,
0
.
0929094
,
0
.
04614
83
,
0
.
0715373
,
0
.
054567
,
0
.
04
99543
,
-
0
.
05
89255
,
0
.
051
8142
,
0
.
143022
,
0
.
0927234
,
0
.
0891022
,
-
0
.
0743216
,
-
0
.
04
97012
,
-
0
.
150656
,
0
.
0945407
,
-
0
.
438528
,
-
0
.
272849
,
-
0
.
613949
,
-
0
.
0907026
,
-
0
.
0846951
,
-
3
.
10146
,
-
1
.
64289
,
-
0
.
538651
,
-
1
.
76321
,
-
2
.
90649
,
-
0
.
738564
,
0
.
103786
,
0
.
07064
84
,
0
.
194004
,
0
.
0256
865
,
-
0
.
007555
91
,
-
0
.
014
8712
,
0
.
024
9828
,
-
0
.
02
88777
,
0
.
0913917
,
0
.
0510661
,
0
.
117025
,
-
0
.
00722344
,
-
0
.
175031
,
0
.
283402
,
-
0
.
312663
,
0
.
19557
,
0
.
067
8725
,
-
0
.
04
88421
,
0
.
296382
,
0
.
123097
,
6
.
72257
,
0
.
296421
,
0
.
219984
,
-
12
.
444
,
-
1
.
80343
,
4
.
56011
,
0
.
04
81676
,
0
.
027474
,
0
.
0752634
,
0
.
02436
83
,
-
0
.
0166126
,
0
.
004
84121
,
0
.
007
82469
,
-
0
.
02105
89
,
-
0
.
000731
938
,
-
0
.
0244603
,
-
0
.
0222773
,
-
0
.
0433534
,
-
0
.
250382
,
-
0
.
118675
,
-
1
.
05746
,
-
0
.
217
,
-
0
.
0425
872
,
-
0
.
231335
,
-
0
.
500574
,
0
.
477752
,
0
.
247352
,
0
.
611455
,
0
.
956451
,
4
.
80434
,
0
.
670325
,
-
0
.
394506
,
0
.
0344075
,
0
.
148722
,
0
.
136525
,
0
.
110126
,
-
0
.
066
8243
,
0
.
01241
8
,
-
0
.
0307
898
,
0
.
0666452
,
-
0
.
0171564
,
0
.
136063
,
0
.
026
8092
,
-
0
.
07253
83
,
0
.
074
9385
,
0
.
0845712
,
0
.
48549
,
0
.
02
95497
,
0
.
276011
,
0
.
479614
,
0
.
640422
,
-
0
.
245035
,
-
0
.
751258
,
-
1
.
0434
,
-
3
.
62517
,
-
2
.
84518
,
3
.
95485
,
-
1
.
64489
,
0
.
209162
,
-
0
.
132563
,
0
.
252206
,
-
0
.
135669
,
0
.
042
8919
,
-
0
.
07
99343
,
0
.
0932631
,
-
0
.
07
81831
,
0
.
189111
,
-
0
.
0977977
,
0
.
110201
,
0
.
02356
82
,
0
.
0302204
,
-
0
.
240156
,
-
0
.
289576
,
0
.
136261
,
0
.
363298
,
0
.
484825
,
0
.
389438
,
0
.
193011
,
-
0
.
566411
,
-
0
.
0007
98943
,
1
.
53221
,
-
2
.
99065
,
-
0
.
226329
,
2
.
19154
,
-
0
.
00
811221
,
-
0
.
0912965
,
-
0
.
0275327
,
-
0
.
0861904
,
0
.
00
839052
,
0
.
0904659
,
-
0
.
00
893919
,
0
.
0360
984
,
-
0
.
015071
,
-
0
.
06472
92
,
-
0
.
07342
95
,
-
0
.
026141
9
,
-
0
.
402868
,
0
.
176918
,
-
0
.
212574
,
-
0
.
00624752
,
-
0
.
0633636
,
0
.
406343
,
-
0
.
274925
,
0
.
432039
,
4
.
29364
,
0
.
231697
,
-
1
.
06323
,
2
.
08855
,
-
30
.
2379
,
0
.
0637
952
,
0
.
120849
,
-
0
.
063
9096
,
0
.
13732
,
-
0
.
180987
,
0
.
191846
,
0
.
368452
,
0
.
209571
,
0
.
164176
,
-
0
.
037
8771
,
-
0
.
11027
,
0
.
0156665
,
0
.
020741
8
,
0
.
025
9591
,
-
0
.
023
9737
,
-
0
.
00352567
,
-
0
.
0545034
,
0
.
0656311
,
-
0
.
0817674
,
0
.
521953
,
0
.
241775
,
7
.
41463
,
0
.
765259
,
0
.
863685
,
-
2
.
13211
,
0
.
310299
,
2
.
10354
,
0
.
036066
9
,
-
0
.
171618
,
-
0
.
148112
,
-
0
.
279292
,
0
.
709935
,
0
.
845869
,
0
.
4868
,
0
.
224496
,
0
.
343149
,
0
.
202645
,
-
0
.
091977
,
0
.
0201541
,
0
.
07702
9
,
0
.
025
9409
,
0
.
016736
9
,
0
.
07
80503
,
0
.
118852
,
-
0
.
18355
,
-
0
.
158253
,
0
.
145728
,
5
.
04716
,
-
0
.
126459
,
1
.
02251
,
1
.
57638
,
0
.
064651
8
,
/* output layer */
-
9
.
51428
,
-
0
.
855928
,
0
.
674433
,
-
1
.
45903
,
-
1
.
15718
,
3
.
25902
,
-
0
.
85739
,
1
.
45401
,
-
0
.
346373
,
0
.
563214
,
-
0
.
97603
,
1
.
52396
,
-
0
.
804053
,
-
0
.
56299
,
0
.
213345
,
-
2
.
50068
,
-
1
.
06777
,
-
1
.
073
,
-
2
.
88991
,
-
1
.
10272
,
-
2
.
77165
,
};
-
3
.
6362
,
1
.
96839
,
1
.
93382
,
-
2
.
10686
,
2
.
27415
,
0
.
599088
,
-
0
.
615374
,
-
2
.
02317
,
0
.
383689
,
0
.
360266
,
0
.
532961
,
};
static
const
int
topo
[
3
]
=
{
2
7
,
2
0
,
1
};
static
const
int
topo
[
3
]
=
{
2
5
,
1
0
,
1
};
const
MLP
net
=
{
3
,
...
...
This diff is collapsed.
Click to expand it.
src/mlp_train.c
+
1
−
0
View file @
08d6653e
...
...
@@ -154,6 +154,7 @@ double compute_gradient(MLPTrain *net, float *inputs, float *outputs, int nbSamp
error
[
i
]
=
out
[
i
]
-
netOut
[
i
];
rms
+=
error
[
i
]
*
error
[
i
];
*
error_rate
+=
fabs
(
error
[
i
])
>
1
;
//error[i] = error[i]/(1+fabs(error[i]));
}
/* Back-propagate error */
for
(
i
=
0
;
i
<
outDim
;
i
++
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment