hezar.constants module

Home to all constant variables in Hezar

class hezar.constants.Backends(value)[source]

Bases: ExplicitEnum

All required dependency packages and libraries. Note that the values here must be the exact module names used for importing, for example if you set PILLOW the value must be PIL not pillow, pil, etc.

ACCELERATE = 'accelerate'
DATASETS = 'datasets'
GENSIM = 'gensim'
JIWER = 'jiwer'
LIBROSA = 'librosa'
NLTK = 'nltk'
OPENCV = 'cv2'
PILLOW = 'PIL'
PYTORCH = 'torch'
ROUGE = 'rouge_score'
SCIKIT = 'sklearn'
SEQEVAL = 'seqeval'
SOUNDFILE = 'soundfile'
TENSORBOARD = 'tensorboard'
TOKENIZERS = 'tokenizers'
TORCHVISION = 'torchvision'
TRANSFORMERS = 'transformers'
WANDB = 'wandb'
class hezar.constants.ChannelsAxisSide(value)[source]

Bases: ExplicitEnum

An enumeration.

FIRST = 'first'
LAST = 'last'
class hezar.constants.Color(value)[source]

Bases: ExplicitEnum

An enumeration.

BLUE = '\x1b[94m'
BOLD = '\x1b[1m'
CYAN = '\x1b[96m'
GREEN = '\x1b[92m'
GREY = '\x1b[90m'
HEADER = '\x1b[95m'
ITALIC = '\x1b[3m'
NORMAL = '\x1b[0m'
RED = '\x1b[91m'
UNDERLINE = '\x1b[4m'
YELLOW = '\x1b[93m'
class hezar.constants.ConfigType(value)[source]

Bases: ExplicitEnum

An enumeration.

BASE = 'base'
CRITERION = 'criterion'
DATASET = 'dataset'
EMBEDDING = 'embedding'
LR_SCHEDULER = 'lr_scheduler'
METRIC = 'metric'
MODEL = 'model'
OPTIMIZER = 'optimizer'
PREPROCESSOR = 'preprocessor'
TRAINER = 'trainer'
class hezar.constants.ExplicitEnum(value)[source]

Bases: str, Enum

An enumeration.

classmethod list()[source]
class hezar.constants.ImageType(value)[source]

Bases: ExplicitEnum

An enumeration.

NUMPY = 'numpy'
PILLOW = 'pillow'
TORCH = 'torch'
class hezar.constants.LRSchedulerType(value)[source]

Bases: ExplicitEnum

An enumeration.

CONSTANT = 'constant'
COSINE_ANEALING = 'cosine_anealing'
CYCLIC = 'cyclic'
EXPONENTIAL = 'exponential'
LAMBDA = 'lambda'
LINEAR = 'linear'
MULTI_STEP = 'multi_step'
ONE_CYCLE = 'one_cycle'
POLYNOMIAL = 'polynomial'
REDUCE_ON_PLATEAU = 'reduce_on_plateau'
SEQUENTIAL = 'sequential'
STEP = 'step'
class hezar.constants.LossType(value)[source]

Bases: ExplicitEnum

An enumeration.

BCE = 'bce'
BCE_WITH_LOGITS = 'bce_with_logits'
CROSS_ENTROPY = 'cross_entropy'
CTC = 'ctc'
GAUSSIAN_NLL = 'gaussian_nll'
L1 = 'l1'
MSE = 'mse'
NLL = 'nll'
NLL_2D = 'nll_2d'
POISSON_NLL = 'poisson_nll'
TRIPLE_MARGIN = 'triple_margin'
class hezar.constants.MetricType(value)[source]

Bases: ExplicitEnum

An enumeration.

ACCURACY = 'accuracy'
BLEU = 'bleu'
CER = 'cer'
F1 = 'f1'
PRECISION = 'precision'
RECALL = 'recall'
ROUGE = 'rouge'
SEQEVAL = 'seqeval'
WER = 'wer'
class hezar.constants.OptimizerType(value)[source]

Bases: ExplicitEnum

An enumeration.

ADAM = 'adam'
ADAMW = 'adamw'
SDG = 'sdg'
class hezar.constants.PaddingType(value)[source]

Bases: ExplicitEnum

An enumeration.

LONGEST = 'longest'
MAX_LENGTH = 'max_length'
class hezar.constants.PrecisionType(value)[source]

Bases: ExplicitEnum

An enumeration.

BF16 = 'bf16'
FP16 = 'fp16'
FP8 = 'fp8'
NO = 'no'
class hezar.constants.RegistryType(value)[source]

Bases: ExplicitEnum

An enumeration.

CRITERION = 'criterion'
DATASET = 'dataset'
EMBEDDING = 'embedding'
LR_SCHEDULER = 'lr_scheduler'
METRIC = 'metric'
MODEL = 'model'
OPTIMIZER = 'optimizer'
PREPROCESSOR = 'preprocessor'
TRAINER = 'trainer'
class hezar.constants.RepoType(value)[source]

Bases: ExplicitEnum

An enumeration.

DATASET = 'dataset'
MODEL = 'model'
class hezar.constants.SplitType(value)[source]

Bases: ExplicitEnum

An enumeration.

EVAL = 'eval'
TEST = 'test'
TRAIN = 'train'
VALID = 'validation'
class hezar.constants.TaskType(value)[source]

Bases: ExplicitEnum

An enumeration.

AUDIO_CLASSIFICATION = 'audio_classification'
BACKBONE = 'backbone'
IMAGE2TEXT = 'image2text'
LANGUAGE_MODELING = 'language_modeling'
MASK_FILLING = 'mask_filling'
SEQUENCE_LABELING = 'sequence_labeling'
SPEECH_RECOGNITION = 'speech_recognition'
TEXT_CLASSIFICATION = 'text_classification'
TEXT_DETECTION = 'text_detection'
TEXT_GENERATION = 'text_generation'