Introduce code from Rust monorepo. This is a mess

This commit is contained in:
Brandon Thomas
2022-02-28 05:43:54 -05:00
parent 921fb49f9a
commit ba326bfcfd
1058 changed files with 192192 additions and 0 deletions
@@ -0,0 +1,157 @@
name: &name "SpeakerNet"
sample_rate: &sample_rate 16000
repeat: &rep 2
dropout: &drop 0.5
separable: &separable True
n_filters: &n_filters 512
model:
train_ds:
manifest_filepath: ???
sample_rate: 16000
labels: null
batch_size: 64
shuffle: True
time_length: 8
is_tarred: False
tarred_audio_filepaths: null
tarred_shard_strategy: "scatter"
validation_ds:
manifest_filepath: ???
sample_rate: 16000
labels: null
batch_size: 128
shuffle: False
time_length: 8
test_ds:
manifest_filepath: ???
sample_rate: 16000
labels: null
batch_size: 1
shuffle: False
time_length: 8
embedding_dir: '.'
preprocessor:
_target_: nemo.collections.asr.modules.AudioToMelSpectrogramPreprocessor
normalize: "per_feature"
window_size: 0.02
sample_rate: *sample_rate
window_stride: 0.01
window: "hann"
features: &n_mels 64
n_fft: 512
frame_splicing: 1
dither: 0.00001
encoder:
_target_: nemo.collections.asr.modules.ConvASREncoder
feat_in: *n_mels
activation: relu
conv_mask: true
jasper:
- filters: *n_filters
repeat: 1
kernel: [3]
stride: [1]
dilation: [1]
dropout: *drop
residual: true
separable: *separable
- filters: *n_filters
repeat: *rep
kernel: [7]
stride: [1]
dilation: [1]
dropout: *drop
residual: true
separable: *separable
- filters: *n_filters
repeat: *rep
kernel: [11]
stride: [1]
dilation: [1]
dropout: *drop
residual: true
separable: *separable
- filters: *n_filters
repeat: *rep
kernel: [15]
stride: [1]
dilation: [1]
dropout: *drop
residual: true
separable: *separable
- filters: &enc_feat_out 1500
repeat: 1
kernel: [1]
stride: [1]
dilation: [1]
dropout: 0.0
residual: false
separable: *separable
decoder:
_target_: nemo.collections.asr.modules.SpeakerDecoder
feat_in: *enc_feat_out
num_classes: 7205
pool_mode: 'xvector'
emb_sizes: 512,512
angular: False
loss:
scale: 30
margin: 0.2
optim:
name: novograd
# _target_: nemo.core.optim.optimizers.Novograd
lr: .008
# optimizer arguments
args:
name: auto
# _target_: nemo.core.config.optimizers.NovogradParams
betas: [0.95, 0.5]
weight_decay: 0.001
# scheduler setup
sched:
name: CosineAnnealing
iters_per_batch: 1 # computed at runtime
max_steps: null # computed at runtime or explicitly set here
# scheduler config override
args:
name: auto
# _target_: nemo.core.config.schedulers.CosineAnnealingParams
warmup_steps: null
warmup_ratio: 0.1
min_lr: 0.0
last_epoch: -1
trainer:
gpus: 1 # number of gpus
max_epochs: 200
max_steps: null # computed at runtime if not set
num_nodes: 1
accelerator: ddp
accumulate_grad_batches: 1
amp_level: O0
deterministic: True
checkpoint_callback: False
logger: False
log_every_n_steps: 1 # Interval of logging.
val_check_interval: 1.0 # Set to 0.25 to check 4 times per epoch, or an int for number of iterations
exp_manager:
exp_dir: null
name: *name
create_tensorboard_logger: True
create_checkpoint_callback: True
@@ -0,0 +1,145 @@
name: &name "SpeakerNet"
sample_rate: &sample_rate 16000
repeat: &rep 2
dropout: &drop 0.5
separable: &separable True
n_filters: &n_filters 512
model:
train_ds:
manifest_filepath: ???
sample_rate: 16000
labels: null
batch_size: 64
shuffle: True
time_length: 8
is_tarred: False
tarred_audio_filepaths: null
tarred_shard_strategy: "scatter"
validation_ds:
manifest_filepath: ???
sample_rate: 16000
labels: null
batch_size: 128
shuffle: False
time_length: 8
preprocessor:
_target_: nemo.collections.asr.modules.AudioToMelSpectrogramPreprocessor
normalize: "per_feature"
window_size: 0.02
sample_rate: *sample_rate
window_stride: 0.01
window: "hann"
features: &n_mels 64
n_fft: 512
frame_splicing: 1
dither: 0.00001
encoder:
_target_: nemo.collections.asr.modules.ConvASREncoder
feat_in: *n_mels
activation: relu
conv_mask: true
jasper:
- filters: *n_filters
repeat: 1
kernel: [3]
stride: [1]
dilation: [1]
dropout: *drop
residual: true
separable: *separable
- filters: *n_filters
repeat: *rep
kernel: [7]
stride: [1]
dilation: [1]
dropout: *drop
residual: true
separable: *separable
- filters: *n_filters
repeat: *rep
kernel: [11]
stride: [1]
dilation: [1]
dropout: *drop
residual: true
separable: *separable
- filters: *n_filters
repeat: *rep
kernel: [15]
stride: [1]
dilation: [1]
dropout: *drop
residual: true
separable: *separable
- filters: &enc_feat_out 1500
repeat: 1
kernel: [1]
stride: [1]
dilation: [1]
dropout: 0.0
residual: false
separable: *separable
decoder:
_target_: nemo.collections.asr.modules.SpeakerDecoder
feat_in: *enc_feat_out
num_classes: 7205
pool_mode: 'xvector'
emb_sizes: 256
angular: True
loss:
scale: 30
margin: 0.2
optim:
name: sgd
lr: .006
# optimizer arguments
args:
name: auto
weight_decay: 0.001
momentum: 0.9
# scheduler setup
sched:
name: CosineAnnealing
iters_per_batch: 1 # computed at runtime
max_steps: null # computed at runtime or explicitly set here
# scheduler config override
args:
name: auto
warmup_steps: null
warmup_ratio: 0.1
min_lr: 0.0
last_epoch: -1
trainer:
gpus: 1 # number of gpus
max_epochs: 200
max_steps: null # computed at runtime if not set
num_nodes: 1
accelerator: ddp
accumulate_grad_batches: 1
amp_level: O0
deterministic: True
checkpoint_callback: False
logger: False
log_every_n_steps: 1 # Interval of logging.
val_check_interval: 1.0 # Set to 0.25 to check 4 times per epoch, or an int for number of iterations
exp_manager:
exp_dir: null
name: *name
create_tensorboard_logger: True
create_checkpoint_callback: True
@@ -0,0 +1,27 @@
name: &name "ClusterDiarizer"
num_workers: 4
sample_rate: &sample_rate 16000
diarizer:
oracle_num_speakers: ??? # oracle number of speakers or pass null if not known. [int or path to file containing uniq-id with num of speakers of that session]
max_num_speakers: 20 # max number of speakers for each recording. If oracle num speakers is passed this value is ignored.
out_dir: ???
paths2audio_files: ??? #file containing paths to audio files for inference
path2groundtruth_rttm_files: null #file containing paths to ground truth rttm files for score computation or null if no reference rttms are present
vad:
model_path: null #.nemo local model path or pretrained model name or none
window_length_in_sec: 0.15
shift_length_in_sec: 0.01
threshold: 0.7 # tune threshold on dev set. Check <NeMo_git_root>/scripts/voice_activity_detection/vad_tune_threshold.py
vad_decision_smoothing: True
smoothing_params:
method: "median"
overlap: 0.875
speaker_embeddings:
oracle_vad_manifest: null
model_path: ??? #.nemo local model path or pretrained model name (speakerverification_speakernet or speakerdiarization_speakernet)
window_length_in_sec: 1.5 # window length in sec for speaker embedding extraction
shift_length_in_sec: 0.75 # shift length in sec for speaker embedding extraction