| 383 | |
| 384 | template <typename T, typename CTCBeamState, typename CTCBeamComparer> |
| 385 | void CTCBeamSearchDecoder<T, CTCBeamState, CTCBeamComparer>::Reset() { |
| 386 | leaves_.Reset(); |
| 387 | |
| 388 | // This beam root, and all of its children, will be in memory until |
| 389 | // the next reset. |
| 390 | beam_root_.reset(new BeamRoot(nullptr, -1)); |
| 391 | beam_root_->RootEntry()->newp.total = T(0.0); // ln(1) |
| 392 | beam_root_->RootEntry()->newp.blank = T(0.0); // ln(1) |
| 393 | |
| 394 | // Add the root as the initial leaf. |
| 395 | leaves_.push(beam_root_->RootEntry()); |
| 396 | |
| 397 | // Call initialize state on the root object. |
| 398 | beam_scorer_->InitializeState(&beam_root_->RootEntry()->state); |
| 399 | } |
| 400 | |
| 401 | template <typename T, typename CTCBeamState, typename CTCBeamComparer> |
| 402 | Status CTCBeamSearchDecoder<T, CTCBeamState, CTCBeamComparer>::TopPaths( |