The module hyperion.torch
provides utilities, dataloaders, neural architectures and models based on PyTorch
These include several custom neural network layers.
These includes a factory class the creates activation layers from config parameters, and custom activation layers.
.. autoclass:: hyperion.torch.layers.activation_factory.ActivationFactory
.. autoclass:: hyperion.torch.layers.swish.Swish
These includes a factory class the creates normalizaton layers from config parameters.
.. automodule:: hyperion.torch.layers.norm_layer_factory
These include custom dropout and drop-connect layers
.. automodule:: hyperion.torch.layers.dropout
Attention layers like the ones used in Transformers and Conformers.
.. automodule:: hyperion.torch.layers.attention
These include custom pooling layers and factory class to create pooling layers from config parameters.
.. automodule:: hyperion.torch.layers.pool_factory
.. automodule:: hyperion.torch.layers.global_pool
These define several feature extraction layers that take wave as input and produce Spectrograms, Filter-banks, MFCC, etc. It also includes a factory class to create feature extraction layers from config params.
.. autoclass:: hyperion.torch.layers.audio_feats_factory.AudioFeatsFactory
.. automodule:: hyperion.torch.layers.audio_feats
.. automodule:: hyperion.torch.layers.mvn
.. automodule:: hyperion.torch.layers.spec_augment
These are output layers that are used to create large margin cross-entorpy losses.
.. automodule:: hyperion.torch.layers.margin_losses
These are layers related to probability density functions used in VAEs
.. automodule:: hyperion.torch.layers.pdf_storage
.. automodule:: hyperion.torch.layers.tensor2pdf
These are vector quantization layers like the ones used in VQ-VAEs
.. automodule:: hyperion.torch.layers.vq
These include layers related to upsampling operations.
.. automodule:: hyperion.torch.layers.interpolate
.. automodule:: hyperion.torch.layers.subpixel_convs
These include layers that implement positional encoders used in transformers.
.. automodule:: hyperion.torch.layers.pos_encoder
These are layers that are used to simulate the calibration block after the speaker recognition back-end
.. automodule:: hyperion.torch.layers.calibrators
These are Torch modules that combine several layers. These are the building blocks used to create more complex architectures like ResNets, Transformers of EfficientNets.
These are fully connected blocks used to create simple feed forward networks, classification heads, etc.
.. automodule:: hyperion.torch.layer_blocks.fc_blocks
These are blocks to create deep convolutional networks 1d without residuals.
.. automodule:: hyperion.torch.layer_blocks.dc1d_blocks
These are blocks to create deep convolutional networks 2d without residuals.
.. automodule:: hyperion.torch.layer_blocks.dc2d_blocks
TDNN blocks used to create TDNN x-vectors
.. automodule:: hyperion.torch.layer_blocks.tdnn_blocks
Extended TDNN blocks used to create E-TDNN x-vectors
.. automodule:: hyperion.torch.layer_blocks.etdnn_blocks
Extended TDNN blocks with residual connections
.. automodule:: hyperion.torch.layer_blocks.resetdnn_blocks
Squeeze-Excitation Blocks 1d and 2d, which are added at the output ResNet blocks and other to create squeeze-excitation networks.
.. automodule:: hyperion.torch.layer_blocks.se_blocks
These are blocks used to create cannonical ResNet, SE-ResNet, Res2Nets, etc.
These blocks are used to create cannonical ResNets.
.. automodule:: hyperion.torch.layer_blocks.resnet_blocks
These blocks are used to create cannonical Squeeze-Excitation ResNets
.. automodule:: hyperion.torch.layer_blocks.seresnet_blocks
These blocks are used to create cannonical Squeeze-Excitation ResNets.
.. automodule:: hyperion.torch.layer_blocks.res2net_blocks
These are some extra blocks needed to build SpineNet and Spine2Net.
.. automodule:: hyperion.torch.layer_blocks.spine_blocks
These are blocks needed to build EfficientNet networks.
.. automodule:: hyperion.torch.layer_blocks.mbconv_blocks
These are blocks used to buld flexible ResNets based on 1d convs.
.. automodule:: hyperion.torch.layer_blocks.resnet1d_blocks
These are blocks used to buld flexible Res2Nets based on 1d convs.
.. automodule:: hyperion.torch.layer_blocks.res2net1d_blocks
These are blocks used to buld flexible ResNets based on 2d convs.
.. automodule:: hyperion.torch.layer_blocks.resnet2d_blocks
These are blocks used to buld flexible Res2Nets based on 2d convs.
.. automodule:: hyperion.torch.layer_blocks.res2net2d_blocks
These are blocks used to build Transformers.
.. automodule:: hyperion.torch.layer_blocks.transformer_conv2d_subsampler
.. automodule:: hyperion.torch.layer_blocks.transformer_encoder_v1
.. automodule:: hyperion.torch.layer_blocks.transformer_feedforward
.. automodule:: hyperion.torch.layer_blocks.conformer_encoder_v1
.. automodule:: hyperion.torch.layer_blocks.conformer_conv
All PyTorch ML Neural Architectures and Models in Hyperion derive from the same base class
.. autoclass:: hyperion.torch.TorchModel
The TorchModelLoader
can load any model or network architecture from file.
.. autoclass:: hyperion.torch_model_loader.TorchModelLoader
All neural architectures derive from the NetArch
class.
.. autoclass:: hyperion.torch.narchs.net_arch.NetArch
The TorchNALoader
can load any network architecture from file.
.. autoclass:: hyperion.torch.narchs.torch_na_loader.TorchNALoader
.. autoclass:: hyperion.torch.narchs.audio_feats_mvn.AudioFeatsMVN
.. autoclass:: hyperion.torch.narchs.fc_net.FCNet
.. autoclass:: hyperion.torch.narchs.classif_head.ClassifHead
These are Encoder/Decoders based on Deep Convolutional Networks 1d and 2d.
.. autoclass:: hyperion.torch.narchs.dc1d_encoder.DC1dEncoder
.. autoclass:: hyperion.torch.narchs.dc1d_decoder.DC1dDecoder
.. autoclass:: hyperion.torch.narchs.dc2d_encoder.DC2dEncoder
.. autoclass:: hyperion.torch.narchs.dc2d_decoder.DC2dDecoder
These are variants of TDNNs. There is a factory class that creates TDNN networks from config params.
.. autoclass:: hyperion.torch.narchs.tdnn_factory.TDNNFactory
.. autoclass:: hyperion.torch.narchs.tdnn.TDNNV1
.. autoclass:: hyperion.torch.narchs.etdnn.ETDNNV1
.. autoclass:: hyperion.torch.narchs.resetdnn.ResETDNNV1
These classes can be used to build cannonical ResNets, SE-ResNets and Res2Nets. There is a factory class that creates ResNets from config params.
.. autoclass:: hyperion.torch.narchs.resnet_factory.ResNetFactory
.. automodule:: hyperion.torch.narchs.resnet
.. autoclass:: hyperion.torch.narchs.spinenet_factory.SpineNetFactory
.. automodule:: hyperion.torch.narchs.spinenet
These are Encoder/Decoders based on flexible ResNets 1d and 2d.
.. autoclass:: hyperion.torch.narchs.resnet1d_encoder.ResNet1dEncoder
.. autoclass:: hyperion.torch.narchs.resnet1d_decoder.ResNet1dDecoder
.. autoclass:: hyperion.torch.narchs.resnet2d_encoder.ResNet2dEncoder
.. autoclass:: hyperion.torch.narchs.resnet2d_decoder.ResNet2dDecoder
.. autoclasss:: hyperion.torch.narchs.efficient_net.EfficientNet
.. autoclass:: hyperion.torch.narchs.transformer_encoder_v1.TransformerEncoderV1
.. autoclass:: hyperion.torch.narchs.conformer_encoder_v1.ConformerEncoderV1
These include complex models created by connecting several network architectures.
There are several variants of x-vector embeddings. They all derive from the same base class.
.. autoclass:: hyperion.torch.models.xvectors.xvector.XVector
x-Vectors with TDNN, E-TDNN, Residual E-TDNN Encoders.
.. autoclass:: hyperion.torch.models.xvectors.tdnn_xvector.TDNNXVector
x-Vectors with Cannonical ResNet, Res2Net Encoders.
.. autoclass:: hyperion.torch.models.xvectors.resnet_xvector.ResNetXVector
x-Vectors with SpineNet, Spine2Net Encoders.
.. autoclass:: hyperion.torch.models.xvectors.spinenet_xvector.SpineNetXVector
x-Vectors with ResNet, Res2Net 1d Encoders. It can be cofigured as ECAPA-TDNN
.. autoclass:: hyperion.torch.models.xvectors.resnet1d_xvector.ResNet1dXVector
x-Vectors based on Transformer Encoder
.. autoclass:: hyperion.torch.models.xvectors.transformer_xvector_v1.TransformerXVectorV1
.. autoclass:: hyperion.torch.models.ae.ae.AE
.. autoclass:: hyperion.torch.models.vae.vae.VAE
.. autoclass:: hyperion.torch.models.vae.vq_vae.VQVAE
Custom loss classes
.. autoclass:: hyperion.torch.losses.bce_with_llr.BCEWithLLR
It contains classes to generate adversarial attacks for speaker recognition.
All the adv. attacks derive from the same base class:
.. autoclass:: hyperion.torch.adv_attacks.adv_attack.AdvAttack
.. autoclass:: hyperion.torch.adv_attacks.fgsm_attack.FGSMAttack
.. autoclass:: hyperion.torch.adv_attacks.snr_fgsm_attack.SNRFGSMAttack
.. autoclass:: hyperion.torch.adv_attacks.rand_fgsm_attack.RandFGSMAttack
.. autoclass:: hyperion.torch.adv_attacks.iter_fgsm_attack.IterFGSMAttack
.. autoclass:: hyperion.torch.adv_attacks.pgd_attack.PGDAttack
Carlini-Wagner attacks derive from the same base class:
.. autoclass:: hyperion.torch.adv_attacks.carlini_wagner.CarliniWagner
.. autoclass:: hyperion.torch.adv_attacks.carlini_wagner_l2.CarliniWagnerL2
.. autoclass:: hyperion.torch.adv_attacks.carlini_wagner_linf.CarliniWagnerLInf
.. autoclass:: hyperion.torch.adv_attacks.carlini_wagner_l0.CarliniWagnerL0
These are factory classes that create attack generator objects. They create attacks from Hyperion or from the Adversarial Robustness Toolbox <https://github.com/Trusted-AI/adversarial-robustness-toolbox>
.. autoclass:: hyperion.torch.adv_attacks.attack_factory.AttackFactory
.. autoclass:: hyperion.torch.adv_attacks.random_attack_factory.RandomAttackFactory
.. autoclass:: hyperion.torch.adv_attacks.art_attack_factory.ARTAttackFactory
.. autoclass:: hyperion.torch.trainers.torch_trainer.TorchTrainer
.. autoclass:: hyperion.torch.trainers.xvector_trainer.XVectorTrainer
.. autoclass:: hyperion.torch.trainers.xvector_trainer_from_wav.XVectorTrainerFromWav
.. autoclass:: hyperion.torch.trainers.xvector_trainer_deep_feat_reg.XVectorTrainerDeepFeatReg
.. autoclass:: hyperion.torch.trainers.xvector_trainer_deep_feat_reg_from_wav.XVectorTrainerDeepFeatRegFromWav
.. autoclass:: hyperion.torch.trainers.ae_trainer.AETrainer
.. autoclass:: hyperion.torch.trainers.vae_trainer.VAETrainer
.. autoclass:: hyperion.torch.trainers.dvae_trainer.DVAETrainer
.. autoclass:: hyperion.torch.trainers.vq_vae_trainer.VQVAETrainer
.. autoclass:: hyperion.torch.trainers.vq_dvae_trainer.VQDVAETrainer
.. autoclass:: hyperion.torch.data.audio_dataset.AudioDataset
.. autoclass:: hyperion.torch.data.feat_seq_dataset.FeatSeqDataset
.. autoclass:: hyperion.torch.data.paired_feat_seq_dataset.PairedFeatSeqDataset
.. autoclass:: hyperion.torch.data.embed_dataset.EmbedDataset
.. automodule:: hyperion.torch.data.weighted_seq_sampler
.. automodule:: hyperion.torch.data.weighted_embed_sampler
.. autoclass:: hyperion.torch.transforms.reshape.Reshape
These are custom optimizers and a factory class to create optimizers from config params.
.. autoclass:: hyperion.torch.optim.radam.RAdam
.. autoclass:: hyperion.torch.optim.factory.OptimizerFactory
These are custom learning rate schedulers and a factory class to create schedulers from config params.
.. autoclass:: hyperion.torch.lr_schedulers.red_lr_on_plateau.ReduceLROnPlateau
.. autoclass:: hyperion.torch.lr_schedulers.exp_lr.ExponentialLR
.. autoclass:: hyperion.torch.lr_schedulers.invpow_lr.InvPowLR
.. autoclass:: hyperion.torch.lr_schedulers.cos_lr.CosineLR
.. autoclass:: hyperion.torch.lr_schedulers.factory.LRSchedulerFactory
This are metric classes and functions that cannot be used as loss function.
.. autoclass:: hyperion.torch.metrics.metrics.TorchMetric
.. automodule:: hyperion.torch.metrics.accuracy
.. automodule:: hyperion.torch.metrics.accuracy_functional
The logger classes are used to write information to standard output, log files, tensorboard or WandB.
The LoggerList class contains a set of loggers. When we log something to the LoggerList, the same is written
in all the loggers contained in it. The loggers support multi-gpu training with DistributedDataParallel
.. autoclass:: hyperion.torch.loggers.logger.Logger
.. autoclass:: hyperion.torch.loggers.prog_logger.ProgLogger
.. autoclass:: hyperion.torch.loggers.csv_logger.CSVLogger
.. autoclass:: hyperion.torch.loggers.tensorboard_logger.TensorBoardLogger
.. autoclass:: hyperion.torch.loggers.wandb_logger.WAndBLogger
.. autoclass:: hyperion.torch.loggers.logger_list.LoggerList
Utilities to handle GPU devices, like finding a free GPU in a shared server.
.. automodule:: hyperion.torch.utils.devices
These contains utils to perform multigpu training with Distributed Data Paralell.
.. automodule:: hyperion.torch.utils.ddp
Tools to combine the metrics computed in multiple GPUs into a single metric
.. automodule:: hyperion.torch.utils.metric_acc
Functions that can be usefull when evaluating neural networks. For example, when a signal is too long to fit in memory and needs to be splitted into chunks
.. automodule:: hyperion.torch.utils.eval_utils
.. automodule:: hyperion.torch.utils.math
.. automodule:: hyperion.torch.utils.misc