Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Casey Primozic
rnnoise
Commits
92739d88
Unverified
Commit
92739d88
authored
Aug 23, 2017
by
Jean-Marc Valin
Browse files
New features (#9)
Also, adding an error^4 term to the loss function
parent
c60a7634
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
src/denoise.c
View file @
92739d88
...
...
@@ -563,7 +563,7 @@ int main(int argc, char **argv) {
float
E
=
0
;
if
(
++
gain_change_count
>
101
*
300
)
{
speech_gain
=
pow
(
10
.,
(
-
40
+
(
rand
()
%
60
))
/
20
.);
noise_gain
=
pow
(
10
.,
(
-
30
+
(
rand
()
%
4
0
))
/
20
.);
noise_gain
=
pow
(
10
.,
(
-
30
+
(
rand
()
%
5
0
))
/
20
.);
if
(
rand
()
%
10
==
0
)
noise_gain
=
0
;
noise_gain
*=
speech_gain
;
if
(
rand
()
%
10
==
0
)
speech_gain
=
0
;
...
...
src/rnn_data.c
View file @
92739d88
This diff is collapsed.
Click to expand it.
training/rnn_train.py
View file @
92739d88
...
...
@@ -38,7 +38,7 @@ def msse(y_true, y_pred):
return
K
.
mean
(
mymask
(
y_true
)
*
K
.
square
(
K
.
sqrt
(
y_pred
)
-
K
.
sqrt
(
y_true
)),
axis
=-
1
)
def
mycost
(
y_true
,
y_pred
):
return
K
.
mean
(
mymask
(
y_true
)
*
(
K
.
square
(
K
.
sqrt
(
y_pred
)
-
K
.
sqrt
(
y_true
))
+
0.01
*
K
.
binary_crossentropy
(
y_pred
,
y_true
)),
axis
=-
1
)
return
K
.
mean
(
mymask
(
y_true
)
*
(
10
*
K
.
square
(
K
.
square
(
K
.
sqrt
(
y_pred
)
-
K
.
sqrt
(
y_true
)))
+
K
.
square
(
K
.
sqrt
(
y_pred
)
-
K
.
sqrt
(
y_true
))
+
0.01
*
K
.
binary_crossentropy
(
y_pred
,
y_true
)),
axis
=-
1
)
def
my_accuracy
(
y_true
,
y_pred
):
return
K
.
mean
(
2
*
K
.
abs
(
y_true
-
0.5
)
*
K
.
equal
(
y_true
,
K
.
round
(
y_pred
)),
axis
=-
1
)
...
...
@@ -82,7 +82,7 @@ model.compile(loss=[mycost, my_crossentropy],
batch_size
=
32
print
(
'Loading data...'
)
with
h5py
.
File
(
'denoise_data
6
.h5'
,
'r'
)
as
hf
:
with
h5py
.
File
(
'denoise_data
9
.h5'
,
'r'
)
as
hf
:
all_data
=
hf
[
'data'
][:]
print
(
'done.'
)
...
...
@@ -113,4 +113,4 @@ model.fit(x_train, [y_train, vad_train],
batch_size
=
batch_size
,
epochs
=
120
,
validation_split
=
0.1
)
model
.
save
(
"newweights
6c
.hdf5"
)
model
.
save
(
"newweights
9i
.hdf5"
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment