Skip to content

Commit

Permalink
Merge pull request #5711 from atharva253/master
Browse files Browse the repository at this point in the history
ESPnet recipe for the Kinect-WSJ dataset
  • Loading branch information
mergify[bot] committed Mar 25, 2024
2 parents f084317 + 51d28ca commit eed7751
Show file tree
Hide file tree
Showing 23 changed files with 656 additions and 1 deletion.
1 change: 1 addition & 0 deletions egs2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ See: https://espnet.github.io/espnet/espnet2_tutorial.html#recipes-using-espnet2
| wsj | CSR-I (WSJ0) Complete, CSR-II (WSJ1) Complete | ASR | ENG | https://catalog.ldc.upenn.edu/LDC93S6A,https://catalog.ldc.upenn.edu/LDC94S13A | |
| wsj0_2mix | MERL WSJ0-mix multi-speaker dataset | ASR/SE | ENG | http://www.merl.com/demos/deep-clustering | |
| wsj0_2mix_spatialized | MERL WSJ0-mix multi-speaker dataset (Spatialized version) | ASR/Multichannel ASR/SE | ENG | http://www.merl.com/demos/deep-clustering | |
| wsj_kinect | Kinect WSJ: Multichannel, Reverberated and Noisy Extension to the WSJ0-2mix dataset | SE | ENG | https://github.com/sunits/Reverberated_WSJ_2MIX | |
| yesno | The "yesno" corpus | ASR | HEB | http://www.openslr.org/1 | |
| yoloxochitl_mixtec | Yoloxochitl-Mixtec corpus (endangered language in central Mexico) | ASR | XTY | http://www.openslr.org/89 | |
| zeroth_korean | Zeroth-Korean | ASR | KOR | http://www.openslr.org/40 | |
Expand Down
5 changes: 4 additions & 1 deletion egs2/TEMPLATE/asr1/db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ DSING=downloads
ESC50=
WSJ0=
WSJ1=
WSJ0_2MIX= # Path to wsj0_mix directory
WSJCAM0=
WSJ_KINECT=
REAZONSPEECH=downloads
REVERB=
REVERB_OUT="${PWD}/REVERB" # Output file path
Expand All @@ -39,7 +41,7 @@ CHIME2_WSJ0=
CHIME2_GRID=
CHIME3=
CHIME4=
CHIME5=
CHIME5= # Path to CHiME5/audio directory
CSJDATATOP=
CSJVER=dvd ## Set your CSJ format (dvd or usb).
## Usage :
Expand All @@ -52,6 +54,7 @@ CSJVER=dvd ## Set your CSJ format (dvd or usb).
## Case merl :MERL setup. Necessary directory is WAV and sdb
CSMSC=downloads
CSS10=
DIHARD2= # Path to dihard2/second_dihard_challenge_dev-eleven_srcs/data/multichannel/sad directory
HKUST1=
HKUST2=
HUI_ACG=downloads
Expand Down
20 changes: 20 additions & 0 deletions egs2/wsj_kinect/enh1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Generated by ./scripts/utils/show_enh_score.sh -->
# RESULTS
## Environments
- date: `Wed Mar 20 10:56:43 EDT 2024`
- python version: `3.9.18 (main, Sep 11 2023, 13:41:44) [GCC 11.2.0]`
- espnet version: `espnet 202402`
- pytorch version: `pytorch 2.1.0`
- Git hash: `2bcd4624d49bf3cc682796470ba7fd149bc03fa4`
- Commit date: `Tue Mar 19 11:00:42 2024 -0400`


## TF-GridNetV2

- config: conf/tuning/train_enh_tfgridnetv2_tf_lr-patience3_patience5_I_1_J_1_D_128_batch_8.yaml
- pretrained model: https://huggingface.co/atharva253/tfgridnetv2_wsj_kinect

|dataset|STOI|SAR|SDR|SIR|SI_SNR|
|---|---|---|---|---|---|
|enhanced_cv|83.40|9.90|9.30|20.08|8.74|
|enhanced_tt|86.66|10.59|9.91|19.83|9.40|
110 changes: 110 additions & 0 deletions egs2/wsj_kinect/enh1/cmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ======
# Usage: <cmd>.pl [options] JOB=1:<nj> <log> <command...>
# e.g.
# run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB
#
# Options:
# --time <time>: Limit the maximum time to execute.
# --mem <mem>: Limit the maximum memory usage.
# -–max-jobs-run <njob>: Limit the number parallel jobs. This is ignored for non-array jobs.
# --num-threads <ngpu>: Specify the number of CPU core.
# --gpu <ngpu>: Specify the number of GPU devices.
# --config: Change the configuration file from default.
#
# "JOB=1:10" is used for "array jobs" and it can control the number of parallel jobs.
# The left string of "=", i.e. "JOB", is replaced by <N>(Nth job) in the command and the log file name,
# e.g. "echo JOB" is changed to "echo 3" for the 3rd job and "echo 8" for 8th job respectively.
# Note that the number must start with a positive number, so you can't use "JOB=0:10" for example.
#
# run.pl, queue.pl, slurm.pl, and ssh.pl have unified interface, not depending on its backend.
# These options are mapping to specific options for each backend and
# it is configured by "conf/queue.conf" and "conf/slurm.conf" by default.
# If jobs failed, your configuration might be wrong for your environment.
#
#
# The official documentation for run.pl, queue.pl, slurm.pl, and ssh.pl:
# "Parallelization in Kaldi": http://kaldi-asr.org/doc/queue.html
# =========================================================~


# Select the backend used by run.sh from "local", "stdout", "sge", "slurm", or "ssh"
cmd_backend='local'

# Local machine, without any Job scheduling system
if [ "${cmd_backend}" = local ]; then

# The other usage
export train_cmd="run.pl"
# Used for "*_train.py": "--gpu" is appended optionally by run.sh
export cuda_cmd="run.pl"
# Used for "*_recog.py"
export decode_cmd="run.pl"

# Local machine logging to stdout and log file, without any Job scheduling system
elif [ "${cmd_backend}" = stdout ]; then

# The other usage
export train_cmd="stdout.pl"
# Used for "*_train.py": "--gpu" is appended optionally by run.sh
export cuda_cmd="stdout.pl"
# Used for "*_recog.py"
export decode_cmd="stdout.pl"


# "qsub" (Sun Grid Engine, or derivation of it)
elif [ "${cmd_backend}" = sge ]; then
# The default setting is written in conf/queue.conf.
# You must change "-q g.q" for the "queue" for your environment.
# To know the "queue" names, type "qhost -q"
# Note that to use "--gpu *", you have to setup "complex_value" for the system scheduler.

export train_cmd="queue.pl"
export cuda_cmd="queue.pl"
export decode_cmd="queue.pl"


# "qsub" (Torque/PBS.)
elif [ "${cmd_backend}" = pbs ]; then
# The default setting is written in conf/pbs.conf.

export train_cmd="pbs.pl"
export cuda_cmd="pbs.pl"
export decode_cmd="pbs.pl"


# "sbatch" (Slurm)
elif [ "${cmd_backend}" = slurm ]; then
# The default setting is written in conf/slurm.conf.
# You must change "-p cpu" and "-p gpu" for the "partition" for your environment.
# To know the "partion" names, type "sinfo".
# You can use "--gpu * " by default for slurm and it is interpreted as "--gres gpu:*"
# The devices are allocated exclusively using "${CUDA_VISIBLE_DEVICES}".

export train_cmd="slurm.pl"
export cuda_cmd="slurm.pl"
export decode_cmd="slurm.pl"

elif [ "${cmd_backend}" = ssh ]; then
# You have to create ".queue/machines" to specify the host to execute jobs.
# e.g. .queue/machines
# host1
# host2
# host3
# Assuming you can login them without any password, i.e. You have to set ssh keys.

export train_cmd="ssh.pl"
export cuda_cmd="ssh.pl"
export decode_cmd="ssh.pl"

# This is an example of specifying several unique options in the JHU CLSP cluster setup.
# Users can modify/add their own command options according to their cluster environments.
elif [ "${cmd_backend}" = jhu ]; then

export train_cmd="queue.pl --mem 2G"
export cuda_cmd="queue-freegpu.pl --mem 2G --gpu 1 --config conf/queue.conf"
export decode_cmd="queue.pl --mem 4G"

else
echo "$0: Error: Unknown cmd_backend=${cmd_backend}" 1>&2
return 1
fi
11 changes: 11 additions & 0 deletions egs2/wsj_kinect/enh1/conf/pbs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Default configuration
command qsub -V -v PATH -S /bin/bash
option name=* -N $0
option mem=* -l mem=$0
option mem=0 # Do not add anything to qsub_opts
option num_threads=* -l ncpus=$0
option num_threads=1 # Do not add anything to qsub_opts
option num_nodes=* -l nodes=$0:ppn=1
default gpu=0
option gpu=0
option gpu=* -l ngpus=$0
12 changes: 12 additions & 0 deletions egs2/wsj_kinect/enh1/conf/queue.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Default configuration
command qsub -v PATH -cwd -S /bin/bash -j y -l arch=*64*
option name=* -N $0
option mem=* -l mem_free=$0,ram_free=$0
option mem=0 # Do not add anything to qsub_opts
option num_threads=* -pe smp $0
option num_threads=1 # Do not add anything to qsub_opts
option max_jobs_run=* -tc $0
option num_nodes=* -pe mpi $0 # You must set this PE as allocation_rule=1
default gpu=0
option gpu=0
option gpu=* -l gpu=$0 -q g.q
14 changes: 14 additions & 0 deletions egs2/wsj_kinect/enh1/conf/slurm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Default configuration
command sbatch --export=PATH
option name=* --job-name $0
option time=* --time $0
option mem=* --mem-per-cpu $0
option mem=0
option num_threads=* --cpus-per-task $0
option num_threads=1 --cpus-per-task 1
option num_nodes=* --nodes $0
default gpu=0
option gpu=0 -p cpu
option gpu=* -p gpu --gres=gpu:$0 -c $0 # Recommend allocating more CPU than, or equal to the number of GPU
# note: the --max-jobs-run option is supported as a special case
# by slurm.pl and you don't have to handle it in the config file.
1 change: 1 addition & 0 deletions egs2/wsj_kinect/enh1/conf/train.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
optim: adam
init: xavier_uniform
max_epoch: 150
batch_type: folded
batch_size: 3
iterator_type: chunk
chunk_length: 32000
num_workers: 4
optim_conf:
lr: 1.0e-03
eps: 1.0e-08
weight_decay: 0
patience: 5
val_scheduler_criterion:
- valid
- loss
best_model_criterion:
- - valid
- si_snr
- max
- - valid
- loss
- min
keep_nbest_models: 1
scheduler: reducelronplateau
scheduler_conf:
mode: min
factor: 0.5
patience: 3
encoder: same
decoder: same
separator: tfgridnetv2
separator_conf:
n_srcs: 2
n_fft: 128
stride: 64
window: "hann"
n_imics: 4
n_layers: 6
lstm_hidden_units: 192
attn_n_head: 4
attn_approx_qk_dim: 512
emb_dim: 128
emb_ks: 1
emb_hs: 1
activation: "prelu"
eps: 1.0e-5

criterions:
# The first criterion
- name: si_snr
conf:
eps: 1.0e-7
wrapper: pit
wrapper_conf:
weight: 1.0
independent_perm: True
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
optim: adam
init: xavier_uniform
max_epoch: 150
batch_type: folded
batch_size: 16
iterator_type: chunk
chunk_length: 32000
num_workers: 4
optim_conf:
lr: 1.0e-03
eps: 1.0e-08
weight_decay: 0
patience: 5
val_scheduler_criterion:
- valid
- loss
best_model_criterion:
- - valid
- si_snr
- max
- - valid
- loss
- min
keep_nbest_models: 1
scheduler: reducelronplateau
scheduler_conf:
mode: min
factor: 0.5
patience: 3
encoder: same
decoder: same
separator: tfgridnetv2
separator_conf:
n_srcs: 2
n_fft: 128
stride: 64
window: "hann"
n_imics: 4
n_layers: 6
lstm_hidden_units: 192
attn_n_head: 4
attn_approx_qk_dim: 512
emb_dim: 128
emb_ks: 1
emb_hs: 1
activation: "prelu"
eps: 1.0e-5

criterions:
# The first criterion
- name: si_snr
conf:
eps: 1.0e-7
wrapper: pit
wrapper_conf:
weight: 1.0
independent_perm: True
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
optim: adam
init: xavier_uniform
max_epoch: 150
batch_type: folded
batch_size: 8
iterator_type: chunk
chunk_length: 32000
num_workers: 4
optim_conf:
lr: 1.0e-03
eps: 1.0e-08
weight_decay: 0
patience: 5
val_scheduler_criterion:
- valid
- loss
best_model_criterion:
- - valid
- si_snr
- max
- - valid
- loss
- min
keep_nbest_models: 1
scheduler: reducelronplateau
scheduler_conf:
mode: min
factor: 0.5
patience: 3
encoder: same
decoder: same
separator: tfgridnetv2
separator_conf:
n_srcs: 2
n_fft: 128
stride: 64
window: "hann"
n_imics: 4
n_layers: 6
lstm_hidden_units: 192
attn_n_head: 4
attn_approx_qk_dim: 512
emb_dim: 128
emb_ks: 1
emb_hs: 1
activation: "prelu"
eps: 1.0e-5

criterions:
# The first criterion
- name: si_snr
conf:
eps: 1.0e-7
wrapper: pit
wrapper_conf:
weight: 1.0
independent_perm: True
1 change: 1 addition & 0 deletions egs2/wsj_kinect/enh1/db.sh
1 change: 1 addition & 0 deletions egs2/wsj_kinect/enh1/enh.sh

0 comments on commit eed7751

Please sign in to comment.