                   "model. This can be when the model is actively stopped or when the target "
                   "iterations are met. Note: If the training session ends because of another "
                   "reason (e.g. power outage, Out of Memory Error, NaN detected) then the "
                   "optimizer weights will NOT be saved.")
          self.add_item(
              section=section,
              title="reflect_padding",
              datatype=bool,
              default=False,
 
</s> remove _DEFAULTS = {
    "input_size": {
        "default": 128,
        "info": "Resolution (in pixels) of the input image to train on.\n"
                "BE AWARE Larger resolution will dramatically increase VRAM requirements.\n"
                "\nMust be divisible by 16.",
        "datatype": int,
        "rounding": 16,
        "min_max": (64, 256),
        "group": "size",
        "fixed": True,
    },
    "clipnorm": {
        "default": True,
        "info": "Controls gradient clipping of the optimizer. Can prevent model corruption at "
                "the expense of VRAM.",
        "datatype": bool,
        "fixed": False,
        "group": "settings",
    },
    "architecture": {
        "default": "df",
        "info": "Model architecture:"
                "\n\t'df': Keeps the faces more natural."
                "\n\t'liae': Can help fix overly different face shapes.",
        "datatype": str,
        "choices": ["df", "liae"],
        "gui_radio": True,
        "fixed": True,
        "group": "network",
    },
    "autoencoder_dims": {
        "default": 0,
        "info": "Face information is stored in AutoEncoder dimensions. If there are not enough "
                "dimensions then certain facial features may not be recognized."
                "\nHigher number of dimensions are better, but require more VRAM."
                "\nSet to 0 to use the architecture defaults (256 for liae, 512 for df).",
        "datatype": int,
        "rounding": 32,
        "min_max": (0, 1024),
        "fixed": True,
        "group": "network",
    },
    "encoder_dims": {
        "default": 42,
        "info": "Encoder dimensions per channel. Higher number of encoder dimensions will help "
                "the model to recognize more facial features, but will require more VRAM.",
        "datatype": int,
        "rounding": 1,
        "min_max": (21, 85),
        "fixed": True,
        "group": "network",
    },
    "decoder_dims": {
        "default": 21,
        "info": "Decoder dimensions per channel. Higher number of decoder dimensions will help "
                "the model to improve details, but will require more VRAM.",
        "datatype": int,
        "rounding": 1,
        "min_max": (10, 85),
        "fixed": True,
        "group": "network",
    },
    "multiscale_decoder": {
        "default": False,
        "info": "Multiscale decoder can help to obtain better details.",
        "datatype": bool,
        "fixed": True,
        "group": "network",
    },
}
 </s> add _DEFAULTS = dict(
    input_size=dict(
        default=128,
        info="Resolution (in pixels) of the input image to train on.\n"
             "BE AWARE Larger resolution will dramatically increase VRAM requirements.\n"
             "\nMust be divisible by 16.",
        datatype=int,
        rounding=16,
        min_max=(64, 256),
        group="size",
        fixed=True),
    architecture=dict(
        default="df",
        info="Model architecture:"
             "\n\t'df': Keeps the faces more natural."
             "\n\t'liae': Can help fix overly different face shapes.",
        datatype=str,
        choices=["df", "liae"],
        gui_radio=True,
        fixed=True,
        group="network"),
    autoencoder_dims=dict(
        default=0,
        info="Face information is stored in AutoEncoder dimensions. If there are not enough "
             "dimensions then certain facial features may not be recognized."
             "\nHigher number of dimensions are better, but require more VRAM."
             "\nSet to 0 to use the architecture defaults (256 for liae, 512 for df).",
        datatype=int,
        rounding=32,
        min_max=(0, 1024),
        fixed=True,
        group="network"),
    encoder_dims=dict(
        default=42,
        info="Encoder dimensions per channel. Higher number of encoder dimensions will help "
             "the model to recognize more facial features, but will require more VRAM.",
        datatype=int,
        rounding=1,
        min_max=(21, 85),
        fixed=True,
        group="network"),
    decoder_dims=dict(
        default=21,
        info="Decoder dimensions per channel. Higher number of decoder dimensions will help "
             "the model to improve details, but will require more VRAM.",
        datatype=int,
        rounding=1,
        min_max=(10, 85),
        fixed=True,
        group="network"),
    multiscale_decoder=dict(
        default=False,
        info="Multiscale decoder can help to obtain better details.",
        datatype=bool,
        fixed=True,
        group="network")) </s> remove         if clipnorm and (arguments.distributed or mixed_precision):
            logger.warning("Clipnorm has been selected, but is unsupported when using distributed "
                           "or mixed_precision training, so has been disabled. If you wish to "
                           "enable clipnorm, then you must disable these other options.")
            clipnorm = False
        if clipnorm and get_backend() == "amd":
            # TODO add clipnorm in for plaidML when it is fixed upstream. Still not fixed in
            # release 0.7.0.
            logger.warning("Due to a bug in plaidML, clipnorm cannot be used on AMD backends so "
                           "has been disabled")
            clipnorm = False
        if clipnorm:
            self._kwargs["clipnorm"] = 1.0
 </s> add         if not autoclip:
            return </s> remove _DEFAULTS = {
    "input_size": {
        "default": 128,
        "info": "Resolution (in pixels) of the image to train on.\n"
                "BE AWARE Larger resolution will dramatically increaseVRAM requirements.\n"
                "Make sure your resolution is divisible by 64 (e.g. 64, 128, 256 etc.).\n"
                "NB: Your faceset must be at least 1.6x larger than your required input "
                "size.\n(e.g. 160 is the maximum input size for a 256x256 faceset).",
        "datatype": int,
        "rounding": 64,
        "min_max": (64, 512),
        "choices": [],
        "gui_radio": False,
        "group": "size",
        "fixed": True,
    },
    "lowmem": {
        "default": False,
        "info": "Lower memory mode. Set to 'True' if having issues with VRAM useage.\n"
                "NB: Models with a changed lowmem mode are not compatible with each other.\n"
                "NB: lowmem will override cutom nodes and complexity settings.",
        "datatype": bool,
        "rounding": None,
        "min_max": None,
        "choices": [],
        "gui_radio": False,
        "group": "settings",
        "fixed": True,
    },
    "clipnorm": {
        "default": True,
        "info": "Controls gradient clipping of the optimizer. Can prevent model corruption at "
                "the expense of VRAM.",
        "datatype": bool,
        "rounding": None,
        "min_max": None,
        "choices": [],
        "gui_radio": False,
        "group": "settings",
        "fixed": True,
    },
    "nodes": {
        "default": 1024,
        "info": "Number of nodes for decoder. Don't change this unless you know what you are "
                "doing!",
        "datatype": int,
        "rounding": 64,
        "min_max": (512, 4096),
        "choices": [],
        "gui_radio": False,
        "fixed": True,
        "group": "network",
    },
    "complexity_encoder": {
        "default": 128,
        "info": "Encoder Convolution Layer Complexity. sensible ranges: 128 to 160.",
        "datatype": int,
        "rounding": 16,
        "min_max": (64, 1024),
        "choices": [],
        "gui_radio": False,
        "fixed": True,
        "group": "network",
    },
    "complexity_decoder_a": {
        "default": 384,
        "info": "Decoder A Complexity.",
        "datatype": int,
        "rounding": 16,
        "min_max": (64, 1024),
        "choices": [],
        "gui_radio": False,
        "fixed": True,
        "group": "network",
    },
    "complexity_decoder_b": {
        "default": 512,
        "info": "Decoder B Complexity.",
        "datatype": int,
        "rounding": 16,
        "min_max": (64, 1024),
        "choices": [],
        "gui_radio": False,
        "fixed": True,
        "group": "network",
    },
}
 </s> add _DEFAULTS = dict(
    input_size=dict(
        default=128,
        info="Resolution (in pixels) of the image to train on.\n"
             "BE AWARE Larger resolution will dramatically increaseVRAM requirements.\n"
             "Make sure your resolution is divisible by 64 (e.g. 64, 128, 256 etc.).\n"
             "NB: Your faceset must be at least 1.6x larger than your required input "
             "size.\n(e.g. 160 is the maximum input size for a 256x256 faceset).",
        datatype=int,
        rounding=64,
        min_max=(64, 512),
        choices=[],
        gui_radio=False,
        group="size",
        fixed=True),
    lowmem=dict(
        default=False,
        info="Lower memory mode. Set to 'True' if having issues with VRAM useage.\n"
             "NB: Models with a changed lowmem mode are not compatible with each other.\n"
             "NB: lowmem will override cutom nodes and complexity settings.",
        datatype=bool,
        rounding=None,
        min_max=None,
        choices=[],
        gui_radio=False,
        group="settings",
        fixed=True),
    nodes=dict(
        default=1024,
        info="Number of nodes for decoder. Don't change this unless you know what you are doing!",
        datatype=int,
        rounding=64,
        min_max=(512, 4096),
        choices=[],
        gui_radio=False,
        fixed=True,
        group="network"),
    complexity_encoder=dict(
        default=128,
        info="Encoder Convolution Layer Complexity. sensible ranges: 128 to 160.",
        datatype=int,
        rounding=16,
        min_max=(64, 1024),
        choices=[],
        gui_radio=False,
        fixed=True,
        group="network"),
    complexity_decoder_a=dict(
        default=384,
        info="Decoder A Complexity.",
        datatype=int,
        rounding=16,
        min_max=(64, 1024),
        choices=[],
        gui_radio=False,
        fixed=True,
        group="network"),
    complexity_decoder_b=dict(
        default=512,
        info="Decoder B Complexity.",
        datatype=int,
        rounding=16,
        min_max=(64, 1024),
        choices=[],
        gui_radio=False,
        fixed=True,
        group="network")) </s> remove     mixed_precision: bool
        ``True`` if mixed precision training is to be enabled otherwise ``False``
    arguments: :class:`argparse.Namespace`
        The arguments that were passed to the train or convert process as generated from
        Faceswap's command line arguments
 </s> add  </s> remove     clipnorm: bool
        Whether to clip gradients to avoid exploding/vanishing gradients
 </s> add     autoclip: bool
        ``True`` if AutoClip should be enabled otherwise ``False``
        self.add_item(
            section=section,
            title="autoclip",
            datatype=bool,
            default=False,
            info="[Nvidia Only] Apply AutoClipping to the gradients. AutoClip analyzes the "
                 "gradient weights and adjusts the normalization value dynamically to fit the "
                 "data. Can help prevent NaNs and improve model optimization at the expense of "
                 "VRAM. Ref: AutoClip: Adaptive Gradient Clipping for Source Separation Networks "
                 "https://arxiv.org/abs/2007.14469",
            fixed=False,
            gui_radio=True,
            group="optimizer")
                   "model. This can be when the model is actively stopped or when the target "
                   "iterations are met. Note: If the training session ends because of another "
                   "reason (e.g. power outage, Out of Memory Error, NaN detected) then the "
                   "optimizer weights will NOT be saved.")
        self.add_item(
            section=section,
            title="autoclip",
            datatype=bool,
            default=False,
            info="[Nvidia Only] Apply AutoClipping to the gradients. AutoClip analyzes the "
                 "gradient weights and adjusts the normalization value dynamically to fit the "
                 "data. Can help prevent NaNs and improve model optimization at the expense of "
                 "VRAM. Ref: AutoClip: Adaptive Gradient Clipping for Source Separation Networks "
                 "https://arxiv.org/abs/2007.14469",
            fixed=False,
            gui_radio=True,
            group="optimizer")
          self.add_item(
              section=section,
              title="reflect_padding",
              datatype=bool,
              default=False,
keep keep keep add keep keep keep keep keep
 Nvidia: Add AutoClip training option 
plugins/train/_config.py