DECIMER/config.py
def prepare_models(encoder_config, transformer_config, replica_batch_size, verbose=0):
    """This function is used to initiate the Encoder and the Transformer with appropriate
    configs set by the user. After initiating the models this function returns the Encoder,Transformer
    and the optimizer.

    Args:
        encoder_config ([type]): Encoder configuration set by user in the config class.
        transformer_config ([type]): Transformer configuration set by user in the config class.
        replica_batch_size ([type]): Per replica batch size set by user(during distributed training).
        verbose (int, optional): Defaults to 0.

    Returns:
        [type]: Optimizer, Encoder model and the Transformer
    """

    # Instiate an optimizer
    optimizer = tf.keras.optimizers.Adam(learning_rate=0.00051)

    # Instantiate the encoder model

    encoder = Efficient_Net_encoder.Encoder(**encoder_config)
    initialization_batch = encoder(
        tf.ones(
            ((replica_batch_size,) + encoder_config["image_shape"]), dtype=TARGET_DTYPE
        ),
        training=False,
    )

    # Instantiate the decoder model
    transformer = Transformer_decoder.Transformer(**transformer_config)
    transformer(
        initialization_batch, tf.random.uniform((replica_batch_size, 1)), training=False
    )

    # Show the model architectures and plot the learning rate
    if verbose:
        print("\nEncoder model\n")
        print(encoder.summary())

        print("\nTransformer model\n")
        print(transformer.summary())

    return optimizer, encoder, transformer
This function is used to initiate the Encoder and the Transformer with appropriate
    configs set by the user. After initiating the models this function returns the Encoder,Transformer
    and the optimizer.

    Args:
        encoder_config ([type]): Encoder configuration set by user in the config class.
        transformer_config ([type]): Transformer configuration set by user in the config class.
        replica_batch_size ([type]): Per replica batch size set by user(during distributed training).
        verbose (int, optional): Defaults to 0.

    Returns:
        [type]: Optimizer, Encoder model and the Transformer
    
This function is used to initiate the Encoder and the Transformer with appropriate
configs set by the user. After initiating the models this function returns the Encoder,Transformer
and the optimizer.
This function is used to initiate the Encoder and the Transformer with appropriate configs set by the user . After initiating the models this function returns the Encoder Transformer and the optimizer .
def prepare_models(encoder_config, transformer_config, replica_batch_size, verbose=0):
    optimizer = tf.keras.optimizers.Adam(learning_rate=0.00051)
    encoder = Efficient_Net_encoder.Encoder(**encoder_config)
    initialization_batch = encoder(
        tf.ones(
            ((replica_batch_size,) + encoder_config["image_shape"]), dtype=TARGET_DTYPE
        ),
        training=False,
    )
    transformer = Transformer_decoder.Transformer(**transformer_config)
    transformer(
        initialization_batch, tf.random.uniform((replica_batch_size, 1)), training=False
    )
    if verbose:
        print("\nEncoder model\n")
        print(encoder.summary())
        print("\nTransformer model\n")
        print(transformer.summary())
    return optimizer, encoder, transformer
def prepare_models ( encoder_config , transformer_config , replica_batch_size , verbose = 0 ) : optimizer = tf . keras . optimizers . Adam ( learning_rate = 0.00051 ) encoder = Efficient_Net_encoder . Encoder ( ** encoder_config ) initialization_batch = encoder ( tf . ones ( ( ( replica_batch_size , ) + encoder_config [ "image_shape" ] ) , dtype = TARGET_DTYPE ) , training = False , ) transformer = Transformer_decoder . Transformer ( ** transformer_config ) transformer ( initialization_batch , tf . random . uniform ( ( replica_batch_size , 1 ) ) , training = False ) if verbose : print ( "\nEncoder model\n" ) print ( encoder . summary ( ) ) print ( "\nTransformer model\n" ) print ( transformer . summary ( ) ) return optimizer , encoder , transformer
This function is used to initiate the Encoder and the Transformer with appropriate
configs set by the user.
This function is used to initiate the Encoder and the Transformer with appropriate configs set by the user .
"""This function is used to initiate the Encoder and the Transformer with appropriate
    configs set by the user. After initiating the models this function returns the Encoder,Transformer
    and the optimizer.

    Args:
        encoder_config ([type]): Encoder configuration set by user in the config class.
        transformer_config ([type]): Transformer configuration set by user in the config class.
        replica_batch_size ([type]): Per replica batch size set by user(during distributed training).
        verbose (int, optional): Defaults to 0.

    Returns:
        [type]: Optimizer, Encoder model and the Transformer
    """ # Instiate an optimizer # Instantiate the encoder model # Instantiate the decoder model # Show the model architectures and plot the learning rate
Optimizer, Encoder model and the Transformer
Optimizer Encoder model and the Transformer
[type]
encoder_config
Encoder configuration set by user in the config class.
Encoder configuration set by user in the config class .
transformer_config
Transformer configuration set by user in the config class.
Transformer configuration set by user in the config class .
replica_batch_size
Per replica batch size set by user(during distributed training).
Per replica batch size set by user ( during distributed training ) .
verbose
Defaults to 0.
Defaults to 0 .