Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ambuj Mehrish
sidekit
Commits
b86abfce
Commit
b86abfce
authored
Jan 23, 2021
by
Anthony Larcher
Browse files
v1.3.7
parent
8ea51326
Changes
31
Hide whitespace changes
Inline
Side-by-side
nnet/res_net.py
View file @
b86abfce
...
...
@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-202
0
Anthony Larcher
Copyright 2014-202
1
Anthony Larcher
"""
import
h5py
...
...
@@ -43,6 +43,15 @@ from ..statserver import StatServer
from
torch.utils.data
import
DataLoader
__author__
=
"Anthony Larcher and Sylvain Meignier"
__copyright__
=
"Copyright 2014-2021 Anthony Larcher and Sylvain Meignier"
__license__
=
"LGPL"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
__docformat__
=
'reStructuredText'
class
FeatureMapScaling
(
torch
.
nn
.
Module
):
"""
...
...
nnet/sincnet.py
View file @
b86abfce
...
...
@@ -2,6 +2,7 @@
#
# Copyright (c) 2019 Mirco Ravanelli
# Copyright (c) 2019-2020 CNRS
# Copyright (c) 2020-2021 LIUM
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
...
...
@@ -23,6 +24,7 @@
#
# AUTHOR
# Hervé Bredin - http://herve.niderb.fr
# Anthony Larcher
# Part of this code was taken from https://github.com/mravanelli/SincNet
# (see above license terms).
...
...
@@ -37,7 +39,6 @@
from
typing
import
List
import
numpy
import
torch
#import torch.nn.functional as F
import
math
...
...
nnet/vad_rnn.py
View file @
b86abfce
...
...
@@ -22,11 +22,8 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-202
0
Anthony Larcher
Copyright 2014-202
1
Anthony Larcher
The authors would like to thank the BUT Speech@FIT group (http://speech.fit.vutbr.cz) and Lukas BURGET
for sharing the source code that strongly inspired this module. Thank you for your valuable contribution.
"""
import
os
import
sys
...
...
@@ -42,7 +39,7 @@ import logging
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2015-202
0
Anthony Larcher"
__copyright__
=
"Copyright 2015-202
1
Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
nnet/xsets.py
View file @
b86abfce
...
...
@@ -22,10 +22,8 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-202
0
Anthony Larcher
Copyright 2014-202
1
Anthony Larcher
The authors would like to thank the BUT Speech@FIT group (http://speech.fit.vutbr.cz) and Lukas BURGET
for sharing the source code that strongly inspired this module. Thank you for your valuable contribution.
"""
import
glob
...
...
@@ -56,7 +54,7 @@ from torch.utils.data import DataLoader
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2015-202
0
Anthony Larcher"
__copyright__
=
"Copyright 2015-202
1
Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
nnet/xvector.py
View file @
b86abfce
...
...
@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-202
0
Yevhenii Prokopalo
, Anthony Larcher
Copyright 2014-202
1 Anthony Larcher,
Yevhenii Prokopalo
"""
...
...
@@ -53,22 +53,17 @@ from ..statserver import StatServer
from
torch.utils.data
import
DataLoader
from
sklearn.model_selection
import
train_test_split
from
.sincnet
import
SincNet
#from torch.utils.tensorboard import SummaryWriter
from
.loss
import
ArcLinear
from
.loss
import
ArcFace
from
.loss
import
l2_norm
import
torch.autograd.profiler
as
profiler
from
torch.nn.parallel
import
DistributedDataParallel
as
DDP
import
torch.distributed
as
dist
import
torch.multiprocessing
as
mp
os
.
environ
[
'MKL_THREADING_LAYER'
]
=
'GNU'
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2015-202
0
Anthony Larcher"
__copyright__
=
"Copyright 2015-202
1
Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
sidekit_mpi.py
View file @
b86abfce
...
...
@@ -21,7 +21,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-201
9
Sylvain Meignier and Anthony Larcher
Copyright 2014-20
2
1 Sylvain Meignier and Anthony Larcher
:mod:`sidekit_mpi` provides methods to run using Message Passing interface
...
...
@@ -46,7 +46,7 @@ from mpi4py import MPI
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2014-201
9
Anthony Larcher"
__copyright__
=
"Copyright 2014-20
2
1 Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
sidekit_wrappers.py
View file @
b86abfce
...
...
@@ -19,7 +19,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-201
9
Anthony Larcher
Copyright 2014-20
2
1 Anthony Larcher
:mod:`sidekit_wrappers` provides wrappers for different purposes.
The aim when using wrappers is to simplify the development of new function
...
...
@@ -33,7 +33,7 @@ from sidekit import PARALLEL_MODULE
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2014-201
9
Anthony Larcher"
__copyright__
=
"Copyright 2014-20
2
1 Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
@@ -82,7 +82,7 @@ def check_path_existance(func):
def
wrapper
(
*
args
,
**
kwargs
):
dir_name
=
os
.
path
.
dirname
(
args
[
1
])
# get the path
# Create the directory if it dosn't exist
if
not
os
.
path
.
exists
(
dir_name
)
and
(
dir_name
is
not
''
):
if
not
os
.
path
.
exists
(
dir_name
)
and
not
(
dir_name
==
''
):
os
.
makedirs
(
dir_name
)
# Do the job
func
(
*
args
,
**
kwargs
)
...
...
@@ -189,7 +189,7 @@ def process_parallel_lists(func):
for
ii
in
range
(
num_thread
):
parallel_kwargs
[
ii
][
k
]
=
v
if
PARALLEL_MODULE
is
'multiprocessing'
:
if
PARALLEL_MODULE
==
'multiprocessing'
:
import
multiprocessing
jobs
=
[]
multiprocessing
.
freeze_support
()
...
...
@@ -200,7 +200,7 @@ def process_parallel_lists(func):
for
p
in
jobs
:
p
.
join
()
elif
PARALLEL_MODULE
is
'threading'
:
elif
PARALLEL_MODULE
==
'threading'
:
import
threading
jobs
=
[]
for
idx
in
range
(
num_thread
):
...
...
@@ -210,7 +210,7 @@ def process_parallel_lists(func):
for
p
in
jobs
:
p
.
join
()
elif
PARALLEL_MODULE
is
'MPI'
:
elif
PARALLEL_MODULE
==
'MPI'
:
# TODO
print
(
"ParallelProcess using MPI is not implemented yet"
)
pass
...
...
@@ -253,16 +253,16 @@ def accepts(*types, **kw):
try
:
def
decorator
(
f
):
def
newf
(
*
args
):
if
debug
is
0
:
if
debug
==
0
:
return
f
(
*
args
)
assert
len
(
args
)
==
len
(
types
)
argtypes
=
tuple
([
a
.
__class__
.
__name__
for
a
in
args
])
if
argtypes
!=
types
:
print
(
"argtypes = {} and types = {}"
.
format
(
argtypes
,
types
))
msg
=
info
(
f
.
__name__
,
types
,
argtypes
,
0
)
if
debug
is
1
:
if
debug
==
1
:
print
(
'TypeWarning: '
,
msg
)
elif
debug
is
2
:
elif
debug
==
2
:
raise
TypeError
(
msg
)
return
f
(
*
args
)
newf
.
__name__
=
f
.
__name__
...
...
statserver.py
View file @
b86abfce
...
...
@@ -23,7 +23,7 @@
"""
Copyright 2014-201
9
Anthony Larcher
Copyright 2014-20
2
1 Anthony Larcher
:mod:`statserver` provides methods to manage zero and first statistics.
"""
...
...
@@ -54,7 +54,7 @@ if STAT_TYPE == numpy.float32:
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2014-201
9
Anthony Larcher"
__copyright__
=
"Copyright 2014-20
2
1 Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
sv_utils.py
View file @
b86abfce
...
...
@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-201
9
Anthony Larcher
Copyright 2014-20
2
1 Anthony Larcher
:mod:`sv_utils` provides utilities to facilitate the work with SIDEKIT.
"""
...
...
@@ -41,7 +41,7 @@ if sys.version_info.major > 2:
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2014-201
9
Anthony Larcher"
__copyright__
=
"Copyright 2014-20
2
1 Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
svm_scoring.py
View file @
b86abfce
...
...
@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-201
9
Anthony Larcher
Copyright 2014-20
2
1 Anthony Larcher
:mod:`svm_scoring` provides functions to perform speaker verification
by using Support Vector Machines.
...
...
@@ -39,7 +39,7 @@ from sidekit.statserver import StatServer
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2014-201
9
Anthony Larcher"
__copyright__
=
"Copyright 2014-20
2
1 Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
svm_training.py
View file @
b86abfce
...
...
@@ -22,7 +22,7 @@
# along with SIDEKIT. If not, see <http://www.gnu.org/licenses/>.
"""
Copyright 2014-201
9
Anthony Larcher
Copyright 2014-20
2
1 Anthony Larcher
:mod:`svm_training` provides utilities to train Support Vector Machines
to perform speaker verification.
...
...
@@ -38,7 +38,7 @@ import sidekit.sv_utils
__license__
=
"LGPL"
__author__
=
"Anthony Larcher"
__copyright__
=
"Copyright 2014-201
9
Anthony Larcher"
__copyright__
=
"Copyright 2014-20
2
1 Anthony Larcher"
__maintainer__
=
"Anthony Larcher"
__email__
=
"anthony.larcher@univ-lemans.fr"
__status__
=
"Production"
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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