IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Ver código fonte

Protect against endless loop.

master
Stanislaw Adaszewski 4 anos atrás
pai
commit
2ff358f7ef
1 arquivos alterados com 5 adições e 0 exclusões
  1. +5
    -0
      src/triacontagon/sampling.py

+ 5
- 0
src/triacontagon/sampling.py Ver arquivo

@@ -28,6 +28,11 @@ def fixed_unigram_candidate_sampler(
if len(num_repeats.shape) != 1:
raise ValueError('num_repeats must be 1D')
if torch.any(len(unigrams) - \
(true_classes >= 0).sum(dim=1) < \
num_repeats):
raise ValueError('Not enough classes to choose from')
num_rows = true_classes.shape[0]
print('true_classes.shape:', true_classes.shape)
# unigrams = np.array(unigrams)


Carregando…
Cancelar
Salvar