teras.layers module

teras.layers module#

Offers layers used in building the state of the art tabular deep learning architectures available in teras.

CategoricalEmbedding(embedding_dim, ...)

Categorical Embedding layer that create trainable embeddings for categorical features values.

CategoricalExtraction(categorical_idx, **kwargs)

CategoricalExtraction layer extracts categorical features from inputs as is.

CLSToken(embedding_dim, **kwargs)

CLS Token layer that makes it possible to append CLS token embedding to the input embeddings in the sequential or functional models.

CLSTokenExtraction([axis])

Extracts CLS Token embeddings.

ContinuousExtraction(continuous_idx, **kwargs)

ContinuousExtraction layer extracts continuous features from inputs as is.

CutMix([probability, mask_seed, shuffle_seed])

CutMix is a regularization layer proposed by Sangdoo Yun et al. in the paper, CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features.

CTGANGeneratorLayer([dim])

Residual Block for Generator as used by the authors of CTGAN proposed in the paper Modeling Tabular data using Conditional GAN.

CTGANDiscriminatorLayer([dim, ...])

Discriminator Layer based on the architecture proposed by Lei Xu et al. in the paper, "Modeling Tabular data using Conditional GAN".

FTTransformerFeatureTokenizer(cardinalities, ...)

Feature Tokenizer layer based on FT-Transformer architecture proposed in the "Revisiting Deep Learning Models for Tabular Data" paper.

GumbelSoftmax([temperature, hard, seed])

Implementation of the Gumbel Softmax activation proposed by Eric Jang et al. in the paper, "Categorical Reparameterization with Gumbel-Softmax".

LayerList(layers[, sequential])

LayerList is a list of layers, but is also a layer itself.

MixUp([alpha, lambda_seed, shuffle_seed])

MixUp is a regularization layer proposed by Hongyi Zhang et al. in the paper, mixup: BEYOND EMPIRICAL RISK MINIMIZATION.

SAINTEmbedding(embedding_dim, cardinalities, ...)

SAINTEmbedding layer as proposed in the paper, "SAINT: Improved Neural Networks for Tabular Data".

SAINTEncoderLayer(embedding_dim[, ...])

SAINTEncoderLayer layer as proposed in the paper, "SAINT: Improved Neural Networks for Tabular Data".

SAINTMultiHeadInterSampleAttention(...[, ...])

Multi Head Inter Sample Attention layer based on the SAINT architecture proposed in the "SAINT: Improved Neural Networks for Tabular Data" paper.

SAINTProjectionHead(hidden_dim, output_dim)

Projection Head layer that is used in the contrastive learning phase of the SAINTPretrainer to project embeddings to a lower dimension.

SAINTReconstructionHead(cardinalities, ...)

SAINT Reconstruction Head layer for SAINTPretrainer.

TabTransformerColumnEmbedding(cardinalities, ...)

Column Embedding layer as proposed in the "TabTransformer: Tabular Data Modeling Using Contextual Embeddings".

TabNetFeatureTransformerLayer(dim, ...)

TabNetFeatureTransformerLayer layer that serves as the building block for the TabNetFeatureTransformer layer which is proposed by Arik et al. in the "TabNet: Attentive Interpretable Tabular Learning" paper.

TabNetAttentiveTransformer(data_dim, ...)

TabNetAttentiveTransformer layer proposed by Arik et al. in the "TabNet: Attentive Interpretable Tabular Learning" paper.

TransformerEncoderLayer(embedding_dim[, ...])

Transformer Encoder Layer as proposed in the original Transformer architecture in the "Attention is all you need" paper.

TransformerFeedForward(embedding_dim[, ...])

Transformer Feed Forward layer as proposed in the original Transformers architecture, in the paper,"Attention is all you need", with a slight addition of optional Dropout layer.