class_docstr: Wrapper class for networks specified as Keras model (specification key: `keras`).
  
  Args:
      model (tf.keras.Model): Keras model
          (<span style="color:#C00000"><b>required</b></span>).
      device (string): Device name
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      l2_regularization (float >= 0.0): Scalar controlling L2 regularization
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
      inputs_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      outputs (iter[string]): <span style="color:#0000C0"><b>internal use</b></span>.
      kwargs: Arguments for the Keras model.
code: def __init__(
      self,
      *,
      model,
      device=None,
      l2_regularization=None,
      name=None,
      inputs_spec=None,
      outputs=None,
      **kwargs,
  ):
      if outputs is not None:
          raise TensorforceError.invalid(
              name="policy",
              argument="single_output",
              condition="KerasNetwork",
          )
  
      super().__init__(
          device=device,
          l2_regularization=l2_regularization,
          name=name,
          inputs_spec=inputs_spec,
          outputs=outputs,
      )
  
      if isinstance(model, tf.keras.Model):
          self.keras_model = model
      elif isinstance(model, type) and issubclass(
          model, tf.keras.Model
      ):
          self.keras_model = model(**kwargs)
      elif callable(model):
          self.keras_model = model(**kwargs)
          assert isinstance(self.keras_model, tf.keras.Model)
      else:
          raise TensorforceError.value(
              name="KerasNetwork", argument="model", value=model
          )
  
file_path: tensorforce/tensorforce/core/networks/keras.py
imports: import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import TensorSpec, tf_function, tf_util
  from tensorforce.core.networks import Network
label_desc: Use image node_id 1 to create a new KerasNetwork object from inherited base classes: Network with example: obj = KerasNetwork()