class_docstr: MLM+VRM, MLM is only used in training.
  ratio controls the occluded number in a batch.
  The pipeline of VisionLAN in testing is very concise with only a backbone + sequence modeling(transformer unit) + prediction layer(pp layer).
  x: input image
  label_pos: character index
  training_step: LF or LA process
  output
  text_pre: prediction of VRM
  test_rem: prediction of remaining string in MLM
  text_mas: prediction of occluded character in MLM
  mask_c_show: visualization of Mask_c
class_docstr_tok: ["MLM+VRM",",","MLM","is","only","used","in","training",".","ratio","controls","the","occluded","number","in","a","batch",".","The","pipeline","of","VisionLAN","in","testing","is","very","concise","with","only","a","backbone","+","sequence","modeling","(","transformer","unit",")","+","prediction","layer","(","pp","layer",")",".","x",":","input","image","label_pos",":","character","index","training_step",":","LF","or","LA","process","output","text_pre",":","prediction","of","VRM","test_rem",":","prediction","of","remaining","string","in","MLM","text_mas",":","prediction","of","occluded","character","in","MLM","mask_c_show",":","visualization","of","Mask_c"]
code: def __init__(
      self,
      n_layers=3,
      n_position=256,
      n_dim=512,
      max_text_length=25,
      nclass=37,
  ):
      super(MLM_VRM, self).__init__()
      self.MLM = MLM(
          n_dim=n_dim,
          n_position=n_position,
          max_text_length=max_text_length,
      )
      self.SequenceModeling = Transformer_Encoder(
          n_layers=n_layers, n_position=n_position
      )
      self.Prediction = Prediction(
          n_dim=n_dim,
          n_position=n_position,
          N_max_character=max_text_length
          + 1,  # N_max_character = 1 eos + 25 characters
          n_class=nclass,
      )
      self.nclass = nclass
      self.max_text_length = max_text_length
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import Normal, XavierNormal
  import numpy
label_desc: Use image node_id 1 to create a new MLM_VRM object from inherited base classes: nn with example: obj = MLM_VRM(n_layers, n_position, n_dim, max_text_length, nclass)