From eba025a6b4871f12a541664d1dead88b5608bf38 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Tue, 26 Apr 2022 10:39:35 +0800 Subject: [PATCH] Mess with thresholds for printing --- egs/librispeech/ASR/pruned2_knowledge/sampling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/egs/librispeech/ASR/pruned2_knowledge/sampling.py b/egs/librispeech/ASR/pruned2_knowledge/sampling.py index 32f191258..a2b7b3a9e 100644 --- a/egs/librispeech/ASR/pruned2_knowledge/sampling.py +++ b/egs/librispeech/ASR/pruned2_knowledge/sampling.py @@ -729,7 +729,7 @@ class SampleCombinedFunction(torch.autograd.Function): @staticmethod @custom_fwd def forward(ctx, p: Tensor, K: int, input_is_log: bool) -> Tuple[Tensor, Tensor]: - if random.random() < 0.0005: + if random.random() < 0.001: print("dtype[1] = ", p.dtype) with torch.no_grad(): weights, indexes = sample_combined_forward(p, K, input_is_log) @@ -892,7 +892,7 @@ class WeightedMatrixLookupFunction(torch.autograd.Function): tensor of shape (*, D), containing weighted sums of rows of `knowledge_base` """ - if random.random() < 0.0005: + if random.random() < 0.001: print("dtype[1] = ", weights.dtype) ctx.save_for_backward(weights.detach(), indexes.detach(), knowledge_base.detach())