理解RTF和RTX指标

RTF(real_time_factor实时率,在线识别指标)

RTF(real time factor)表示如下:
R T F = A S R 识 别 所 有 音 频 处 理 时 间 ( 单 位 秒 ) 所 有 音 频 总 时 间 ( 单 位 秒 ) RTF=\frac{ASR识别所有音频处理时间 (单位秒)}{所有音频总时间 (单位秒)} RTF=()ASR()
【意义】平均1秒时长音频ASR算法需要多少秒处理,小于1才能达到实时效果。越小越好,正常0.2-0.3
          该指标针对的是在线ASR识别指标
具体见官方代码(参考文献):

 BaseFloat frame_shift = 0.01;
 BaseFloat real_time_factor =
     global_timer.Elapsed() / (frame_shift * num_frames);
 if (num_frames > 0)
   KALDI_LOG << "Real-time factor was " << real_time_factor
             << " assuming frame shift of " << frame_shift;

另外一段代码(参考文献):

double real_time_factor = total_time_taken_ / total_audio_,
    average_wait = (total_time_taken_ - total_audio_) / num_utts_,
    idle_proportion = total_time_waited_ / total_audio_,
    idle_percent = 100.0 * idle_proportion;
    double elapsed = timer.Elapsed();
    KALDI_LOG << "Time taken "<< elapsed
              << "s: real-time factor assuming 100 frames/sec is "
              << (elapsed*100.0/frame_count);

【注解】 会发现上面三段代码都是一个意思
r e a l _ t i m e _ f a c t o r = t o t a l _ t i m e _ t a k e n t o t a l _ a u d i o = t o t a l _ t i m e _ t a k e n f r a m e _ s h i f t ⋅ n u m _ f r a m e s = t o t a l _ t i m e _ t a k e n 0.01 ⋅ n u m _ f r a m e s = 100 ⋅ t o t a l _ t i m e _ t a k e n n u m _ f r a m e s \begin{aligned} real\_time\_factor & = \frac{total\_time\_taken}{total\_audio} \\ & = \frac{total\_time\_taken}{frame\_shift \cdot num\_frames} \\ & = \frac{total\_time\_taken}{0.01 \cdot num\_frames} \\ & = \frac{100 \cdot total\_time\_taken}{num\_frames} \\ \end{aligned} real_time_factor=total_audiototal_time_taken=frame_shiftnum_framestotal_time_taken=0.01num_framestotal_time_taken=num_frames100total_time_taken
即: 音 频 总 时 长 = t o t a l _ a u d i o = f r a m e _ s h i f t ⋅ n u m _ f r a m e s = 0.01 ⋅ n u m _ f r a m e s \color{red}音频总时长=total\_audio = frame\_shift \cdot num\_frames=0.01 \cdot num\_frames =total_audio=frame_shiftnum_frames=0.01num_frames


RTX(real_time_x实时效率,离线转写指标)

RTX(real time x)表示如下:
R T X = 所 有 音 频 总 时 间 ( 单 位 秒 ) A S R 识 别 所 有 音 频 处 理 时 间 ( 单 位 秒 ) RTX=\frac{所有音频总时间 (单位秒)}{ASR识别所有音频处理时间 (单位秒)} RTX=ASR()()
【意义】平均1秒时间内我们的ASR算法可以处理多长时间的音频,越大越好,正常在GPU上是500多
参考代码:

KALDI_LOG << "Overall: "
              << " Aggregate Total Time: " << total_time
              << " Total Audio: " << total_audio * iterations
              << " RealTimeX: " << total_audio * iterations / total_time;

Reference

online-timing.cc
online2-wav-nnet2-latgen-threaded.cc
gmm-latgen-simple.cc
batched-wav-nnet3-cuda.cc

  • 8
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值