config

Package constants used throughout pydrobert.torch

If this submodule is imported first in pydrobert.torch and any values are changed, the changes will propagate to any submodules.

This list is non-exhaustive; types or functions may have their own defaults.

pydrobert.torch.config.DEFT_ALI_SUBDIR = 'ali'

Default subdirectory of a torch data directory containing alignments

pydrobert.torch.config.DEFT_CHUNK_SIZE = 1000

Default number of units to process at once when performing multiprocessing

pydrobert.torch.config.DEFT_CTM_CHANNEL = 'A'

Default channel to write to CTM files

pydrobert.torch.config.DEFT_DEL_COST = 1.0

Default deletion cost in error rate/distance computations

pydrobert.torch.config.DEFT_FEAT_SUBDIR = 'feat'

Default subdirectory of a torch data directory containing features

pydrobert.torch.config.DEFT_FILE_PREFIX = ''

Default prefix of a torch data file

pydrobert.torch.config.DEFT_FILE_SUFFIX = '.pt'

Default suffix of a torch data file

pydrobert.torch.config.DEFT_FLOAT_PRINT_PRECISION = 3

Default precision to write floating point values to file with

pydrobert.torch.config.DEFT_FRAME_SHIFT_MS = 10.0

The default frame shift in milliseconds for commands

pydrobert.torch.config.DEFT_HYP_SUBDIR = 'hyp'

Default subdirectory of a torch data directory to write hypothesis tokens to

pydrobert.torch.config.DEFT_INS_COST = 1.0

Default insertion cost in error rate/distance computations

pydrobert.torch.config.DEFT_NUM_WORKERS = 2

Default number of workers when performing multiprocessing

pydrobert.torch.config.DEFT_PAD_VALUE = 0.0

Default value to pad floating-point tensors with

pydrobert.torch.config.DEFT_PDFS_SUBDIR = 'pdfs'

Default subdirectory of a torch data directory to write pdfs to

pydrobert.torch.config.DEFT_REF_SUBDIR = 'ref'

Default subdirectory of a torch data directory containing reference tokens

pydrobert.torch.config.DEFT_SUB_COST = 1.0

Default substitution cost in error rate/distance computations

pydrobert.torch.config.DEFT_TEXTGRID_SUFFIX = '.TextGrid'

The default suffix indicating TextGrid files for commands

pydrobert.torch.config.DEFT_TEXTGRID_TIER_ID = 0

Default TextGrid tier to read transcripts from

pydrobert.torch.config.DEFT_TEXTGRID_TIER_NAME = 'transcript'

Default TextGrid tiear to write transcripts to

pydrobert.torch.config.EPS_0 = -2.3841860752327643e-07

A large enough value in log space that exponentiating it is very close to 1

This number is sometimes used in place of 0 in log-space values to avoid masking. Decreasing it will decrease the accuracy of computations, but may avoid NaNs.

pydrobert.torch.config.EPS_INF = 44.361419526034176

A large enough value in log space that exponentiating it is near infinity

This number is sometimes used in place of infinity in log-space values to avoid masking. Decreasing it will decrease the accuracy of computations, but may avoid NaNs.

pydrobert.torch.config.EPS_NINF = -43.66827237527655

A small enough value in log space that exponentiating it is very close to zero

This number is sometimes used in place of -infinity in log-space values to avoid masking. Increasing it will decrease the accuracy of computations, but may avoid NaNs.

pydrobert.torch.config.INDEX_PAD_VALUE = -100

The value to pad index-based tensors with

Batched operations often involve variable-width input. This value is used to right-pad indexed-based tensors with to indicate that this element should be ignored.

The default value (-100) was chosen to coincide with the PyTorch 1.0 default for ignore_index in the likelihood losses

pydrobert.torch.config.TINY = 1.1754943508222875e-38

Smallest representable floating-point integer

pydrobert.torch.config.USE_JIT = False

Whether to eagerly compile functions with JIT

If True, pydrobert.torch compile all functions it can with JIT on import. Otherwise, if using PyTorch >= 1.8.0, relevant items will be decorated with torch.jit.script_if_tracing(). The default is True if and only if the environment variable PYTORCH_JIT=1.