TwvMetricsOptions Struct Reference

#include <kws-scoring.h>

Collaboration diagram for TwvMetricsOptions:

Public Member Functions

 TwvMetricsOptions ()
 
float beta () const
 
void Register (OptionsItf *opts)
 

Public Attributes

float cost_fa
 
float value_corr
 
float prior_probability
 
float score_threshold
 
float sweep_step
 
float audio_duration
 

Detailed Description

Definition at line 188 of file kws-scoring.h.

Constructor & Destructor Documentation

◆ TwvMetricsOptions()

Definition at line 290 of file kws-scoring.cc.

290  : cost_fa(0.1f),
291  value_corr(1.0f),
292  prior_probability(1e-4f),
293  score_threshold(0.5f),
294  sweep_step(0.05f),
295  audio_duration(0.0f) {}

Member Function Documentation

◆ beta()

float beta ( ) const
inline

Definition at line 212 of file kws-scoring.h.

212  {
213  return (cost_fa/value_corr) * (1.0/prior_probability - 1);
214  }

◆ Register()

void Register ( OptionsItf opts)

Definition at line 297 of file kws-scoring.cc.

References TwvMetricsOptions::cost_fa, TwvMetricsOptions::prior_probability, OptionsItf::Register(), TwvMetricsOptions::score_threshold, TwvMetricsOptions::sweep_step, and TwvMetricsOptions::value_corr.

Referenced by main().

297  {
298  opts->Register("cost-fa", &cost_fa,
299  "The cost of an incorrect detection");
300  opts->Register("value-corr", &value_corr,
301  "The value (gain) of a correct detection");
302  opts->Register("prior-kw-probability", &prior_probability,
303  "The prior probability of a keyword");
304  opts->Register("score-threshold", &score_threshold,
305  "The score threshold for computation of ATWV");
306  opts->Register("sweep-step", &sweep_step,
307  "Size of the bin during sweeping for the oracle measures");
308 
309  // We won't set the audio duration here, as it's supposed to be
310  // a mandatory argument, not optional
311 }

Member Data Documentation

◆ audio_duration

float audio_duration

Definition at line 206 of file kws-scoring.h.

Referenced by main().

◆ cost_fa

float cost_fa

Definition at line 191 of file kws-scoring.h.

Referenced by TwvMetricsOptions::Register().

◆ prior_probability

float prior_probability

Definition at line 197 of file kws-scoring.h.

Referenced by TwvMetricsOptions::Register().

◆ score_threshold

float score_threshold

Definition at line 200 of file kws-scoring.h.

Referenced by TwvMetricsOptions::Register().

◆ sweep_step

float sweep_step

Definition at line 203 of file kws-scoring.h.

Referenced by TwvMetricsOptions::Register(), and TwvMetrics::TwvMetrics().

◆ value_corr

float value_corr

Definition at line 194 of file kws-scoring.h.

Referenced by TwvMetricsOptions::Register().


The documentation for this struct was generated from the following files: