Skip to content

Commit

Permalink
Cosmetic variable name change: OptionsItf po -> OptionsItf opts
Browse files Browse the repository at this point in the history
  • Loading branch information
vdp committed Aug 2, 2015
1 parent 5c01929 commit 28d28b0
Show file tree
Hide file tree
Showing 79 changed files with 1,312 additions and 1,312 deletions.
14 changes: 7 additions & 7 deletions src/decoder/decoder-wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ struct AlignConfig {

AlignConfig(): beam(200.0), retry_beam(0.0), careful(false) { }

void Register(OptionsItf *po) {
po->Register("beam", &beam, "Decoding beam used in alignment");
po->Register("retry-beam", &retry_beam,
"Decoding beam for second try at alignment");
po->Register("careful", &careful,
"If true, do 'careful' alignment, which is better at detecting "
"alignment failure (involves loop to start of decoding graph).");
void Register(OptionsItf *opts) {
opts->Register("beam", &beam, "Decoding beam used in alignment");
opts->Register("retry-beam", &retry_beam,
"Decoding beam for second try at alignment");
opts->Register("careful", &careful,
"If true, do 'careful' alignment, which is better at detecting "
"alignment failure (involves loop to start of decoding graph).");
}
};

Expand Down
18 changes: 9 additions & 9 deletions src/decoder/faster-decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ struct FasterDecoderOptions {
// alignment, use small default.
beam_delta(0.5),
hash_ratio(2.0) { }
void Register(OptionsItf *po, bool full) { /// if "full", use obscure
void Register(OptionsItf *opts, bool full) { /// if "full", use obscure
/// options too.
/// Depends on program.
po->Register("beam", &beam, "Decoder beam");
po->Register("max-active", &max_active, "Decoder max active states.");
po->Register("min-active", &min_active,
"Decoder min active states (don't prune if #active less than this).");
opts->Register("beam", &beam, "Decoder beam");
opts->Register("max-active", &max_active, "Decoder max active states.");
opts->Register("min-active", &min_active,
"Decoder min active states (don't prune if #active less than this).");
if (full) {
po->Register("beam-delta", &beam_delta,
"Increment used in decoder [obscure setting]");
po->Register("hash-ratio", &hash_ratio,
"Setting used in decoder to control hash behavior");
opts->Register("beam-delta", &beam_delta,
"Increment used in decoder [obscure setting]");
opts->Register("hash-ratio", &hash_ratio,
"Setting used in decoder to control hash behavior");
}
}
};
Expand Down
32 changes: 16 additions & 16 deletions src/decoder/lattice-faster-decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@ struct LatticeFasterDecoderConfig {
beam_delta(0.5),
hash_ratio(2.0),
prune_scale(0.1) { }
void Register(OptionsItf *po) {
det_opts.Register(po);
po->Register("beam", &beam, "Decoding beam.");
po->Register("max-active", &max_active, "Decoder max active states.");
po->Register("min-active", &min_active, "Decoder minimum #active states.");
po->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
po->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens");
po->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence).");
po->Register("beam-delta", &beam_delta, "Increment used in decoding-- this "
"parameter is obscure and relates to a speedup in the way the "
"max-active constraint is applied. Larger is more accurate.");
po->Register("hash-ratio", &hash_ratio, "Setting used in decoder to control"
" hash behavior");
void Register(OptionsItf *opts) {
det_opts.Register(opts);
opts->Register("beam", &beam, "Decoding beam.");
opts->Register("max-active", &max_active, "Decoder max active states.");
opts->Register("min-active", &min_active, "Decoder minimum #active states.");
opts->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
opts->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens");
opts->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence).");
opts->Register("beam-delta", &beam_delta, "Increment used in decoding-- this "
"parameter is obscure and relates to a speedup in the way the "
"max-active constraint is applied. Larger is more accurate.");
opts->Register("hash-ratio", &hash_ratio, "Setting used in decoder to control"
" hash behavior");
}
void Check() const {
KALDI_ASSERT(beam > 0.0 && max_active > 1 && lattice_beam > 0.0
Expand Down
18 changes: 9 additions & 9 deletions src/decoder/lattice-simple-decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ struct LatticeSimpleDecoderConfig {
determinize_lattice(true),
beam_ratio(0.9),
prune_scale(0.1) { }
void Register(OptionsItf *po) {
det_opts.Register(po);
po->Register("beam", &beam, "Decoding beam.");
po->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
po->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens");
po->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence).");
void Register(OptionsItf *opts) {
det_opts.Register(opts);
opts->Register("beam", &beam, "Decoding beam.");
opts->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
opts->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens");
opts->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence).");
}
void Check() const {
KALDI_ASSERT(beam > 0.0 && lattice_beam > 0.0 && prune_interval > 0);
Expand Down
34 changes: 17 additions & 17 deletions src/decoder/lattice-tracking-decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@ struct LatticeTrackingDecoderConfig {
hash_ratio(2.0),
extra_beam(4.0),
max_beam(40.0) { }
void Register(OptionsItf *po) {
det_opts.Register(po);
po->Register("beam", &beam, "Decoding beam.");
po->Register("max-active", &max_active, "Decoder max active states.");
po->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
po->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens");
po->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence).");
po->Register("beam-delta", &beam_delta, "Increment used in decoding");
po->Register("hash-ratio", &hash_ratio, "Setting used in decoder to control"
" hash behavior");
po->Register("extra-beam", &extra_beam, "Increment used in decoding (added "
"to worst tracked token from first pass)");
po->Register("max-beam", &max_beam, "Maximum beam (in case tracked tokens "
"go too far from beam)");
void Register(OptionsItf *opts) {
det_opts.Register(opts);
opts->Register("beam", &beam, "Decoding beam.");
opts->Register("max-active", &max_active, "Decoder max active states.");
opts->Register("lattice-beam", &lattice_beam, "Lattice generation beam");
opts->Register("prune-interval", &prune_interval, "Interval (in frames) at "
"which to prune tokens");
opts->Register("determinize-lattice", &determinize_lattice, "If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence).");
opts->Register("beam-delta", &beam_delta, "Increment used in decoding");
opts->Register("hash-ratio", &hash_ratio, "Setting used in decoder to control"
" hash behavior");
opts->Register("extra-beam", &extra_beam, "Increment used in decoding (added "
"to worst tracked token from first pass)");
opts->Register("max-beam", &max_beam, "Maximum beam (in case tracked tokens "
"go too far from beam)");

}
void Check() const {
Expand Down
16 changes: 8 additions & 8 deletions src/decoder/nbest-decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ struct NBestDecoderOptions {
max_active(std::numeric_limits<int32>::max()),
n_best(1),
beam_delta(0.5), hash_ratio(2.0) { }
void Register(OptionsItf *po, bool full) { /// if "full", use obscure
void Register(OptionsItf *opts, bool full) { /// if "full", use obscure
/// options too.
/// Depends on program.
po->Register("beam", &beam, "Decoder beam");
po->Register("max-active", &max_active, "Decoder max active states.");
po->Register("n-best", &n_best, "Decoder number of best tokens.");
opts->Register("beam", &beam, "Decoder beam");
opts->Register("max-active", &max_active, "Decoder max active states.");
opts->Register("n-best", &n_best, "Decoder number of best tokens.");
if (full) {
po->Register("beam-delta", &beam_delta,
"Increment used in decoder [obscure setting]");
po->Register("hash-ratio", &hash_ratio,
"Setting used in decoder to control hash behavior");
opts->Register("beam-delta", &beam_delta,
"Increment used in decoder [obscure setting]");
opts->Register("hash-ratio", &hash_ratio,
"Setting used in decoder to control hash behavior");
}
}
};
Expand Down
16 changes: 8 additions & 8 deletions src/decoder/training-graph-compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ struct TrainingGraphCompilerOptions {
rm_eps(false),
reorder(b) { }

void Register(OptionsItf *po) {
po->Register("transition-scale", &transition_scale, "Scale of transition "
"probabilities (excluding self-loops)");
po->Register("self-loop-scale", &self_loop_scale, "Scale of self-loop vs. "
"non-self-loop probability mass ");
po->Register("reorder", &reorder, "Reorder transition ids for greater decoding efficiency.");
po->Register("rm-eps", &rm_eps, "Remove [most] epsilons before minimization (only applicable "
"if disambig symbols present)");
void Register(OptionsItf *opts) {
opts->Register("transition-scale", &transition_scale, "Scale of transition "
"probabilities (excluding self-loops)");
opts->Register("self-loop-scale", &self_loop_scale, "Scale of self-loop vs. "
"non-self-loop probability mass ");
opts->Register("reorder", &reorder, "Reorder transition ids for greater decoding efficiency.");
opts->Register("rm-eps", &rm_eps, "Remove [most] epsilons before minimization (only applicable "
"if disambig symbols present)");
}
};

Expand Down
28 changes: 14 additions & 14 deletions src/feat/feature-fbank.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ struct FbankOptions {
htk_compat(false),
use_log_fbank(true) {}

void Register(OptionsItf *po) {
frame_opts.Register(po);
mel_opts.Register(po);
po->Register("use-energy", &use_energy,
"Add an extra dimension with energy to the FBANK output.");
po->Register("energy-floor", &energy_floor,
"Floor on energy (absolute, not relative) in FBANK computation");
po->Register("raw-energy", &raw_energy,
"If true, compute energy before preemphasis and windowing");
po->Register("htk-compat", &htk_compat, "If true, put energy last. "
"Warning: not sufficient to get HTK compatible features (need "
"to change other parameters).");
po->Register("use-log-fbank", &use_log_fbank,
"If true, produce log-filterbank, else produce linear.");
void Register(OptionsItf *opts) {
frame_opts.Register(opts);
mel_opts.Register(opts);
opts->Register("use-energy", &use_energy,
"Add an extra dimension with energy to the FBANK output.");
opts->Register("energy-floor", &energy_floor,
"Floor on energy (absolute, not relative) in FBANK computation");
opts->Register("raw-energy", &raw_energy,
"If true, compute energy before preemphasis and windowing");
opts->Register("htk-compat", &htk_compat, "If true, put energy last. "
"Warning: not sufficient to get HTK compatible features (need "
"to change other parameters).");
opts->Register("use-log-fbank", &use_log_fbank,
"If true, produce log-filterbank, else produce linear.");
}
};

Expand Down
Loading

0 comments on commit 28d28b0

Please sign in to comment.