From f6619a0b20df572283161506b80db14e3866b57b Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Mon, 25 Apr 2022 20:37:06 +0800 Subject: [PATCH] Remove unnecessary check --- egs/librispeech/ASR/pruned2_knowledge/sampling.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/egs/librispeech/ASR/pruned2_knowledge/sampling.py b/egs/librispeech/ASR/pruned2_knowledge/sampling.py index 79bf14321..cf5b09edc 100644 --- a/egs/librispeech/ASR/pruned2_knowledge/sampling.py +++ b/egs/librispeech/ASR/pruned2_knowledge/sampling.py @@ -570,7 +570,7 @@ def sample_combined_forward(p: Tensor, K: int, input_is_log: bool) -> Tuple[Tens prod_values, prod_indexes = compute_products(values, indexes) # combined_values, combined_indexes: (B, K) these are the top-K - # most-probable combinations of (integerized_ probabilities and their + # most-probable combinations of (integerized probabilities and their # indexes, from largest to smallest probability combined_values, combined_indexes = compute_k_largest(prod_values, K) @@ -651,8 +651,9 @@ def sample_combined_forward(p: Tensor, K: int, input_is_log: bool) -> Tuple[Tens samples) # TODO: could remove the next call - check_shifted_samples(combined_cumsums, delta_P, - shifted_samples, P_sum_product) + if random.random() < 0.01: + check_shifted_samples(combined_cumsums, delta_P, + shifted_samples, P_sum_product) indexes = get_indexes_for_samples(P, P_cumsum, P_cumsum_exclusive,