text: import torch.nn as nn
  from chemprop.nn_utils import get_activation_function
  from chemprop.args import TrainArgs
  
  
  def create_FPEncoder(args: TrainArgs):
      """
      Encodes Molecule Fingerpirnt using Feed-Forward Network.
  
      Args:
          :param args: A :class:`~chemprop.args.TrainArgs` object containing model arguments.
  
      Output:
          Sequential of Feed-forward layers for the model.
      """
  
      first_linear_dim = args.features_size
  
      dropout = nn.Dropout(args.dropout)
      activation = get_activation_function(args.activation)
  
      # Create FFN layers
      if args.ffn_num_layers == 1:
          ffn = [dropout, nn.Linear(first_linear_dim, args.fp_ffn_output_size)]
      else:
          ffn = [dropout, nn.Linear(first_linear_dim, args.fp_ffn_hidden_size)]
          for _ in range(args.fp_ffn_num_layers - 2):
              ffn.extend(
                  [activation, dropout, nn.Linear(args.fp_ffn_hidden_size, args.fp_ffn_hidden_size),]
              )
          ffn.extend(
              [activation, dropout, nn.Linear(args.fp_ffn_hidden_size, args.fp_ffn_output_size),]
          )
  
      # return FFN model
      return nn.Sequential(*ffn)
  