  
         Adapted from https://github.com/iperov/DeepFaceLab
      """
  
      def __init__(self, lr=0.001, beta_1=0.9, beta_2=0.999,
                   epsilon=None, decay=0., amsgrad=False, cpu_mode=0, **kwargs):
          super().__init__(lr, beta_1, beta_2, epsilon, decay, **kwargs)
          self.cpu_mode = self.set_cpu_mode(cpu_mode)
  
      @staticmethod
      def set_cpu_mode(cpu_mode):
 
</s> remove         self.cpu_mode = self.set_cpu_mode(cpu_mode)
 </s> add         self.cpu_mode = self._set_cpu_mode(cpu_mode) </s> remove     """Adapted Keras Adam Optimizer to allow support of calculations
       on CPU for Tensorflow.

       Adapted from https://github.com/iperov/DeepFaceLab
 </s> add     """Adapted Keras Adam Optimizer to allow support of calculations on CPU for Tensorflow.

    Default parameters follow those provided in the original paper. Adapted from
    https://github.com/iperov/DeepFaceLab

    Parameters
    ----------
    lr: float, optional
        >= `0`. Learning rate. Default: `0.001`
    beta_1: float, optional
        `0` < beta < `1` Generally close to `1`. Default: `0.9`
    beta_2: float, optional
        `0` < beta < `1`. Generally close to `1`. Default: `0.999`
    epsilon: float, optional
        >= `0`. Fuzz factor. If ``None``, defaults to `K.epsilon()`. Default: ``None``
    decay: float, optional
        >= 0. Learning rate decay over each update. Default: `0`
    amsgrad: bool, optional
        ``True`` to apply the AMSGrad variant of this algorithm from the paper "On the Convergence
        of Adam and Beyond" otherwise ``False``. Default: ``False``
    cpu_mode: bool, optional
        Set to ``True`` to perform some of the calculations on CPU for Nvidia backends, otherwise
        ``False``. Default: ``False``
    kwargs: dict
        Any additional standard Keras optimizer keyword arguments

    References
    ----------
    - Adam - A Method for Stochastic Optimization - https://arxiv.org/abs/1412.6980v8

    - On the Convergence of Adam and Beyond - https://openreview.net/forum?id=ryQu7f-RZ </s> remove     def set_cpu_mode(cpu_mode):
        """ Set the CPU mode to 0 if not using tensorflow, else passed in arg """
 </s> add     def _set_cpu_mode(cpu_mode):
        """ Sets the CPU mode to False if not using Tensorflow, otherwise the given value.

        Parameters
        ----------
        cpu_mode: bool
            Set to ``True`` to perform some of the calculations on CPU for Nvidia backends,
            otherwise ``False``.

        Returns
        -------
        bool
            ``True`` if some calculations should be performed on CPU otherwise ``False``
        """ </s> remove         super(PixelShuffler, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs) </s> remove class Scale(Layer):
    """
    GAN Custom Scal Layer
    Code borrows from https://github.com/flyyufelix/cnn_finetune
    """
    def __init__(self, weights=None, axis=-1, gamma_init='zero', **kwargs):
        self.axis = axis
        self.gamma = None
        self.gamma_init = initializers.get(gamma_init)
        self.initial_weights = weights
        super(Scale, self).__init__(**kwargs)

    def build(self, input_shape):
        self.input_spec = [InputSpec(shape=input_shape)]
 </s> add         The configuration of a layer does not include connectivity information, nor the layer
        class name. These are handled by `Network` (one layer of abstraction above).
    def __init__(self,
                 lr=0.001,
                 beta_1=0.9,
                 beta_2=0.999,
                 epsilon=None,
                 decay=0.,
                 amsgrad=False,
                 cpu_mode=False,
                 **kwargs):
  
         Adapted from https://github.com/iperov/DeepFaceLab
      """
  
    def __init__(self,
                 lr=0.001,
                 beta_1=0.9,
                 beta_2=0.999,
                 epsilon=None,
                 decay=0.,
                 amsgrad=False,
                 cpu_mode=False,
                 **kwargs):
    def __init__(self,
                 lr=0.001,
                 beta_1=0.9,
                 beta_2=0.999,
                 epsilon=None,
                 decay=0.,
                 amsgrad=False,
                 cpu_mode=False,
                 **kwargs):
          super().__init__(lr, beta_1, beta_2, epsilon, decay, **kwargs)
          self.cpu_mode = self.set_cpu_mode(cpu_mode)
  
      @staticmethod
      def set_cpu_mode(cpu_mode):
keep keep keep keep replace replace keep keep keep keep keep
 Simple backend unit tests (#1020)

* Add simple backend tests for lib.model
* Document lib.model
* Fix GMSD Loss for AMD
* Remove obsolete code from lib.model 
lib/model/optimizers.py