tf.contrib.layers.bias_add(*args, **kwargs)

tf.contrib.layers.bias_add(*args, **kwargs)

Adds a bias to the inputs.

Can be used as a normalizer function for conv2d and fully_connected.

Args:

  • inputs: a tensor of with at least rank 2 and value for the last dimension, e.g. [batch_size, depth], [None, None, None, depth].
  • activation_fn: activation function, default set to None to skip it and maintain a linear activation.
  • initializer: An initializer for the bias, defaults to 0.
  • regularizer: A regularizer like the result of l1_regularizer or l2_regularizer.
  • reuse: whether or not the layer and its variables should be reused. To be able to reuse the layer scope must be given.
  • variables_collections: optional collections for the variables.
  • outputs_collections: collections to add the outputs.
  • trainable: If True also add variables to the graph collection GraphKeys.TRAINABLE_VARIABLES (see tf.Variable).
  • data_format: A string. 'NHWC' and 'NCHW' are supported.
  • scope: Optional scope for variable_scope.

Returns:

a tensor representing the result of adding biases to the inputs.

Raises:

  • ValueError: if data_format is neither NHWC nor NCHW.
  • ValueError: if data_format is NCHW and rank of inputs is not 4.
  • ValueError: if the rank of inputs is undefined.
  • ValueError: if rank or C dimension of inputs is undefined.

Defined in tensorflow/contrib/framework/python/ops/arg_scope.py.