Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wenet add reverb noise #2300

Closed
wants to merge 0 commits into from
Closed

wenet add reverb noise #2300

wants to merge 0 commits into from

Conversation

dahu1
Copy link

@dahu1 dahu1 commented Jan 15, 2024

wenet 数据处理增加 混响和噪音处理,on-the-fly 的方式。代码来源于 wespeaker,这里做了一下搬运。

改过之后,可以正常训练。
image

混响和噪音文件是这样:
image

@dahu1
Copy link
Author

dahu1 commented Jan 15, 2024

@xingchensong

@xingchensong
Copy link
Member

great! thx. 这周稍晚review一下

@robin1001
Copy link
Collaborator

有实验结果吗?

@dahu1
Copy link
Author

dahu1 commented Jan 16, 2024

有实验结果吗?

ok,我后面贴一个结果

@@ -68,6 +68,8 @@ dataset_conf:
resample_conf:
resample_rate: 16000
speed_perturb: true
# aug_prob: 0.6 # prob to add reverb & noise aug per sample
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是原来标准 conformer 的配置文件,更改后其他人无法复现以前实验。可以新建一个 train_conformer_noise.yaml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -124,7 +125,9 @@ def Dataset(data_type,
data_list_file,
tokenizer: BaseTokenizer,
conf,
partition=True):
partition=True,
reverb_lmdb_file=None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverb_lmdb_file 建议配置在 yaml 文件中

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverb_lmdb_file 建议配置在 yaml 文件中

reverb_lmdb_file这个是生成的,也可以写在yaml文件里么

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以,固定路径就可以。

@@ -121,6 +123,11 @@ if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then
data/$x/data.list
fi
done

# Convert all musan data to LMDB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加可选参数控制,不影响原来文件的流程和功能。

@@ -155,12 +156,23 @@ def Dataset(data_type,
dataset = Processor(dataset, processor.filter, **filter_conf)

resample_conf = conf.get('resample_conf', {})
resample_rate = resample_conf["resample_rate"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果resample_conf是空的话,这一行会报错吧

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果resample_conf是空的话,这一行会报错吧

额,是的,我改下。。

(audio_db - noise_db - noise_snr) / 10)) * noise_audio
out_audio = audio + noise_audio

# normalize into [-1, 1]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是把wav做了归一化,wenet非加噪的流程中没有对wav做归一化。可以验证下加噪后 训练的模型精度咋样

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是把wav做了归一化,wenet非加噪的流程中没有对wav做归一化。可以验证下加噪后 训练的模型精度咋样

嗯嗯,我正在跑模型训练,预计这一周能出结果,到时我贴一下。

@dahu1
Copy link
Author

dahu1 commented Jan 17, 2024

我有个问题,想请问一下大佬们。

背景: 我自己在本地做了一些 nn context biasing 的triton 推理工作,在python版和triton版的一致性是可以对上的,我想开源出来,跟大家一起探讨怎么写的更优雅(我发现你们给提的建议都很nice👍),以及怎么改进。

问题:我把wenet 的仓库fork到我自己的仓库了,用来改加噪了,就是这个pr的内容,我现在想做的是,把凯勋的 fork过后改的仓库nn_bias 分支 fork到自己仓库,然后在上面修改,也方便大家看file change,但是fork过之后,就不能fork第二个同名仓库了好像,我如果直接在我自己仓库改的话,会有两个问题:1. 会同步到这个pr里 ,2.不好更凯勋的做file compare了,不知道改的内容。

所以想请教一下,这种情况该怎么操作,或许我可以从头新建一个仓库?

@xingchensong
Copy link
Member

我有个问题,想请问一下大佬们。

背景: 我自己在本地做了一些 nn context biasing 的triton 推理工作,在python版和triton版的一致性是可以对上的,我想开源出来,跟大家一起探讨怎么写的更优雅(我发现你们给提的建议都很nice👍),以及怎么改进。

问题:我把wenet 的仓库fork到我自己的仓库了,用来改加噪了,就是这个pr的内容,我现在想做的是,把凯勋的 fork过后改的仓库nn_bias 分支 fork到自己仓库,然后在上面修改,也方便大家看file change,但是fork过之后,就不能fork第二个同名仓库了好像,我如果直接在我自己仓库改的话,会有两个问题:1. 会同步到这个pr里 ,2.不好更凯勋的做file compare了,不知道改的内容。

所以想请教一下,这种情况该怎么操作,或许我可以从头新建一个仓库?

可以使用git的分支功能:

git clone https://github.com/wenet-e2e/wenet.git
cd wenet
git remote add dahu1 https://github.com/dahu1/wenet.git  # 添加你fork的仓库
git fetch --all  # 拉取你fork的仓库中的branch
git checkout -b nn-bias  # 建一个本地branch
# 添加一些修改 然后 git add, git commit
git push dahu1 nn-bias:nn-bias-remote # 本地branch的更新推送到远程,推送的目的仓库是你fork的仓库

@dahu1
Copy link
Author

dahu1 commented Jan 22, 2024

Conformer add noise & rirs Result

  • Feature info: using fbank feature, dither, cmvn, online speed perturb, add musan noise & rirs reverb
  • Training info: lr 0.002, batch size 24, 6 gpu, acc_grad 4, 240 epochs, dither 0.1
  • Decoding info: ctc_weight 0.3, average_num 30
decoding mode CER
attention decoder 6.45
ctc greedy search 6.54
ctc prefix beam search 6.54
attention rescoring 6.04

@cdliang11
Copy link
Collaborator

Conformer add noise & rirs Result

  • Feature info: using fbank feature, dither, cmvn, online speed perturb, add musan noise & rirs reverb
  • Training info: lr 0.002, batch size 24, 6 gpu, acc_grad 4, 240 epochs, dither 0.1
  • Decoding info: ctc_weight 0.3, average_num 30

decoding mode CER
attention decoder 6.45
ctc greedy search 6.54
ctc prefix beam search 6.54
attention rescoring 6.04

Conformer add noise & rirs Result

  • Feature info: using fbank feature, dither, cmvn, online speed perturb, add musan noise & rirs reverb
  • Training info: lr 0.002, batch size 24, 6 gpu, acc_grad 4, 240 epochs, dither 0.1
  • Decoding info: ctc_weight 0.3, average_num 30

decoding mode CER
attention decoder 6.45
ctc greedy search 6.54
ctc prefix beam search 6.54
attention rescoring 6.04

从结果来看,aishell上变差的有点多。设置的aug_prob是多少?

@dahu1
Copy link
Author

dahu1 commented Jan 24, 2024

从结果来看,aishell上变差的有点多。设置的aug_prob是多少?

设置的是 1

@Mddct
Copy link
Collaborator

Mddct commented Jan 31, 2024

#2316 Wenet新重新设计了dataset,有时间的话 辛苦改一下

@dahu1
Copy link
Author

dahu1 commented Feb 18, 2024

#2316 Wenet新重新设计了dataset,有时间的话 辛苦改一下

好的👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants