(
    inputs,
    num_outputs,
    scope,
    use_xavier=True,
    stddev=1e-3,
    weight_decay=0.0,
    activation_fn=tf.nn.relu,
    bn=False,
    bn_decay=None,
    is_training=None,
)
Fully connected layer with non-linear operation.
  
  Args:
    inputs: 2-D tensor BxN
    num_outputs: int
  
  Returns:
    Variable tensor of size B x num_outputs.
Fully connected layer with non-linear operation.
  
  Args:
    inputs: 2-D tensor BxN
    num_outputs: int
  
  Returns:
    Variable tensor of size B x num_outputs.
Fully connected layer with non - linear operation . Args : inputs : 2 - D tensor BxN num_outputs : int Returns : Variable tensor of size B x num_outputs .
def fully_connected(
    inputs,
    num_outputs,
    scope,
    use_xavier=True,
    stddev=1e-3,
    weight_decay=0.0,
    activation_fn=tf.nn.relu,
    bn=False,
    bn_decay=None,
    is_training=None,
):
    """ Fully connected layer with non-linear operation.
  
  Args:
    inputs: 2-D tensor BxN
    num_outputs: int
  
  Returns:
    Variable tensor of size B x num_outputs.
  """
    with tf.variable_scope(scope) as sc:
        num_input_units = inputs.get_shape()[-1].value
        weights = _variable_with_weight_decay(
            "weights",
            shape=[num_input_units, num_outputs],
            use_xavier=use_xavier,
            stddev=stddev,
            wd=weight_decay,
        )
        outputs = tf.matmul(inputs, weights)
        biases = _variable_on_cpu("biases", [num_outputs], tf.constant_initializer(0.0))
        outputs = tf.nn.bias_add(outputs, biases)

        if bn:
            outputs = batch_norm_for_fc(outputs, is_training, bn_decay, "bn")

        if activation_fn is not None:
            outputs = activation_fn(outputs)
        return outputs
def fully_connected ( inputs , num_outputs , scope , use_xavier = True , stddev = 1e-3 , weight_decay = 0.0 , activation_fn = tf . nn . relu , bn = False , bn_decay = None , is_training = None , ) : with tf . variable_scope ( scope ) as sc : num_input_units = inputs . get_shape ( ) [ - 1 ] . value weights = _variable_with_weight_decay ( "weights" , shape = [ num_input_units , num_outputs ] , use_xavier = use_xavier , stddev = stddev , wd = weight_decay , ) outputs = tf . matmul ( inputs , weights ) biases = _variable_on_cpu ( "biases" , [ num_outputs ] , tf . constant_initializer ( 0.0 ) ) outputs = tf . nn . bias_add ( outputs , biases ) if bn : outputs = batch_norm_for_fc ( outputs , is_training , bn_decay , "bn" ) if activation_fn is not None : outputs = activation_fn ( outputs ) return outputs