summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-11-15 13:54:04 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-11-15 13:54:04 -0500
commitd76f8e33bbe34c795ce5b3a980d8c7216c9112b8 (patch)
tree54a5fff2382fec09e9c2340b68c5ab2460635ccc
parent6d6fdfe467589e7654ff517f3f955f9558537f5e (diff)
downloadopus-d76f8e33bbe34c795ce5b3a980d8c7216c9112b8.tar.gz
Retrained speech/music detector for new frame size
-rw-r--r--src/analysis.c8
-rw-r--r--src/mlp_data.c190
2 files changed, 98 insertions, 100 deletions
diff --git a/src/analysis.c b/src/analysis.c
index 7a28395a..7eb229e1 100644
--- a/src/analysis.c
+++ b/src/analysis.c
@@ -228,9 +228,9 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt
SAVE_STACK;
tonal->last_transition++;
- alpha = 1.f/IMIN(20, 1+tonal->count);
- alphaE = 1.f/IMIN(50, 1+tonal->count);
- alphaE2 = 1.f/IMIN(1000, 1+tonal->count);
+ alpha = 1.f/IMIN(10, 1+tonal->count);
+ alphaE = 1.f/IMIN(25, 1+tonal->count);
+ alphaE2 = 1.f/IMIN(500, 1+tonal->count);
/* len and offset are now at 24 kHz. */
len/= 2;
@@ -511,6 +511,8 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt
#ifndef DISABLE_FLOAT_API
mlp_process(&net, features, frame_probs);
frame_probs[0] = .5f*(frame_probs[0]+1);
+ //frame_probs[0] = MIN32(.98, frame_probs[0]+.1);
+ //frame_probs[0] = .1 + .9*frame_probs[0];
/* Curve fitting between the MLP probability and the actual probability */
/*frame_probs[0] = .01f + 1.21f*frame_probs[0]*frame_probs[0] - .23f*(float)pow(frame_probs[0], 10);*/
/* Probability of active audio (as opposed to silence) */
diff --git a/src/mlp_data.c b/src/mlp_data.c
index 3222bece..a7f6f2f1 100644
--- a/src/mlp_data.c
+++ b/src/mlp_data.c
@@ -1,107 +1,103 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include "mlp.h"
-/* RMS error was 0.230027, seed was 1452289367 */
-/* 0.009100 0.069938 (0.230027 0.230027) 1.24058e-07 5543 */
+/* RMS error was 0.213312, seed was 1479227418 */
+/* 0.008869 0.061371 (0.213312 0.213312) 2.44803e-06 9999 */
static const float weights[450] = {
/* hidden layer */
--1.20927f, -0.0275523f, 0.0304442f, -0.071791f, -0.0897356f,
-0.100996f, -0.0492634f, 0.070213f, 0.0187071f, 0.0042668f,
-0.0644589f, -0.10967f, -0.119688f, -0.00888386f, 0.170952f,
-0.174562f, -0.265435f, -0.0635892f, -0.284755f, -1.06453f,
-0.202855f, 2.31084f, -2.763f, -0.420894f, 0.698811f,
-6.46418f, 0.0662341f, 0.0758173f, 0.0511722f, 0.0426484f,
-0.115711f, -0.263815f, -0.0113386f, -0.189737f, -0.0929912f,
--0.287827f, 0.0925463f, 0.0286792f, -0.0199793f, -0.193071f,
-0.258586f, 0.018504f, 0.116125f, 0.099269f, -0.00781962f,
--0.266017f, 0.283733f, 10.5488f, -0.658286f, 0.836758f,
-13.1168f, -5.02553f, -1.0969f, -0.0738116f, 0.0204736f,
-0.0110775f, -0.00198985f, 0.00426824f, 0.148998f, 0.0755275f,
-0.112213f, -0.0518501f, 0.028398f, 0.0240943f, -0.0503666f,
--0.149506f, -0.133575f, -0.137328f, 0.116275f, 0.238077f,
-0.080265f, 0.0387349f, 0.09185f, 4.04867f, 3.2435f,
--0.7155f, 8.14792f, -29.8969f, 1.1575f, -0.124794f,
-0.0226943f, -0.0470538f, -0.0334476f, 0.0360859f, 0.0447789f,
--0.00258532f, -0.0192054f, -0.113082f, 0.109513f, -0.0437787f,
-0.0382349f, -0.00994462f, -0.155653f, 0.171922f, -0.222151f,
--0.523565f, -0.0454432f, -0.556888f, 0.761537f, -2.70075f,
--0.883015f, 0.887168f, 0.746329f, -0.363477f, 0.360424f,
-0.034755f, -0.015404f, 0.00688472f, -0.00949269f, 0.0625642f,
--0.050711f, 0.0370223f, 0.0149561f, 0.060385f, -0.0709806f,
--0.036509f, 0.099007f, -0.0397276f, 0.285237f, 0.127836f,
--0.15154f, 0.265848f, -0.0832318f, 0.0520659f, 0.897805f,
-0.439215f, -3.00803f, 1.93755f, -0.408725f, 0.300142f,
--1.42001f, 0.118794f, -0.04621f, 0.050757f, -0.0239654f,
--0.0629488f, -0.0083243f, -0.108989f, -0.0326831f, 0.104277f,
--0.0667274f, 0.0475941f, 0.069182f, -0.0574944f, -0.137823f,
--0.206978f, -0.162035f, -0.208444f, 0.141751f, -0.289377f,
--0.7875f, 0.0911f, 0.174999f, -2.03406f, 3.06743f,
-1.22255f, 2.10659f, 0.0779022f, -0.220946f, 0.137124f,
--0.0625512f, -0.073468f, 0.174861f, -0.139417f, 0.0967417f,
-0.0830658f, -0.223662f, 0.103016f, -0.102317f, 0.225611f,
-0.154375f, 0.187856f, -0.00878193f, 0.128648f, -0.371477f,
--0.479037f, 0.156541f, 1.10304f, -1.26162f, 0.086939f,
--0.143269f, 2.18318f, -2.88831f, 0.101126f, -0.308315f,
-0.222068f, -0.227709f, -0.00855236f, 0.0107035f, 0.00774349f,
--0.0185316f, 0.0306039f, -0.233612f, 0.0807309f, -0.029933f,
-0.151942f, -0.267724f, 0.0484763f, 0.132192f, -0.230059f,
-0.357879f, 0.075414f, 0.110637f, -1.27818f, 3.3101f,
-0.831064f, -0.212367f, -20.704f, -1.1492f, 0.0312941f,
--0.0208507f, -0.00804196f, 0.0110407f, 0.027599f, 0.00193594f,
--0.0135057f, -0.00614977f, 0.0505432f, -0.0108098f, 0.000826042f,
--0.0243765f, -0.323055f, 0.0682748f, -0.55873f, -0.103042f,
-0.174935f, -0.126558f, -0.104518f, 0.422479f, -0.0683178f,
--1.44811f, 0.702109f, 0.712138f, -0.420112f, 2.59746f,
--0.0297689f, -0.0453044f, -0.0330312f, -0.0344518f, -0.0260442f,
--0.0610515f, 0.0916816f, 0.0256295f, -0.105187f, 0.0771212f,
--0.0898792f, -0.186163f, -0.321019f, -0.225689f, 0.175825f,
-0.252939f, 0.738898f, 2.41919f, 0.114505f, -0.314026f,
-0.607983f, 1.73201f, -2.09609f, -0.609339f, 1.18997f,
-0.113871f, -0.177673f, -0.0785783f, -0.348033f, -0.0949274f,
--0.0191062f, 0.335823f, -0.0578655f, 0.131259f, -0.118687f,
--0.132123f, -0.239624f, 0.000738732f, -0.185936f, -0.13077f,
--0.436439f, -0.141664f, 0.0353391f, -0.0536557f, -0.0964537f,
-0.221853f, 1.94264f, -1.78544f, 3.8254f, 3.74598f,
-2.37071f, -1.42709f, 0.0463179f, -0.0568602f, 0.0529534f,
--0.103245f, -0.340972f, 0.101934f, -0.810811f, 0.176158f,
-0.469658f, 0.0248864f, -0.10734f, -0.143827f, -0.0457131f,
-0.779219f, -0.142152f, 0.0394297f, 0.160772f, -0.707623f,
--0.608236f, 1.07106f, -1.27037f, 2.27722f, 6.3688f,
-0.519837f, -3.33262f, -0.126443f, -0.0943922f, 0.0265837f,
-0.0620709f, 0.0113266f, -0.255811f, -0.0735781f, -0.0638952f,
--0.09543f, -0.204965f, 0.00454999f, 0.0554974f, -0.16251f,
--0.573836f, 0.258764f, 0.19895f, 0.0219289f, -0.376757f,
--0.508578f, -0.0767061f, -0.654512f, 4.48901f, 3.38949f,
--2.34533f, -11.0766f, 4.35799f, 1.66794f, -0.0513934f,
--0.0685787f, -0.0112154f, 0.000464661f, -0.234848f, -0.338596f,
--0.142242f, -0.167476f, -0.140324f, -0.104829f, -0.104195f,
-0.0110351f, -0.112668f, 0.0872292f, -0.170777f, -0.0876985f,
-0.123348f, -0.156758f, 0.199038f, -0.056107f, 0.899269f,
-0.0820197f, -1.295f, 0.0295294f, 2.27577f, -0.940993f,
--0.0100104f, -0.111541f, -0.132193f, -0.11037f, 0.0371375f,
--0.0180172f, -0.0105591f, 0.0197043f, 0.04099f, -0.0538671f,
--0.102347f, -0.0470742f, 0.178034f, -0.267772f, -0.105789f,
--0.105376f, 0.0623262f, -0.042906f, 0.176528f, -0.160076f,
--2.28483f, -1.92619f, 0.218149f, 9.67107f, 3.30399f,
--1.75951f, 0.129671f, 0.118305f, 0.140766f, 0.0678099f,
-0.00313175f, -0.0144533f, -0.0310217f, -0.0245139f, 0.136948f,
-0.150137f, 0.112326f, -0.0755033f, -0.280984f, -0.249342f,
--0.681657f, 0.0315246f, 0.294968f, 0.0407062f, 0.282759f,
--0.344185f, -7.32828f, -0.220036f, -0.560418f, -1.87191f,
--7.10132f,
+-1.49575f, 0.0412272f, 0.0454269f, 0.0104776f, 0.0336012f,
+-0.0455974f, -0.105047f, -0.0520699f, -0.0197964f, -0.0833037f,
+-0.0809937f, -0.0486736f, 0.0104389f, -0.0577143f, -0.00551904f,
+-0.0118415f, 0.053815f, 0.0324952f, 0.0247256f, -0.0988066f,
+-0.13444f, -0.870899f, -1.03953f, 1.18702f, -3.46052f,
+-1.54205f, 2.02356f, -0.0791162f, 0.109906f, 0.00136072f,
+0.0664953f, -0.0728222f, 0.0636893f, -0.121761f, 0.0471708f,
+-0.125624f, 0.0570126f, -0.0192511f, -0.062755f, 0.0859039f,
+0.0933374f, 0.175435f, 0.127347f, -0.18434f, -0.154779f,
+-0.152319f, 0.014854f, -1.4498f, -1.46794f, 0.0693873f,
+0.621329f, -0.0616062f, -1.66154f, 0.229979f, 0.136083f,
+0.199459f, 0.0632802f, 0.088892f, 0.0571331f, 0.0594771f,
+0.022619f, 0.231396f, 0.096896f, 0.103059f, 0.00866126f,
+-0.0567396f, -0.180445f, -0.455467f, -0.190238f, 0.137037f,
+-0.208192f, 0.0820235f, -0.162778f, -11.2296f, -2.33154f,
+0.909668f, -6.85734f, -7.73832f, -2.49902f, -0.0118603f,
+0.24852f, -0.140533f, 0.101702f, 0.0851634f, -0.149113f,
+0.076302f, 0.0621906f, -0.0984243f, 0.324914f, -0.334717f,
+-0.00670513f, -0.853213f, 0.485834f, 0.134045f, -0.418151f,
+0.350182f, 0.0269357f, -1.43603f, 0.60244f, 3.28524f,
+-4.22241f, 1.17258f, 0.217745f, 3.57593f, 0.15508f,
+-0.0671132f, 0.0475609f, -0.0598975f, 0.0191797f, -0.00831937f,
+-0.0124935f, 0.0183379f, 0.0367234f, -0.0437611f, -0.00777795f,
+-0.0300612f, -0.14059f, -0.260409f, -0.312317f, -0.541072f,
+0.00213368f, 0.152133f, -0.0629131f, 0.201782f, 0.0306692f,
+-3.09985f, 1.9477f, -1.18056f, 3.3574f, -2.27933f,
+-0.814073f, 0.0211447f, 0.0176399f, 0.0474673f, -0.0185789f,
+-0.0138199f, 0.0520541f, -0.110024f, -0.0659609f, 0.0404468f,
+-0.034577f, 0.0923533f, 0.0822167f, 0.279043f, 0.498454f,
+0.0728072f, -0.0115114f, -0.163178f, -1.44235f, -0.97958f,
+-0.193367f, 0.375702f, -0.534339f, 1.07799f, -0.0225153f,
+2.22532f, 1.74552f, -0.0041177f, -0.138695f, -0.252883f,
+-0.365422f, 0.10312f, 0.0356219f, 0.246108f, 0.0270864f,
+0.0588877f, -0.071282f, -0.328597f, 0.61501f, -0.00520579f,
+-2.17656f, -0.884142f, 0.116733f, -1.05062f, -1.05124f,
+-0.985618f, -0.52499f, -0.878724f, -2.51553f, 6.04765f,
+-5.85112f, -7.66557f, -4.34943f, -0.0170009f, 0.00138944f,
+-0.183771f, -0.0537957f, 0.000470745f, -0.0971737f, -0.0107594f,
+-0.0945811f, 0.169001f, 0.169987f, 0.105882f, 0.0825144f,
+0.113714f, -0.204991f, 0.597609f, -0.190805f, 0.283682f,
+-0.344627f, -0.521042f, 0.311584f, 11.0971f, -1.15561f,
+0.399795f, 12.8899f, -107.127f, 0.279145f, 0.00471917f,
+0.0758364f, -0.0349449f, 0.053161f, 0.0190842f, 0.0199931f,
+0.044927f, 0.0570502f, -0.111926f, -0.0118992f, 0.0106829f,
+0.0589569f, -0.0257566f, 0.334809f, -0.237388f, -0.152132f,
+-0.0354438f, -0.172024f, 0.114506f, 0.36766f, 3.71389f,
+0.887576f, -0.569327f, 4.54713f, -1.29261f, 1.06004f,
+-0.0886646f, -0.0140985f, -0.114892f, -0.032154f, -0.021562f,
+0.0145194f, -0.0269238f, 0.0241339f, -0.00411433f, -0.0111128f,
+-0.0422138f, -0.0361934f, 0.177077f, 0.160174f, 0.471734f,
+0.148651f, 0.00867273f, -0.332041f, 0.0441584f, 0.119647f,
+1.40869f, -1.26756f, 0.988608f, -1.13709f, -0.062768f,
+0.255157f, -0.0151873f, 0.0319646f, 0.122124f, 0.0517178f,
+-0.0942639f, -0.0330079f, -0.0552662f, -0.0585165f, -0.0672674f,
+0.0526535f, 0.0362472f, -0.0610607f, 0.0387742f, -0.250637f,
+0.292556f, -0.124854f, -0.115811f, 0.197886f, -0.351962f,
+-0.466052f, -1.24325f, 2.09844f, -0.294508f, -2.72454f,
+-0.504277f, 1.87673f, -0.228112f, -0.278497f, -0.482349f,
+-0.199447f, -0.0783573f, -0.0438571f, -0.221381f, 0.0300528f,
+0.0439627f, -0.00579913f, -0.194492f, 0.393551f, -0.136585f,
+0.0499079f, -0.0904164f, -0.424276f, 0.176043f, -0.335463f,
+-0.246553f, 0.110429f, 2.19957f, -1.04942f, -0.367194f,
+1.94299f, -0.47052f, 0.612852f, 0.0406875f, -0.00121944f,
+0.145926f, 0.0678098f, 0.0244709f, -0.0449821f, -0.0228517f,
+-0.0103669f, -0.0611677f, 0.0631724f, 0.0042841f, 0.0329614f,
+0.231405f, 0.168526f, 0.0176985f, -0.0178047f, -0.0571473f,
+0.0251568f, 0.392102f, 0.143365f, -0.730739f, 3.1861f,
+-0.47963f, -0.559167f, -4.98976f, -1.44878f, 0.0484166f,
+0.0468742f, -0.0270759f, -0.00987675f, 0.0865013f, 0.173479f,
+0.126091f, 0.112359f, 0.126218f, 0.15401f, 0.133092f,
+0.0592874f, -0.0610175f, -0.11337f, -0.113627f, -0.0279996f,
+0.118692f, 0.155023f, 0.11179f, 0.011755f, 0.617417f,
+-0.0348346f, 1.05458f, -0.689601f, -0.363106f, -2.09101f,
+0.0972167f, -0.30372f, 0.239327f, -0.160846f, -0.123778f,
+0.141499f, -0.196245f, 0.0764782f, 0.00367381f, -0.176602f,
+0.110237f, -0.0275133f, -0.181722f, 0.0733394f, -0.140377f,
+0.0856482f, 0.109992f, -0.192073f, -0.0623485f, 0.0986179f,
+-0.568319f, 1.42259f, 0.587944f, -0.211062f, -10.5601f,
+0.362246f, 0.00461539f, 0.100599f, 0.0724554f, 0.0488259f,
+-0.0193259f, 0.0159694f, -0.0106922f, -0.0218068f, 0.00737706f,
+0.088502f, 0.0207549f, 0.047735f, -0.124846f, 0.214096f,
+0.0925246f, 0.049763f, -0.139898f, 0.00633034f, -0.128318f,
+0.107787f, 0.824856f, 1.71267f, -0.482429f, -6.5385f,
+-2.56888f,
/* output layer */
-8.55144, 2.0822, 0.240592, 1.26638, 0.0309585,
--1.09841, 0.861549, -1.53704, 1.07356, 4.39194,
--2.60476, 0.375094, 0.122941, 0.00326393, 0.777163,
--2.03171, -0.944556, 4.02958, -0.260741, 0.556385,
--0.220568, -1.77121, -0.858706, -1.52023, -0.784162,
-0.345948, -0.0488489, -0.323381, -0.752573, 0.517346,
-0.876475, -1.44056, -0.382276, -1.55409, };
+1.93298, -2.90743, -1.17607, -1.22319, 1.54878,
+0.871944, 2.56482, 0.374822, 0.639316, 1.68487,
+-1.21436, 1.15552, 0.304933, -1.21178, -0.79036,
+1.35881, 2.10126, 5.11079, 1.39309, -1.94099,
+-1.63519, 0.168846, 0.528794, 0.14696, -0.208921,
+-0.334534, 0.210197, 2.32808, 1.08323, -1.3599,
+0.846293, 2.14501, 0.505528, 0.918715, };
static const int topo[3] = {25, 16, 2};