neulab/docprompting-conala huggingface dataset:
tf.compat.v1.losses.softmax_cross_entropy Creates a cross-entropy loss using tf.nn.softmax_cross_entropy_with_logits_v2. 
tf.compat.v1.losses.softmax_cross_entropy(
    onehot_labels, logits, weights=1.0, label_smoothing=0, scope=None,
    loss_collection=tf.GraphKeys.LOSSES, reduction=Reduction.SUM_BY_NONZERO_WEIGHTS
)
 weights acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If weights is a tensor of shape [batch_size], then the loss weights apply to each corresponding sample. If label_smoothing is nonzero, smooth the labels towards 1/num_classes: new_onehot_labels = onehot_labels * (1 - label_smoothing) + label_smoothing / num_classes
 Note that onehot_labels and logits must have the same shape, e.g. [batch_size, num_classes]. The shape of weights must be broadcastable to loss, whose shape is decided by the shape of logits. In case the shape of logits is [batch_size, num_classes], loss is a Tensor of shape [batch_size].
 


 Args
  onehot_labels   One-hot-encoded labels.  
  logits   Logits outputs of the network.  
  weights   Optional Tensor that is broadcastable to loss.  
  label_smoothing   If greater than 0 then smooth the labels.  
  scope   the scope for the operations performed in computing the loss.  
  loss_collection   collection to which the loss will be added.  
  reduction   Type of reduction to apply to loss.   
 


 Returns   Weighted loss Tensor of the same type as logits. If reduction is NONE, this has shape [batch_size]; otherwise, it is scalar.  

 


 Raises
  ValueError   If the shape of logits doesn't match that of onehot_labels or if the shape of weights is invalid or if weights is None. Also if onehot_labels or logits is None.    Eager Compatibility The loss_collection argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a tf.keras.Model.
tf.compat.v1.losses.sparse_softmax_cross_entropy Cross-entropy loss using tf.nn.sparse_softmax_cross_entropy_with_logits. 
tf.compat.v1.losses.sparse_softmax_cross_entropy(
    labels, logits, weights=1.0, scope=None, loss_collection=tf.GraphKeys.LOSSES,
    reduction=Reduction.SUM_BY_NONZERO_WEIGHTS
)
 weights acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If weights is a tensor of shape [batch_size], then the loss weights apply to each corresponding sample.
 


 Args
  labels   Tensor of shape [d_0, d_1, ..., d_{r-1}] (where r is rank of labels and result) and dtype int32 or int64. Each entry in labels must be an index in [0, num_classes). Other values will raise an exception when this op is run on CPU, and return NaN for corresponding loss and gradient rows on GPU.  
  logits   Unscaled log probabilities of shape [d_0, d_1, ..., d_{r-1}, num_classes] and dtype float16, float32 or float64.  
  weights   Coefficients for the loss. This must be scalar or broadcastable to labels (i.e. same rank and each dimension is either 1 or the same).  
  scope   the scope for the operations performed in computing the loss.  
  loss_collection   collection to which the loss will be added.  
  reduction   Type of reduction to apply to loss.   
 


 Returns   Weighted loss Tensor of the same type as logits. If reduction is NONE, this has the same shape as labels; otherwise, it is scalar.  

 


 Raises
  ValueError   If the shapes of logits, labels, and weights are incompatible, or if any of them are None.    Eager Compatibility The loss_collection argument is ignored when executing eagerly. Consider holding on to the return value or collecting losses via a tf.keras.Model.
Module: tf.compat.v1.manip Operators for manipulating tensors. Functions batch_to_space_nd(...): BatchToSpace for N-D tensors of type T. gather_nd(...): Gather slices from params into a Tensor with shape specified by indices. reshape(...): Reshapes a tensor. reverse(...): Reverses specific dimensions of a tensor. roll(...): Rolls the elements of a tensor along an axis. scatter_nd(...): Scatter updates into a new tensor according to indices. space_to_batch_nd(...): SpaceToBatch for N-D tensors of type T. tile(...): Constructs a tensor by tiling a given tensor.
tf.compat.v1.math.in_top_k   Says whether the targets are in the top K predictions.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.in_top_k  
tf.compat.v1.math.in_top_k(
    predictions, targets, k, name=None
)
 This outputs a batch_size bool array, an entry out[i] is true if the prediction for the target class is finite (not inf, -inf, or nan) and among the top k predictions among all predictions for example i. Note that the behavior of InTopK differs from the TopK op in its handling of ties; if multiple classes have the same prediction value and straddle the top-k boundary, all of those classes are considered to be in the top k. More formally, let \(predictions_i\) be the predictions for all classes for example i, \(targets_i\) be the target class for example i, \(out_i\) be the output for example i,  $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ 
 


 Args
  predictions   A Tensor of type float32. A batch_size x classes tensor.  
  targets   A Tensor. Must be one of the following types: int32, int64. A batch_size vector of class ids.  
  k   An int. Number of top elements to look at for computing precision.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type bool. Computed Precision at k as a bool Tensor.
tf.compat.v1.math.log_softmax Computes log softmax activations. (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.log_softmax  
tf.compat.v1.math.log_softmax(
    logits, axis=None, name=None, dim=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (dim). They will be removed in a future version. Instructions for updating: dim is deprecated, use axis instead 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).  
  dim   Deprecated alias for axis.   
 


 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.compat.v1.math.softmax Computes softmax activations. (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.softmax  
tf.compat.v1.math.softmax(
    logits, axis=None, name=None, dim=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (dim). They will be removed in a future version. Instructions for updating: dim is deprecated, use axis instead This function performs the equivalent of softmax = tf.exp(logits) / tf.reduce_sum(tf.exp(logits), axis)
 See: https://en.wikipedia.org/wiki/Softmax_function Example usage: 
tf.nn.softmax([-1, 0., 1.])
<tf.Tensor: shape=(3,), dtype=float32,
numpy=array([0.09003057, 0.24472848, 0.66524094], dtype=float32)>

 


 Args
  logits   A non-empty Tensor, or an object whose type has a registered Tensor conversion function. Must be one of the following types: half,float32, float64. See also convert_to_tensor  
  axis   The dimension softmax would be performed on. The default is -1 which indicates the last dimension.  
  name   A name for the operation (optional).  
  dim   Deprecated alias for axis.   
 


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

 


 Raises
  InvalidArgumentError   if logits is empty or axis is beyond the last dimension of logits.  
  TypeError   If no conversion function is registered for logits to Tensor.  
  RuntimeError   If a registered conversion function returns an invalid value.
Module: tf.compat.v1.math.special Public API for tf.math.special namespace. Functions bessel_i0(...): Computes the Bessel i0 function of x element-wise. bessel_i0e(...): Computes the Bessel i0e function of x element-wise. bessel_i1(...): Computes the Bessel i1 function of x element-wise. bessel_i1e(...): Computes the Bessel i1e function of x element-wise. bessel_j0(...): Computes the Bessel j0 function of x element-wise. bessel_j1(...): Computes the Bessel j1 function of x element-wise. bessel_k0(...): Computes the Bessel k0 function of x element-wise. bessel_k0e(...): Computes the Bessel k0e function of x element-wise. bessel_k1(...): Computes the Bessel k1 function of x element-wise. bessel_k1e(...): Computes the Bessel k1e function of x element-wise. bessel_y0(...): Computes the Bessel y0 function of x element-wise. bessel_y1(...): Computes the Bessel y1 function of x element-wise. dawsn(...): Computes Dawson's integral of x element-wise. expint(...): Computes the Exponential integral of x element-wise. fresnel_cos(...): Computes Fresnel's cosine integral of x element-wise. fresnel_sin(...): Computes Fresnel's sine integral of x element-wise. spence(...): Computes Spence's integral of x element-wise.
tf.compat.v1.MetaGraphDef A ProtocolMessage
 


 Attributes
  asset_file_def   repeated AssetFileDef asset_file_def  
  collection_def   repeated CollectionDefEntry collection_def  
  graph_def   GraphDef graph_def  
  meta_info_def   MetaInfoDef meta_info_def  
  object_graph_def   SavedObjectGraph object_graph_def  
  saver_def   SaverDef saver_def  
  signature_def   repeated SignatureDefEntry signature_def    Child Classes class CollectionDefEntry class MetaInfoDef class SignatureDefEntry
tf.compat.v1.MetaGraphDef.CollectionDefEntry A ProtocolMessage
 


 Attributes
  key   string key  
  value   CollectionDef value
tf.compat.v1.MetaGraphDef.MetaInfoDef A ProtocolMessage
 


 Attributes
  any_info   Any any_info  
  function_aliases   repeated FunctionAliasesEntry function_aliases  
  meta_graph_version   string meta_graph_version  
  stripped_default_attrs   bool stripped_default_attrs  
  stripped_op_list   OpList stripped_op_list  
  tags   repeated string tags  
  tensorflow_git_version   string tensorflow_git_version  
  tensorflow_version   string tensorflow_version    Child Classes class FunctionAliasesEntry
tf.compat.v1.MetaGraphDef.MetaInfoDef.FunctionAliasesEntry A ProtocolMessage
 


 Attributes
  key   string key  
  value   string value
tf.compat.v1.MetaGraphDef.SignatureDefEntry A ProtocolMessage
 


 Attributes
  key   string key  
  value   SignatureDef value
Module: tf.compat.v1.metrics Evaluation-related metrics. Functions accuracy(...): Calculates how often predictions matches labels. auc(...): Computes the approximate AUC via a Riemann sum. (deprecated) average_precision_at_k(...): Computes average precision@k of predictions with respect to sparse labels. false_negatives(...): Computes the total number of false negatives. false_negatives_at_thresholds(...): Computes false negatives at provided threshold values. false_positives(...): Sum the weights of false positives. false_positives_at_thresholds(...): Computes false positives at provided threshold values. mean(...): Computes the (weighted) mean of the given values. mean_absolute_error(...): Computes the mean absolute error between the labels and predictions. mean_cosine_distance(...): Computes the cosine distance between the labels and predictions. mean_iou(...): Calculate per-step mean Intersection-Over-Union (mIOU). mean_per_class_accuracy(...): Calculates the mean of the per-class accuracies. mean_relative_error(...): Computes the mean relative error by normalizing with the given values. mean_squared_error(...): Computes the mean squared error between the labels and predictions. mean_tensor(...): Computes the element-wise (weighted) mean of the given tensors. percentage_below(...): Computes the percentage of values less than the given threshold. precision(...): Computes the precision of the predictions with respect to the labels. precision_at_k(...): Computes precision@k of the predictions with respect to sparse labels. precision_at_thresholds(...): Computes precision values for different thresholds on predictions. precision_at_top_k(...): Computes precision@k of the predictions with respect to sparse labels. recall(...): Computes the recall of the predictions with respect to the labels. recall_at_k(...): Computes recall@k of the predictions with respect to sparse labels. recall_at_thresholds(...): Computes various recall values for different thresholds on predictions. recall_at_top_k(...): Computes recall@k of top-k predictions with respect to sparse labels. root_mean_squared_error(...): Computes the root mean squared error between the labels and predictions. sensitivity_at_specificity(...): Computes the specificity at a given sensitivity. sparse_average_precision_at_k(...): Renamed to average_precision_at_k, please use that method instead. (deprecated) sparse_precision_at_k(...): Renamed to precision_at_k, please use that method instead. (deprecated) specificity_at_sensitivity(...): Computes the specificity at a given sensitivity. true_negatives(...): Sum the weights of true_negatives. true_negatives_at_thresholds(...): Computes true negatives at provided threshold values. true_positives(...): Sum the weights of true_positives. true_positives_at_thresholds(...): Computes true positives at provided threshold values.
tf.compat.v1.metrics.accuracy Calculates how often predictions matches labels. 
tf.compat.v1.metrics.accuracy(
    labels, predictions, weights=None, metrics_collections=None,
    updates_collections=None, name=None
)
 The accuracy function creates two local variables, total and count that are used to compute the frequency with which predictions matches labels. This frequency is ultimately returned as accuracy: an idempotent operation that simply divides total by count. For estimation of the metric over a stream of data, the function creates an update_op operation that updates these variables and returns the accuracy. Internally, an is_correct operation computes a Tensor with elements 1.0 where the corresponding elements of predictions and labels match and 0.0 otherwise. Then update_op increments total with the reduced sum of the product of weights and is_correct, and it increments count with the reduced sum of weights. If weights is None, weights default to 1. Use weights of 0 to mask values.
 


 Args
  labels   The ground truth values, a Tensor whose shape matches predictions.  
  predictions   The predicted values, a Tensor of any shape.  
  weights   Optional Tensor whose rank is either 0, or the same rank as labels, and must be broadcastable to labels (i.e., all dimensions must be either 1, or the same as the corresponding labels dimension).  
  metrics_collections   An optional list of collections that accuracy should be added to.  
  updates_collections   An optional list of collections that update_op should be added to.  
  name   An optional variable_scope name.   
 


 Returns
  accuracy   A Tensor representing the accuracy, the value of total divided by count.  
  update_op   An operation that increments the total and count variables appropriately and whose value matches accuracy.   
 


 Raises
  ValueError   If predictions and labels have mismatched shapes, or if weights is not None and its shape doesn't match predictions, or if either metrics_collections or updates_collections are not a list or tuple.  
  RuntimeError   If eager execution is enabled.
tf.compat.v1.metrics.average_precision_at_k Computes average precision@k of predictions with respect to sparse labels. 
tf.compat.v1.metrics.average_precision_at_k(
    labels, predictions, k, weights=None, metrics_collections=None,
    updates_collections=None, name=None
)
 average_precision_at_k creates two local variables, average_precision_at_<k>/total and average_precision_at_<k>/max, that are used to compute the frequency. This frequency is ultimately returned as average_precision_at_<k>: an idempotent operation that simply divides average_precision_at_<k>/total by average_precision_at_<k>/max. For estimation of the metric over a stream of data, the function creates an update_op operation that updates these variables and returns the precision_at_<k>. Internally, a top_k operation computes a Tensor indicating the top k predictions. Set operations applied to top_k and labels calculate the true positives and false positives weighted by weights. Then update_op increments true_positive_at_<k> and false_positive_at_<k> using these values. If weights is None, weights default to 1. Use weights of 0 to mask values.
 


 Args
  labels   int64 Tensor or SparseTensor with shape [D1, ... DN, num_labels] or [D1, ... DN], where the latter implies num_labels=1. N >= 1 and num_labels is the number of target classes for the associated prediction. Commonly, N=1 and labels has shape [batch_size, num_labels]. [D1, ... DN] must match predictions. Values should be in range [0, num_classes), where num_classes is the last dimension of predictions. Values outside this range are ignored.  
  predictions   Float Tensor with shape [D1, ... DN, num_classes] where N >= 1. Commonly, N=1 and predictions has shape [batch size, num_classes]. The final dimension contains the logit values for each class. [D1, ... DN] must match labels.  
  k   Integer, k for @k metric. This will calculate an average precision for range [1,k], as documented above.  
  weights   Tensor whose rank is either 0, or n-1, where n is the rank of labels. If the latter, it must be broadcastable to labels (i.e., all dimensions must be either 1, or the same as the corresponding labels dimension).  
  metrics_collections   An optional list of collections that values should be added to.  
  updates_collections   An optional list of collections that updates should be added to.  
  name   Name of new update operation, and namespace for other dependent ops.   
 


 Returns
  mean_average_precision   Scalar float64 Tensor with the mean average precision values.  
  update   Operation that increments variables appropriately, and whose value matches metric.   
 


 Raises
  ValueError   if k is invalid.  
  RuntimeError   If eager execution is enabled.
tf.compat.v1.metrics.false_negatives Computes the total number of false negatives. 
tf.compat.v1.metrics.false_negatives(
    labels, predictions, weights=None, metrics_collections=None,
    updates_collections=None, name=None
)
 If weights is None, weights default to 1. Use weights of 0 to mask values.
 


 Args
  labels   The ground truth values, a Tensor whose dimensions must match predictions. Will be cast to bool.  
  predictions   The predicted values, a Tensor of arbitrary dimensions. Will be cast to bool.  
  weights   Optional Tensor whose rank is either 0, or the same rank as labels, and must be broadcastable to labels (i.e., all dimensions must be either 1, or the same as the corresponding labels dimension).  
  metrics_collections   An optional list of collections that the metric value variable should be added to.  
  updates_collections   An optional list of collections that the metric update ops should be added to.  
  name   An optional variable_scope name.   
 


 Returns
  value_tensor   A Tensor representing the current value of the metric.  
  update_op   An operation that accumulates the error from a batch of data.   
 


 Raises
  ValueError   If weights is not None and its shape doesn't match values, or if either metrics_collections or updates_collections are not a list or tuple.  
  RuntimeError   If eager execution is enabled.
tf.compat.v1.metrics.false_negatives_at_thresholds Computes false negatives at provided threshold values. 
tf.compat.v1.metrics.false_negatives_at_thresholds(
    labels, predictions, thresholds, weights=None, metrics_collections=None,
    updates_collections=None, name=None
)
 If weights is None, weights default to 1. Use weights of 0 to mask values.
 


 Args
  labels   A Tensor whose shape matches predictions. Will be cast to bool.  
  predictions   A floating point Tensor of arbitrary shape and whose values are in the range [0, 1].  
  thresholds   A python list or tuple of float thresholds in [0, 1].  
  weights   Optional Tensor whose rank is either 0, or the same rank as labels, and must be broadcastable to labels (i.e., all dimensions must be either 1, or the same as the corresponding labels dimension).  
  metrics_collections   An optional list of collections that false_negatives should be added to.  
  updates_collections   An optional list of collections that update_op should be added to.  
  name   An optional variable_scope name.   
 


 Returns
  false_negatives   A float Tensor of shape [len(thresholds)].  
  update_op   An operation that updates the false_negatives variable and returns its current value.   
 


 Raises
  ValueError   If predictions and labels have mismatched shapes, or if weights is not None and its shape doesn't match predictions, or if either metrics_collections or updates_collections are not a list or tuple.  
  RuntimeError   If eager execution is enabled.
tf.compat.v1.metrics.false_positives Sum the weights of false positives. 
tf.compat.v1.metrics.false_positives(
    labels, predictions, weights=None, metrics_collections=None,
    updates_collections=None, name=None
)
 If weights is None, weights default to 1. Use weights of 0 to mask values.
 


 Args
  labels   The ground truth values, a Tensor whose dimensions must match predictions. Will be cast to bool.  
  predictions   The predicted values, a Tensor of arbitrary dimensions. Will be cast to bool.  
  weights   Optional Tensor whose rank is either 0, or the same rank as labels, and must be broadcastable to labels (i.e., all dimensions must be either 1, or the same as the corresponding labels dimension).  
  metrics_collections   An optional list of collections that the metric value variable should be added to.  
  updates_collections   An optional list of collections that the metric update ops should be added to.  
  name   An optional variable_scope name.   
 


 Returns
  value_tensor   A Tensor representing the current value of the metric.  
  update_op   An operation that accumulates the error from a batch of data.   
 


 Raises
  ValueError   If predictions and labels have mismatched shapes, or if weights is not None and its shape doesn't match predictions, or if either metrics_collections or updates_collections are not a list or tuple.  
  RuntimeError   If eager execution is enabled.
tf.compat.v1.metrics.false_positives_at_thresholds Computes false positives at provided threshold values. 
tf.compat.v1.metrics.false_positives_at_thresholds(
    labels, predictions, thresholds, weights=None, metrics_collections=None,
    updates_collections=None, name=None
)
 If weights is None, weights default to 1. Use weights of 0 to mask values.
 


 Args
  labels   A Tensor whose shape matches predictions. Will be cast to bool.  
  predictions   A floating point Tensor of arbitrary shape and whose values are in the range [0, 1].  
  thresholds   A python list or tuple of float thresholds in [0, 1].  
  weights   Optional Tensor whose rank is either 0, or the same rank as labels, and must be broadcastable to labels (i.e., all dimensions must be either 1, or the same as the corresponding labels dimension).  
  metrics_collections   An optional list of collections that false_positives should be added to.  
  updates_collections   An optional list of collections that update_op should be added to.  
  name   An optional variable_scope name.   
 


 Returns
  false_positives   A float Tensor of shape [len(thresholds)].  
  update_op   An operation that updates the false_positives variable and returns its current value.   
 


 Raises
  ValueError   If predictions and labels have mismatched shapes, or if weights is not None and its shape doesn't match predictions, or if either metrics_collections or updates_collections are not a list or tuple.  
  RuntimeError   If eager execution is enabled.