neulab/docprompting-conala huggingface dataset:
tf.nn.local_response_normalization Local Response Normalization.  View aliases  Main aliases 
tf.nn.lrn Compat aliases for migration See Migration guide for more details. tf.compat.v1.nn.local_response_normalization, tf.compat.v1.nn.lrn  
tf.nn.local_response_normalization(
    input, depth_radius=5, bias=1, alpha=1, beta=0.5, name=None
)
 The 4-D input tensor is treated as a 3-D array of 1-D vectors (along the last dimension), and each vector is normalized independently. Within a given vector, each component is divided by the weighted, squared sum of inputs within depth_radius. In detail, sqr_sum[a, b, c, d] =
    sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
output = input / (bias + alpha * sqr_sum) ** beta
 For details, see Krizhevsky et al., ImageNet classification with deep convolutional neural networks (NIPS 2012).
 


 Args
  input   A Tensor. Must be one of the following types: half, bfloat16, float32. 4-D.  
  depth_radius   An optional int. Defaults to 5. 0-D. Half-width of the 1-D normalization window.  
  bias   An optional float. Defaults to 1. An offset (usually positive to avoid dividing by 0).  
  alpha   An optional float. Defaults to 1. A scale factor, usually positive.  
  beta   An optional float. Defaults to 0.5. An exponent.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as input.
tf.nn.log_poisson_loss     View source on GitHub    Computes log Poisson loss given log_input.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.log_poisson_loss  
tf.nn.log_poisson_loss(
    targets, log_input, compute_full_loss=False, name=None
)
 Gives the log-likelihood loss between the prediction and the target under the assumption that the target has a Poisson distribution. Caveat: By default, this is not the exact loss, but the loss minus a constant term [log(z!)]. That has no effect for optimization, but does not play well with relative loss comparisons. To compute an approximation of the log factorial term, specify compute_full_loss=True to enable Stirling's Approximation. For brevity, let c = log(x) = log_input, z = targets. The log Poisson loss is   -log(exp(-x) * (x^z) / z!)
= -log(exp(-x) * (x^z)) + log(z!)
~ -log(exp(-x)) - log(x^z) [+ z * log(z) - z + 0.5 * log(2 * pi * z)]
    [ Note the second term is the Stirling's Approximation for log(z!).
      It is invariant to x and does not affect optimization, though
      important for correct relative loss comparisons. It is only
      computed when compute_full_loss == True. ]
= x - z * log(x) [+ z * log(z) - z + 0.5 * log(2 * pi * z)]
= exp(c) - z * c [+ z * log(z) - z + 0.5 * log(2 * pi * z)]

 


 Args
  targets   A Tensor of the same type and shape as log_input.  
  log_input   A Tensor of type float32 or float64.  
  compute_full_loss   whether to compute the full loss. If false, a constant term is dropped in favor of more efficient optimization.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of the same shape as log_input with the componentwise logistic losses.  

 


 Raises
  ValueError   If log_input and targets do not have the same shape.
tf.nn.log_softmax     View source on GitHub    Computes log softmax activations.  View aliases  Main aliases 
tf.math.log_softmax  
tf.nn.log_softmax(
    logits, axis=None, name=None
)
 For each batch i and class j we have logsoftmax = logits - log(reduce_sum(exp(logits), axis))

 


 Args
  logits   A non-empty Tensor. Must be one of the following types: half, float32, float64.  
  axis   The dimension softmax would be performed on. The default is -1 which indicates the last dimension.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as logits. Same shape as logits.  

 


 Raises
  InvalidArgumentError   if logits is empty or axis is beyond the last dimension of logits.
tf.nn.max_pool     View source on GitHub    Performs the max pooling on the input.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.max_pool_v2  
tf.nn.max_pool(
    input, ksize, strides, padding, data_format=None, name=None
)

 


 Args
  input   Tensor of rank N+2, of shape [batch_size] + input_spatial_shape + [num_channels] if data_format does not start with "NC" (default), or [batch_size, num_channels] + input_spatial_shape if data_format starts with "NC". Pooling happens over the spatial dimensions only.  
  ksize   An int or list of ints that has length 1, N or N+2. The size of the window for each dimension of the input tensor.  
  strides   An int or list of ints that has length 1, N or N+2. The stride of the sliding window for each dimension of the input tensor.  
  padding   Either the string"SAME"or"VALID"indicating the type of padding algorithm to use, or a list indicating the explicit paddings at the start and end of each dimension. When explicit padding is used and data_format is"NHWC", this should be in the form[[0, 0], [pad_top, pad_bottom], [pad_left, pad_right], [0, 0]]. When explicit padding used and data_format is"NCHW", this should be in the form[[0, 0], [0, 0], [pad_top, pad_bottom], [pad_left, pad_right]]. When using explicit padding, the size of the paddings cannot be greater than the sliding window size. </td> </tr><tr> <td>data_format</td> <td> A string. Specifies the channel dimension. For N=1 it can be either "NWC" (default) or "NCW", for N=2 it can be either "NHWC" (default) or "NCHW" and for N=3 either "NDHWC" (default) or "NCDHW". </td> </tr><tr> <td>name`   Optional name for the operation.   
 


 Returns   A Tensor of format specified by data_format. The max pooled output tensor.
tf.nn.max_pool1d     View source on GitHub    Performs the max pooling on the input.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.max_pool1d  
tf.nn.max_pool1d(
    input, ksize, strides, padding, data_format='NWC', name=None
)
 Note internally this op reshapes and uses the underlying 2d operation.
 


 Args
  input   A 3-D Tensor of the format specified by data_format.  
  ksize   An int or list of ints that has length 1 or 3. The size of the window for each dimension of the input tensor.  
  strides   An int or list of ints that has length 1 or 3. The stride of the sliding window for each dimension of the input tensor.  
  padding   Either the string"SAME"or"VALID"indicating the type of padding algorithm to use, or a list indicating the explicit paddings at the start and end of each dimension. When explicit padding is used and data_format is"NWC", this should be in the form[[0, 0], [pad_left, pad_right], [0, 0]]. When explicit padding used and data_format is"NCW", this should be in the form[[0, 0], [0, 0], [pad_left, pad_right]]. When using explicit padding, the size of the paddings cannot be greater than the sliding window size. </td> </tr><tr> <td>data_format</td> <td> An optional string from: "NWC", "NCW". Defaults to "NWC". </td> </tr><tr> <td>name`   A name for the operation (optional).   
 


 Returns   A Tensor of format specified by data_format. The max pooled output tensor.
tf.nn.max_pool2d     View source on GitHub    Performs the max pooling on the input.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.max_pool2d  
tf.nn.max_pool2d(
    input, ksize, strides, padding, data_format='NHWC', name=None
)

 


 Args
  input   A 4-D Tensor of the format specified by data_format.  
  ksize   An int or list of ints that has length 1, 2 or 4. The size of the window for each dimension of the input tensor.  
  strides   An int or list of ints that has length 1, 2 or 4. The stride of the sliding window for each dimension of the input tensor.  
  padding   Either the string"SAME"or"VALID"indicating the type of padding algorithm to use, or a list indicating the explicit paddings at the start and end of each dimension. When explicit padding is used and data_format is"NHWC", this should be in the form[[0, 0], [pad_top, pad_bottom], [pad_left, pad_right], [0, 0]]. When explicit padding used and data_format is"NCHW", this should be in the form[[0, 0], [0, 0], [pad_top, pad_bottom], [pad_left, pad_right]]. When using explicit padding, the size of the paddings cannot be greater than the sliding window size. </td> </tr><tr> <td>data_format</td> <td> A string. 'NHWC', 'NCHW' and 'NCHW_VECT_C' are supported. </td> </tr><tr> <td>name`   Optional name for the operation.   
 


 Returns   A Tensor of format specified by data_format. The max pooled output tensor.
tf.nn.max_pool3d     View source on GitHub    Performs the max pooling on the input.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.max_pool3d  
tf.nn.max_pool3d(
    input, ksize, strides, padding, data_format='NDHWC', name=None
)

 


 Args
  input   A 5-D Tensor of the format specified by data_format.  
  ksize   An int or list of ints that has length 1, 3 or 5. The size of the window for each dimension of the input tensor.  
  strides   An int or list of ints that has length 1, 3 or 5. The stride of the sliding window for each dimension of the input tensor.  
  padding   A string, either 'VALID' or 'SAME'. The padding algorithm. See the "returns" section of tf.nn.convolution for details.  
  data_format   An optional string from: "NDHWC", "NCDHW". Defaults to "NDHWC". The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in_depth, in_height, in_width, in_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in_channels, in_depth, in_height, in_width].  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of format specified by data_format. The max pooled output tensor.
tf.nn.max_pool_with_argmax     View source on GitHub    Performs max pooling on the input and outputs both max values and indices. 
tf.nn.max_pool_with_argmax(
    input, ksize, strides, padding, data_format='NHWC',
    output_dtype=tf.dtypes.int64, include_batch_in_index=False, name=None
)
 The indices in argmax are flattened, so that a maximum value at position [b, y, x, c] becomes flattened index: (y * width + x) * channels + c if include_batch_in_index is False; ((b * height + y) * width + x) * channels + c if include_batch_in_index is True. The indices returned are always in [0, height) x [0, width) before flattening, even if padding is involved and the mathematically correct answer is outside (either negative or too large). This is a bug, but fixing it is difficult to do in a safe backwards compatible way, especially due to flattening.
 


 Args
  input   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. 4-D with shape [batch, height, width, channels]. Input to pool over.  
  ksize   An int or list of ints that has length 1, 2 or 4. The size of the window for each dimension of the input tensor.  
  strides   An int or list of ints that has length 1, 2 or 4. The stride of the sliding window for each dimension of the input tensor.  
  padding   A string from: "SAME", "VALID". The type of padding algorithm to use.  
  data_format   An optional string, must be set to "NHWC". Defaults to "NHWC". Specify the data format of the input and output data.  
  output_dtype   An optional tf.DType from: tf.int32, tf.int64. Defaults to tf.int64. The dtype of the returned argmax tensor.  
  include_batch_in_index   An optional boolean. Defaults to False. Whether to include batch dimension in flattened index of argmax.  
  name   A name for the operation (optional).   
 


 Returns   A tuple of Tensor objects (output, argmax).     output   A Tensor. Has the same type as input.  
  argmax   A Tensor of type output_dtype.
tf.nn.moments     View source on GitHub    Calculates the mean and variance of x. 
tf.nn.moments(
    x, axes, shift=None, keepdims=False, name=None
)
 The mean and variance are calculated by aggregating the contents of x across axes. If x is 1-D and axes = [0] this is just the mean and variance of a vector. 
Note: shift is currently not used; the true mean is computed and used.
 When using these moments for batch normalization (see tf.nn.batch_normalization):  for so-called "global normalization", used with convolutional filters with shape [batch, height, width, depth], pass axes=[0, 1, 2]. for simple batch normalization pass axes=[0] (batch only). 
 


 Args
  x   A Tensor.  
  axes   Array of ints. Axes along which to compute mean and variance.  
  shift   Not used in the current implementation.  
  keepdims   produce moments with the same dimensionality as the input.  
  name   Name used to scope the operations that compute the moments.   
 


 Returns   Two Tensor objects: mean and variance.
tf.nn.normalize_moments     View source on GitHub    Calculate the mean and variance of based on the sufficient statistics.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.normalize_moments  
tf.nn.normalize_moments(
    counts, mean_ss, variance_ss, shift, name=None
)

 


 Args
  counts   A Tensor containing the total count of the data (one value).  
  mean_ss   A Tensor containing the mean sufficient statistics: the (possibly shifted) sum of the elements to average over.  
  variance_ss   A Tensor containing the variance sufficient statistics: the (possibly shifted) squared sum of the data to compute the variance over.  
  shift   A Tensor containing the value by which the data is shifted for numerical stability, or None if no shift was performed.  
  name   Name used to scope the operations that compute the moments.   
 


 Returns   Two Tensor objects: mean and variance.
tf.nn.pool     View source on GitHub    Performs an N-D pooling operation. 
tf.nn.pool(
    input, window_shape, pooling_type, strides=None, padding='VALID',
    data_format=None, dilations=None, name=None
)
 In the case that data_format does not start with "NC", computes for 0 <= b < batch_size, 0 <= x[i] < output_spatial_shape[i], 0 <= c < num_channels: output[b, x[0], ..., x[N-1], c] =
  REDUCE_{z[0], ..., z[N-1]}
    input[b,
          x[0] * strides[0] - pad_before[0] + dilation_rate[0]*z[0],
          ...
          x[N-1]*strides[N-1] - pad_before[N-1] + dilation_rate[N-1]*z[N-1],
          c],
 where the reduction function REDUCE depends on the value of pooling_type, and pad_before is defined based on the value of padding as described in the "returns" section of tf.nn.convolution for details. The reduction never includes out-of-bounds positions. In the case that data_format starts with "NC", the input and output are simply transposed as follows: pool(input, data_format, **kwargs) =
  tf.transpose(pool(tf.transpose(input, [0] + range(2,N+2) + [1]),
                    **kwargs),
               [0, N+1] + range(1, N+1))

 


 Args
  input   Tensor of rank N+2, of shape [batch_size] + input_spatial_shape + [num_channels] if data_format does not start with "NC" (default), or [batch_size, num_channels] + input_spatial_shape if data_format starts with "NC". Pooling happens over the spatial dimensions only.  
  window_shape   Sequence of N ints >= 1.  
  pooling_type   Specifies pooling operation, must be "AVG" or "MAX".  
  strides   Optional. Sequence of N ints >= 1. Defaults to [1]N. If any value of strides is > 1, then all values of dilation_rate must be 1. 
 
  padding   The padding algorithm, must be "SAME" or "VALID". Defaults to "SAME". See the "returns" section of tf.nn.convolution for details.  
  data_format   A string or None. Specifies whether the channel dimension of the input and output is the last dimension (default, or if data_format does not start with "NC"), or the second dimension (if data_format starts with "NC"). For N=1, the valid values are "NWC" (default) and "NCW". For N=2, the valid values are "NHWC" (default) and "NCHW". For N=3, the valid values are "NDHWC" (default) and "NCDHW".  
  dilations   Optional. Dilation rate. List of N ints >= 1. Defaults to [1]N. If any value of dilation_rate is > 1, then all values of strides must be 1.  
  name   Optional. Name of the op.   
 


 Returns   Tensor of rank N+2, of shape [batch_size] + output_spatial_shape + [num_channels] if data_format is None or does not start with "NC", or [batch_size, num_channels] + output_spatial_shape if data_format starts with "NC", where output_spatial_shape depends on the value of padding: If padding = "SAME": output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides[i]) If padding = "VALID": output_spatial_shape[i] = ceil((input_spatial_shape[i] - (window_shape[i] - 1) * dilation_rate[i]) / strides[i]). 
 

 


 Raises
  ValueError   if arguments are invalid.
tf.nn.relu Computes rectified linear: max(features, 0).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.relu  
tf.nn.relu(
    features, name=None
)
 See: https://en.wikipedia.org/wiki/Rectifier_(neural_networks) Example usage: >>> tf.nn.relu([-2., 0., -0., 3.]).numpy()
array([ 0.,  0., -0.,  3.], dtype=float32)

 


 Args
  features   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64, qint8.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as features.
tf.nn.relu6     View source on GitHub    Computes Rectified Linear 6: min(max(features, 0), 6).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.relu6  
tf.nn.relu6(
    features, name=None
)

 


 Args
  features   A Tensor with type float, double, int32, int64, uint8, int16, or int8.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor with the same type as features.  
 References: Convolutional Deep Belief Networks on CIFAR-10: Krizhevsky et al., 2010 (pdf)
tf.nn.RNNCellDeviceWrapper Operator that ensures an RNNCell runs on a particular device. Inherits From: AbstractRNNCell, Layer, Module 
tf.nn.RNNCellDeviceWrapper(
    *args, **kwargs
)

 


 Args
  cell   An instance of RNNCell.  
  device   A device string or function, for passing to tf.device.  
  **kwargs   dict of keyword arguments for base layer.   
 


 Attributes
  output_size  
 
  state_size  
   Methods get_initial_state View source 
get_initial_state(
    inputs=None, batch_size=None, dtype=None
)
 zero_state View source 
zero_state(
    batch_size, dtype
)
tf.nn.RNNCellDropoutWrapper Operator adding dropout to inputs and outputs of the given cell. Inherits From: AbstractRNNCell, Layer, Module 
tf.nn.RNNCellDropoutWrapper(
    *args, **kwargs
)

 


 Args
  cell   an RNNCell, a projection to output_size is added to it.  
  input_keep_prob   unit Tensor or float between 0 and 1, input keep probability; if it is constant and 1, no input dropout will be added.  
  output_keep_prob   unit Tensor or float between 0 and 1, output keep probability; if it is constant and 1, no output dropout will be added.  
  state_keep_prob   unit Tensor or float between 0 and 1, output keep probability; if it is constant and 1, no output dropout will be added. State dropout is performed on the outgoing states of the cell. Note the state components to which dropout is applied when state_keep_prob is in (0, 1) are also determined by the argument dropout_state_filter_visitor (e.g. by default dropout is never applied to the c component of an LSTMStateTuple).  
  variational_recurrent   Python bool. If True, then the same dropout pattern is applied across all time steps per run call. If this parameter is set, input_size must be provided.  
  input_size   (optional) (possibly nested tuple of) TensorShape objects containing the depth(s) of the input tensors expected to be passed in to the DropoutWrapper. Required and used iff variational_recurrent = True and input_keep_prob < 1.  
  dtype   (optional) The dtype of the input, state, and output tensors. Required and used iff variational_recurrent = True.  
  seed   (optional) integer, the randomness seed.  
  dropout_state_filter_visitor   (optional), default: (see below). Function that takes any hierarchical level of the state and returns a scalar or depth=1 structure of Python booleans describing which terms in the state should be dropped out. In addition, if the function returns True, dropout is applied across this sublevel. If the function returns False, dropout is not applied across this entire sublevel. Default behavior: perform dropout on all terms except the memory (c) state of LSTMCellState objects, and don't try to apply dropout to TensorArray objects: def dropout_state_filter_visitor(s): if isinstance(s, LSTMCellState): # Never perform dropout on the c state. return LSTMCellState(c=False, h=True) elif isinstance(s, TensorArray): return False return True  
  **kwargs   dict of keyword arguments for base layer.   
 


 Raises
  TypeError   if cell is not an RNNCell, or keep_state_fn is provided but not callable.  
  ValueError   if any of the keep_probs are not between 0 and 1.   
 


 Attributes
  output_size  
 
  state_size  
 
  wrapped_cell  
   Methods get_initial_state View source 
get_initial_state(
    inputs=None, batch_size=None, dtype=None
)
 zero_state View source 
zero_state(
    batch_size, dtype
)
tf.nn.RNNCellResidualWrapper RNNCell wrapper that ensures cell inputs are added to the outputs. Inherits From: AbstractRNNCell, Layer, Module 
tf.nn.RNNCellResidualWrapper(
    *args, **kwargs
)

 


 Args
  cell   An instance of RNNCell.  
  residual_fn   (Optional) The function to map raw cell inputs and raw cell outputs to the actual cell outputs of the residual network. Defaults to calling nest.map_structure on (lambda i, o: i + o), inputs and outputs.  
  **kwargs   dict of keyword arguments for base layer.   
 


 Attributes
  output_size  
 
  state_size  
   Methods get_initial_state View source 
get_initial_state(
    inputs=None, batch_size=None, dtype=None
)
 zero_state View source 
zero_state(
    batch_size, dtype
)