class_docstr: Implements the gradient penalty loss term for WGANs.
class_docstr_tok: ["Implements","the","gradient","penalty","loss","term","for","WGANs","."]
code: def __init__(self, gan, discriminator, **kwargs):
      super(GradientPenaltyLayer, self).__init__(**kwargs)
      self.gan = gan
      self.discriminator = discriminator
  
imports: from deepchem.models import KerasModel, layers
  from tensorflow.keras.layers import Input, Lambda, Layer, Softmax, Reshape, Multiply
  import numpy
  import tensorflow
  import time
label_desc: Use image node_id 1 to create a new GradientPenaltyLayer object from inherited base classes: Layer with example: obj = GradientPenaltyLayer(gan, discriminator)