在声学模型计算到phone上后验概率和强制对其结果匹配提到多种方式计算phone上的概率,里面的tacc其实是由get_phone_post.sh产生。
通过get_phone_post.sh也可以产生phone上的概率
get_phone_post.sh代码中有提到如果要计算xent-output上的phone概率可以用nnet3-compute,如果不计算用nnet3-chain-compute-post,二者均可以。正常情况下都是用xent-output的值来计算
1 通过get_phone_post.sh来计算phone上的后验概率
. ./path.sh
. ./cmd.sh
# exp/chain/tri6_7d_tree_sp为chain模型训练时所有训练数据的对齐结果ali.*.gz
# data/test_hires 为需要计算每一帧上phone概率的
# 有一个选项叫--use-xent-output=false 默认false
steps/nnet3/chain/get_phone_post.sh exp/chain/tri6_7d_tree_sp \
exp/chain/tdnn_1a_sp data/lang data/test_hires exp/chain/tdnn1a_sp_post_eval
产生特征在phone_post.scp,有如下的:
HAO0007501-000000 exp/chain/tdnn1a_sp_post_eval/phone_post.1.ark:24
HAO0007501-000001 exp/chain/tdnn1a_sp_post_eval/phone_post.1.ark:54320
HAO0007501-000002 exp/chain/tdnn1a_sp_post_eval/phone_post.1.ark:114258
...
如下是id=HAO0007501-000000的输出来的值,通过结果可以分析,维度为125行(下采样帧数)x217(chain模型的phone总个数)
```shell hmm-info exp/chain/tdnn_1a_sp/final.mdl number of phones 217 number of pdfs 4064 number of transition-ids 8692 number of transition-states 4346 ```
[
0.9998717 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15 8.819912e-15