示例#1
0
    def add_args(parser):
        FairseqNATModel.add_args(parser)

        # length prediction
        parser.add_argument(
            "--src-embedding-copy",
            action="store_true",
            help=
            "copy encoder word embeddings as the initial input of the decoder",
        )
        parser.add_argument(
            "--pred-length-offset",
            action="store_true",
            help=
            "predicting the length difference between the target and source sentences",
        )
        parser.add_argument(
            "--sg-length-pred",
            action="store_true",
            help="stop the gradients back-propagated from the length predictor",
        )
        parser.add_argument(
            "--length-loss-factor",
            type=float,
            help="weights on the length prediction loss",
        )
示例#2
0
 def add_args(parser):
     FairseqNATModel.add_args(parser)
     parser.add_argument(
         "--early-exit",
         default="6,6,6",
         type=str,
         help="number of decoder layers before word_del, mask_ins, word_ins",
     )
     parser.add_argument(
         "--no-share-discriminator",
         action="store_true",
         help="separate parameters for discriminator",
     )
     parser.add_argument(
         "--no-share-maskpredictor",
         action="store_true",
         help="separate parameters for mask-predictor",
     )
     parser.add_argument(
         "--share-discriminator-maskpredictor",
         action="store_true",
         help=
         "share the parameters for both mask-predictor and discriminator",
     )
     parser.add_argument(
         "--sampling-for-deletion",
         action="store_true",
         help="instead of argmax, use sampling to predict the tokens",
     )
示例#3
0
 def add_args(parser):
     """Add model-specific arguments to the parser."""
     FairseqNATModel.add_args(parser)
     # parser.add_argument('--encoder-learned-pos', action='store_true',
     #                     help='use learned positional embeddings in the encoder')
     parser.add_argument(
         "--upsample-scale",
         type=int,
         help="upsampling scale s to use for encoder features")
    def add_args(parser):
        FairseqNATModel.add_args(parser)
        parser.add_argument(
            "--early-exit",
            default="6,6,6",
            type=str,
            help="number of decoder layers before word_del, mask_ins, word_ins",
        )
        parser.add_argument(
            "--no-share-discriminator",
            action="store_true",
            help="separate parameters for discriminator",
        )
        parser.add_argument(
            "--no-share-maskpredictor",
            action="store_true",
            help="separate parameters for mask-predictor",
        )
        parser.add_argument(
            "--share-discriminator-maskpredictor",
            action="store_true",
            help=
            "share the parameters for both mask-predictor and discriminator",
        )
        parser.add_argument(
            "--sampling-for-deletion",
            action='store_true',
            help='instead of argmax, use sampling to predict the tokens')

        parser.add_argument(
            "--cnn-normalize-after",
            default=True,
            type=bool,
            help='weather using batch normalization after cnn module.')
        parser.add_argument(
            "--cnn-parameters-freeze",
            default=True,
            type=bool,
            help='weather freeze the parameters of cnn modules.')
 def add_args(parser):
     FairseqNATModel.add_args(parser)
     parser.add_argument("--label-tau", default=None, type=float)