DECIMER/config.py
def initialize_transformer_config(
        self,
        vocab_len,
        max_len,
        n_transformer_layers,
        transformer_d_dff,
        transformer_n_heads,
        image_embedding_dim,
        dropout_rate=0.1,
    ):
        """This functions initializes the Transformer model as decoder with user defined
        configurations.


        Args:
            vocab_len (int): Total number of words in the input vocabulary
            max_len (int): Maximum length of the string found on the training dataset
            n_transformer_layers (int): Number of layers present in the transformer model
            transformer_d_dff (int): Transformer feed forward upwards projection size
            transformer_n_heads (int): Number of heads present in the transformer model
            image_embedding_dim (int): Total number of dimension the image gets embeddeded
            dropout_rate (float, optional): Fraction of the input units to drop. Defaults to 0.1.
        """
        self.transformer_config = dict(
            num_layers=n_transformer_layers,
            d_model=image_embedding_dim[-1],
            num_heads=transformer_n_heads,
            dff=transformer_d_dff,
            target_vocab_size=vocab_len,
            pe_input=image_embedding_dim[0],
            pe_target=max_len,
            dropout_rate=0.1,
        )
This functions initializes the Transformer model as decoder with user defined
        configurations.


        Args:
            vocab_len (int): Total number of words in the input vocabulary
            max_len (int): Maximum length of the string found on the training dataset
            n_transformer_layers (int): Number of layers present in the transformer model
            transformer_d_dff (int): Transformer feed forward upwards projection size
            transformer_n_heads (int): Number of heads present in the transformer model
            image_embedding_dim (int): Total number of dimension the image gets embeddeded
            dropout_rate (float, optional): Fraction of the input units to drop. Defaults to 0.1.
        
This functions initializes the Transformer model as decoder with user defined
configurations.
This functions initializes the Transformer model as decoder with user defined configurations .
def initialize_transformer_config(
        self,
        vocab_len,
        max_len,
        n_transformer_layers,
        transformer_d_dff,
        transformer_n_heads,
        image_embedding_dim,
        dropout_rate=0.1,
    ):
        self.transformer_config = dict(
            num_layers=n_transformer_layers,
            d_model=image_embedding_dim[-1],
            num_heads=transformer_n_heads,
            dff=transformer_d_dff,
            target_vocab_size=vocab_len,
            pe_input=image_embedding_dim[0],
            pe_target=max_len,
            dropout_rate=0.1,
        )
def initialize_transformer_config ( self , vocab_len , max_len , n_transformer_layers , transformer_d_dff , transformer_n_heads , image_embedding_dim , dropout_rate = 0.1 , ) : self . transformer_config = dict ( num_layers = n_transformer_layers , d_model = image_embedding_dim [ - 1 ] , num_heads = transformer_n_heads , dff = transformer_d_dff , target_vocab_size = vocab_len , pe_input = image_embedding_dim [ 0 ] , pe_target = max_len , dropout_rate = 0.1 , )
This functions initializes the Transformer model as decoder with user defined
configurations.
This functions initializes the Transformer model as decoder with user defined configurations .
"""This functions initializes the Transformer model as decoder with user defined
        configurations.


        Args:
            vocab_len (int): Total number of words in the input vocabulary
            max_len (int): Maximum length of the string found on the training dataset
            n_transformer_layers (int): Number of layers present in the transformer model
            transformer_d_dff (int): Transformer feed forward upwards projection size
            transformer_n_heads (int): Number of heads present in the transformer model
            image_embedding_dim (int): Total number of dimension the image gets embeddeded
            dropout_rate (float, optional): Fraction of the input units to drop. Defaults to 0.1.
        """
self
vocab_len
Total number of words in the input vocabulary
Total number of words in the input vocabulary
max_len
Maximum length of the string found on the training dataset
Maximum length of the string found on the training dataset
n_transformer_layers
Number of layers present in the transformer model
Number of layers present in the transformer model
transformer_d_dff
Transformer feed forward upwards projection size
Transformer feed forward upwards projection size
transformer_n_heads
Number of heads present in the transformer model
Number of heads present in the transformer model
image_embedding_dim
Total number of dimension the image gets embeddeded
Total number of dimension the image gets embeddeded
dropout_rate
Fraction of the input units to drop. Defaults to 0.1.
Fraction of the input units to drop . Defaults to 0 . 1 .
0.1