message: Add negative parameter validation to Core Keras layers.
diff: @@ -195,6 +195,9 @@ class Dropout(Layer):
  def __init__(self, rate, noise_shape=None, seed=None, **kwargs):
  super(Dropout, self).__init__(**kwargs)
  + if isinstance(rate, (int, float)) and rate < 0:
  + raise ValueError("Invalid value received for `rate`, expected "
  + "a value between 0 and 1.")
  self.rate = rate
  if isinstance(rate, (int, float)) and not rate:
  keras_temporary_dropout_rate.get_cell().set(True)
  @@ -739,6 +742,8 @@ class RepeatVector(Layer):
  def __init__(self, n, **kwargs):
  super(RepeatVector, self).__init__(**kwargs)
  self.n = n
  + if not isinstance(n, int):
  + raise TypeError("Expected an integer value for `n`.")
  self.input_spec = InputSpec(ndim=2)
  def compute_output_shape(self, input_shape):
  @@ -1165,6 +1170,9 @@ class Dense(Layer):
  activity_regularizer=activity_regularizer, **kwargs)
  self.units = int(units) if not isinstance(units, int) else units
  + if self.units < 0:
  + raise ValueError(f"Received an invalid value for `units`, expected
  + f"a positive integer, got {units}.")
  self.activation = activations.get(activation)
  self.use_bias = use_bias
  self.kernel_initializer = initializers.get(kernel_initializer)
  