class_docstr: Builds a DNN subnetwork for AdaNet.
docstr: See `adanet.subnetwork.Builder`.
docstr_tok: ["See","`","adanet.subnetwork.Builder","`","."]
code: def build_subnetwork(
      self,
      features,
      logits_dimension,
      training,
      iteration_step,
      summary,
      previous_ensemble=None,
  ):
      """See `adanet.subnetwork.Builder`."""
  
      input_layer = tf.compat.v1.feature_column.input_layer(
          features=features, feature_columns=self._feature_columns
      )
      last_layer = input_layer
      for _ in range(self._num_layers):
          last_layer = tf.compat.v1.layers.dense(
              last_layer,
              units=self._layer_size,
              activation=tf.nn.relu,
              kernel_initializer=tf.compat.v1.glorot_uniform_initializer(
                  seed=self._seed
              ),
          )
          last_layer = tf.compat.v1.layers.dropout(
              last_layer,
              rate=self._dropout,
              seed=self._seed,
              training=training,
          )
      logits = tf.compat.v1.layers.dense(
          last_layer,
          units=logits_dimension,
          kernel_initializer=tf.compat.v1.glorot_uniform_initializer(
              seed=self._seed
          ),
      )
  
      # Approximate the Rademacher complexity of this subnetwork as the square-
      # root of its depth.
      complexity = tf.sqrt(tf.cast(self._num_layers, dtype=tf.float32))
  
      with tf.name_scope(""):
          summary.scalar("complexity", complexity)
          summary.scalar("num_layers", self._num_layers)
  
      shared = {_NUM_LAYERS_KEY: self._num_layers}
      return adanet.Subnetwork(
          last_layer=last_layer,
          logits=logits,
          complexity=complexity,
          shared=shared,
      )
  
file_path: adanet/adanet/examples/simple_dnn.py
imports: import functools
  import adanet
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling the _SimpleDNNBuilder obj's underlying member method code with example usage: obj.build_subnetwork(features, logits_dimension, training, iteration_step, summary, previous_ensemble) and returns: adanet