diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-02-13 13:51:18 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-02-13 17:04:17 -0800 |
commit | b8de25b940689c407fac05a27bf0ecf61b94bfcb (patch) | |
tree | 5abb694541eb87a58065482b5269af5c4063fea2 /tensorflow/g3doc | |
parent | 223ae5414377c9500f6506de32674fe7285b0af3 (diff) |
Update generated Python Op docs.
Change: 147388400
Diffstat (limited to 'tensorflow/g3doc')
-rw-r--r-- | tensorflow/g3doc/api_docs/python/contrib.linalg.md | 19 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/contrib.losses.md | 2 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/contrib.metrics.md | 92 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/contrib.opt.md | 35 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/contrib.rnn.md | 28 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/functional_ops.md | 7 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.contrib.opt.MovingAverageOptimizer.md | 33 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/histogram_ops.md | 2 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/image.md | 109 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/io_ops.md | 83 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/math_ops.md | 93 | ||||
-rw-r--r-- | tensorflow/g3doc/api_docs/python/nn.md | 207 |
12 files changed, 76 insertions, 634 deletions
diff --git a/tensorflow/g3doc/api_docs/python/contrib.linalg.md b/tensorflow/g3doc/api_docs/python/contrib.linalg.md index 2eb11e6766..2060e85211 100644 --- a/tensorflow/g3doc/api_docs/python/contrib.linalg.md +++ b/tensorflow/g3doc/api_docs/python/contrib.linalg.md @@ -3,18 +3,7 @@ # Linear Algebra (contrib) [TOC] -Linear algebra libraries for TensorFlow. - -## `LinearOperator` - -Subclasses of `LinearOperator` provide a access to common methods on a -(batch) matrix, without the need to materialize the matrix. This allows: - -* Matrix free computations -* Different operators to take advantage of special strcture, while providing a - consistent API to users. - -### Base class +Linear algebra libraries. See the @{$python/contrib.linalg} guide. - - - @@ -574,9 +563,6 @@ Return a dense (batch) matrix representing this operator. - -### Individual operators - - - - ### `class tf.contrib.linalg.LinearOperatorDiag` {#LinearOperatorDiag} @@ -3884,9 +3870,6 @@ If this operator is `A = L + U D V^H`, this is the `V`. - -### Transformations and Combinations of operators - - - - ### `class tf.contrib.linalg.LinearOperatorComposition` {#LinearOperatorComposition} diff --git a/tensorflow/g3doc/api_docs/python/contrib.losses.md b/tensorflow/g3doc/api_docs/python/contrib.losses.md index 7e3bada502..eef457bd1a 100644 --- a/tensorflow/g3doc/api_docs/python/contrib.losses.md +++ b/tensorflow/g3doc/api_docs/python/contrib.losses.md @@ -3,7 +3,7 @@ # Losses (contrib) [TOC] -Ops for building neural network losses. +Ops for building neural network losses. See @{$python/contrib.losses}. ## Other Functions and Classes - - - diff --git a/tensorflow/g3doc/api_docs/python/contrib.metrics.md b/tensorflow/g3doc/api_docs/python/contrib.metrics.md index f7f02dd7d1..f11fd9d193 100644 --- a/tensorflow/g3doc/api_docs/python/contrib.metrics.md +++ b/tensorflow/g3doc/api_docs/python/contrib.metrics.md @@ -3,90 +3,9 @@ # Metrics (contrib) [TOC] -##Ops for evaluation metrics and summary statistics. +Ops for evaluation metrics and summary statistics. -### API - -This module provides functions for computing streaming metrics: metrics computed -on dynamically valued `Tensors`. Each metric declaration returns a -"value_tensor", an idempotent operation that returns the current value of the -metric, and an "update_op", an operation that accumulates the information -from the current value of the `Tensors` being measured as well as returns the -value of the "value_tensor". - -To use any of these metrics, one need only declare the metric, call `update_op` -repeatedly to accumulate data over the desired number of `Tensor` values (often -each one is a single batch) and finally evaluate the value_tensor. For example, -to use the `streaming_mean`: - -```python -value = ... -mean_value, update_op = tf.contrib.metrics.streaming_mean(values) -sess.run(tf.local_variables_initializer()) - -for i in range(number_of_batches): - print('Mean after batch %d: %f' % (i, update_op.eval()) -print('Final Mean: %f' % mean_value.eval()) -``` - -Each metric function adds nodes to the graph that hold the state necessary to -compute the value of the metric as well as a set of operations that actually -perform the computation. Every metric evaluation is composed of three steps - -* Initialization: initializing the metric state. -* Aggregation: updating the values of the metric state. -* Finalization: computing the final metric value. - -In the above example, calling streaming_mean creates a pair of state variables -that will contain (1) the running sum and (2) the count of the number of samples -in the sum. Because the streaming metrics use local variables, -the Initialization stage is performed by running the op returned -by `tf.local_variables_initializer()`. It sets the sum and count variables to -zero. - -Next, Aggregation is performed by examining the current state of `values` -and incrementing the state variables appropriately. This step is executed by -running the `update_op` returned by the metric. - -Finally, finalization is performed by evaluating the "value_tensor" - -In practice, we commonly want to evaluate across many batches and multiple -metrics. To do so, we need only run the metric computation operations multiple -times: - -```python -labels = ... -predictions = ... -accuracy, update_op_acc = tf.contrib.metrics.streaming_accuracy( - labels, predictions) -error, update_op_error = tf.contrib.metrics.streaming_mean_absolute_error( - labels, predictions) - -sess.run(tf.local_variables_initializer()) -for batch in range(num_batches): - sess.run([update_op_acc, update_op_error]) - -accuracy, mean_absolute_error = sess.run([accuracy, mean_absolute_error]) -``` - -Note that when evaluating the same metric multiple times on different inputs, -one must specify the scope of each metric to avoid accumulating the results -together: - -```python -labels = ... -predictions0 = ... -predictions1 = ... - -accuracy0 = tf.contrib.metrics.accuracy(labels, predictions0, name='preds0') -accuracy1 = tf.contrib.metrics.accuracy(labels, predictions1, name='preds1') -``` - -Certain metrics, such as streaming_mean or streaming_accuracy, can be weighted -via a `weights` argument. The `weights` tensor must be the same size as the -labels and predictions tensors and results in a weighted average of the metric. - -## Metric `Ops` +See the @{$python/contrib.metrics} guide. - - - @@ -1696,7 +1615,6 @@ If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. - - - - ### `tf.contrib.metrics.auc_using_histogram(boolean_labels, scores, score_range, nbins=100, collections=None, check_shape=True, name=None)` {#auc_using_histogram} @@ -1738,7 +1656,6 @@ numbers of bins and comparing results. * <b>`update_op`</b>: `Op`, when run, updates internal histograms. - - - - ### `tf.contrib.metrics.accuracy(predictions, labels, weights=None)` {#accuracy} @@ -1765,7 +1682,6 @@ Computes the percentage of times that predictions matches labels. if dtype is not bool, integer, or string. - - - - ### `tf.contrib.metrics.aggregate_metrics(*value_update_tuples)` {#aggregate_metrics} @@ -1822,7 +1738,6 @@ and update ops when the list of metrics is long. For example: names to update ops. - - - - ### `tf.contrib.metrics.confusion_matrix(labels, predictions, num_classes=None, dtype=tf.int32, name=None, weights=None)` {#confusion_matrix} @@ -1830,9 +1745,6 @@ and update ops when the list of metrics is long. For example: Deprecated. Use tf.confusion_matrix instead. - -## Set `Ops` - - - - ### `tf.contrib.metrics.set_difference(a, b, aminusb=True, validate_indices=True)` {#set_difference} diff --git a/tensorflow/g3doc/api_docs/python/contrib.opt.md b/tensorflow/g3doc/api_docs/python/contrib.opt.md index 12d789af83..e93e3f4571 100644 --- a/tensorflow/g3doc/api_docs/python/contrib.opt.md +++ b/tensorflow/g3doc/api_docs/python/contrib.opt.md @@ -3,7 +3,7 @@ # Optimization (contrib) [TOC] -opt: A module containing optimization routines. +A module containing optimization routines. ## Other Functions and Classes - - - @@ -71,7 +71,38 @@ executing commands to control a `Session`. ### `class tf.contrib.opt.MovingAverageOptimizer` {#MovingAverageOptimizer} -Optimizer wrapper that maintains a moving average of parameters. +Optimizer that computes a moving average of the variables. + +Empirically it has been found that using the moving average of the trained +parameters of a deep network is better than using its trained parameters +directly. This optimizer allows you to compute this moving average and swap +the variables at save time so that any code outside of the training loop will +use by default the averaged values instead of the original ones. + +Example of usage: + +```python + +// Encapsulate your favorite optimizer (here the momentum one) +// inside the MovingAverageOptimizer. +opt = tf.train.MomentumOptimizer(learning_rate, FLAGS.momentum) +opt = tf.contrib.opt.MovingAverageOptimizer(opt) +// Then create your model and all its variables. +model = build_model() +// Add the training op that optimizes using opt. +// This needs to be called before swapping_saver(). +opt.minimize(cost, var_list) +// Then create your saver like this: +saver = opt.swapping_saver() +// Pass it to your training loop. + slim.learning.train( + model, + ... + saver=saver) +``` + +Note that for evaluation, the normal saver should be used instead of +swapping_saver(). - - - #### `tf.contrib.opt.MovingAverageOptimizer.__init__(opt, average_decay=0.9999, num_updates=None, sequential_update=True)` {#MovingAverageOptimizer.__init__} diff --git a/tensorflow/g3doc/api_docs/python/contrib.rnn.md b/tensorflow/g3doc/api_docs/python/contrib.rnn.md index 6482ec4b01..6107639c95 100644 --- a/tensorflow/g3doc/api_docs/python/contrib.rnn.md +++ b/tensorflow/g3doc/api_docs/python/contrib.rnn.md @@ -3,9 +3,7 @@ # RNN and Cells (contrib) [TOC] -Module for constructing RNN Cells and additional RNN operations. - -## Base interface for all RNN Cells +RNN Cells and additional RNN operations. See @{$python/contrib.rnn} guide. - - - @@ -97,9 +95,6 @@ the shapes `[batch_size x s]` for each s in `state_size`. - -## Core RNN Cells for use with TensorFlow's core RNN methods - - - - ### `class tf.contrib.rnn.BasicRNNCell` {#BasicRNNCell} @@ -507,9 +502,6 @@ the shapes `[batch_size x s]` for each s in `state_size`. - -## Classes storing split `RNNCell` state - - - - ### `class tf.contrib.rnn.LSTMStateTuple` {#LSTMStateTuple} @@ -569,9 +561,6 @@ Alias for field number 1 - -## Core RNN Cell wrappers (RNNCells that wrap other RNNCells) - - - - ### `class tf.contrib.rnn.MultiRNNCell` {#MultiRNNCell} @@ -1137,8 +1126,6 @@ the shapes `[batch_size x s]` for each s in `state_size`. - -### Block RNNCells - - - ### `class tf.contrib.rnn.LSTMBlockCell` {#LSTMBlockCell} @@ -1300,8 +1287,6 @@ the shapes `[batch_size x s]` for each s in `state_size`. - -### Fused RNNCells - - - ### `class tf.contrib.rnn.FusedRNNCell` {#FusedRNNCell} @@ -1487,8 +1472,6 @@ Number of units in this cell (output dimension). - -### LSTM-like cells - - - ### `class tf.contrib.rnn.CoupledInputForgetGateLSTMCell` {#CoupledInputForgetGateLSTMCell} @@ -1865,8 +1848,6 @@ the shapes `[batch_size x s]` for each s in `state_size`. - -### RNNCell wrappers - - - ### `class tf.contrib.rnn.AttentionCellWrapper` {#AttentionCellWrapper} @@ -2012,13 +1993,6 @@ the shapes `[batch_size x s]` for each s in `state_size`. - - -## Recurrent Neural Networks - -TensorFlow provides a number of methods for constructing Recurrent Neural -Networks. - - - - ### `tf.contrib.rnn.static_rnn(cell, inputs, initial_state=None, dtype=None, sequence_length=None, scope=None)` {#static_rnn} diff --git a/tensorflow/g3doc/api_docs/python/functional_ops.md b/tensorflow/g3doc/api_docs/python/functional_ops.md index 02338eb97e..f81af171b1 100644 --- a/tensorflow/g3doc/api_docs/python/functional_ops.md +++ b/tensorflow/g3doc/api_docs/python/functional_ops.md @@ -7,12 +7,7 @@ Note: Functions taking `Tensor` arguments can also take anything accepted by [TOC] -Functional operations. - -## Higher Order Operators - -TensorFlow provides several higher order operators to simplify the common -map-reduce programming patterns. +Functional operations. See the @{$python/functional_ops} guide. - - - diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.contrib.opt.MovingAverageOptimizer.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.contrib.opt.MovingAverageOptimizer.md index 88f68a4b85..582deec24d 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.contrib.opt.MovingAverageOptimizer.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.contrib.opt.MovingAverageOptimizer.md @@ -1,4 +1,35 @@ -Optimizer wrapper that maintains a moving average of parameters. +Optimizer that computes a moving average of the variables. + +Empirically it has been found that using the moving average of the trained +parameters of a deep network is better than using its trained parameters +directly. This optimizer allows you to compute this moving average and swap +the variables at save time so that any code outside of the training loop will +use by default the averaged values instead of the original ones. + +Example of usage: + +```python + +// Encapsulate your favorite optimizer (here the momentum one) +// inside the MovingAverageOptimizer. +opt = tf.train.MomentumOptimizer(learning_rate, FLAGS.momentum) +opt = tf.contrib.opt.MovingAverageOptimizer(opt) +// Then create your model and all its variables. +model = build_model() +// Add the training op that optimizes using opt. +// This needs to be called before swapping_saver(). +opt.minimize(cost, var_list) +// Then create your saver like this: +saver = opt.swapping_saver() +// Pass it to your training loop. + slim.learning.train( + model, + ... + saver=saver) +``` + +Note that for evaluation, the normal saver should be used instead of +swapping_saver(). - - - #### `tf.contrib.opt.MovingAverageOptimizer.__init__(opt, average_decay=0.9999, num_updates=None, sequential_update=True)` {#MovingAverageOptimizer.__init__} diff --git a/tensorflow/g3doc/api_docs/python/histogram_ops.md b/tensorflow/g3doc/api_docs/python/histogram_ops.md index 912712fb02..e9fa732e60 100644 --- a/tensorflow/g3doc/api_docs/python/histogram_ops.md +++ b/tensorflow/g3doc/api_docs/python/histogram_ops.md @@ -3,7 +3,7 @@ # Histograms [TOC] -## Histograms +Histograms. Please see @{$python/histogram_ops} guide. - - - diff --git a/tensorflow/g3doc/api_docs/python/image.md b/tensorflow/g3doc/api_docs/python/image.md index baef42db05..8d233dcadb 100644 --- a/tensorflow/g3doc/api_docs/python/image.md +++ b/tensorflow/g3doc/api_docs/python/image.md @@ -7,19 +7,7 @@ Note: Functions taking `Tensor` arguments can also take anything accepted by [TOC] -## Encoding and Decoding - -TensorFlow provides Ops to decode and encode JPEG and PNG formats. Encoded -images are represented by scalar string Tensors, decoded images by 3-D uint8 -tensors of shape `[height, width, channels]`. (PNG also supports uint16.) - -The encode and decode Ops apply to one image at a time. Their input and output -are all of variable size. If you need fixed size images, pass the output of -the decode Ops to one of the cropping and resizing Ops. - -Note: The PNG encode and decode Ops support RGBA, but the conversions Ops -presently only support RGB, HSV, and GrayScale. Presently, the alpha channel has -to be stripped from the image and re-attached using slicing ops. +Image processing and decoding ops. See the @{$python/image} guide. - - - @@ -44,7 +32,6 @@ convert $src.gif -coalesce $dst.gif 4-D with shape `[num_frames, height, width, 3]`. RGB order - - - - ### `tf.image.decode_jpeg(contents, channels=None, ratio=None, fancy_upscaling=None, try_recover_truncated=None, acceptable_fraction=None, dct_method=None, name=None)` {#decode_jpeg} @@ -150,7 +137,6 @@ in function of the number of channels in `image`: A `Tensor` of type `string`. 0-D. JPEG-encoded image. - - - - ### `tf.image.decode_png(contents, channels=None, dtype=None, name=None)` {#decode_png} @@ -215,7 +201,6 @@ the smallest output, but is slower. A `Tensor` of type `string`. 0-D. PNG-encoded image. - - - - ### `tf.image.decode_image(contents, channels=None, name=None)` {#decode_image} @@ -245,29 +230,6 @@ files. images. - -## Resizing - -The resizing Ops accept input images as tensors of several types. They always -output resized images as float32 tensors. - -The convenience function [`resize_images()`](#resize_images) supports both 4-D -and 3-D tensors as input and output. 4-D tensors are for batches of images, -3-D tensors for individual images. - -Other resizing Ops only support 4-D batches of images as input: -[`resize_area`](#resize_area), [`resize_bicubic`](#resize_bicubic), -[`resize_bilinear`](#resize_bilinear), -[`resize_nearest_neighbor`](#resize_nearest_neighbor). - -Example: - -```python -# Decode a JPG image and resize it to 299 by 299 using default method. -image = tf.image.decode_jpeg(...) -resized_image = tf.image.resize_images(image, [299, 299]) -``` - - - - ### `tf.image.resize_images(images, size, method=0, align_corners=False)` {#resize_images} @@ -312,7 +274,6 @@ the same as `size`. To avoid distortions see `[new_height, new_width, channels]`. - - - - ### `tf.image.resize_area(images, size, align_corners=None, name=None)` {#resize_area} @@ -419,9 +380,6 @@ Resize `images` to `size` using nearest neighbor interpolation. `[batch, new_height, new_width, channels]`. - -## Cropping - - - - ### `tf.image.resize_image_with_crop_or_pad(image, target_height, target_width)` {#resize_image_with_crop_or_pad} @@ -455,7 +413,6 @@ dimension. `[target_height, target_width, channels]` - - - - ### `tf.image.central_crop(image, central_fraction)` {#central_crop} @@ -616,7 +573,6 @@ The argument `normalized` and `centered` controls how the windows are built: glimpse_height, glimpse_width, channels]`. - - - - ### `tf.image.crop_and_resize(image, boxes, box_ind, crop_size, method=None, extrapolation_value=None, name=None)` {#crop_and_resize} @@ -670,9 +626,6 @@ result is a 4-D tensor `[num_boxes, crop_height, crop_width, depth]`. A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`. - -## Flipping, Rotating and Transposing - - - - ### `tf.image.flip_up_down(image)` {#flip_up_down} @@ -726,7 +679,6 @@ dimension, which is `height`. Otherwise output the image as-is. * <b>`ValueError`</b>: if the shape of `image` not supported. - - - - ### `tf.image.flip_left_right(image)` {#flip_left_right} @@ -780,7 +732,6 @@ second dimension, which is `width`. Otherwise output the image as-is. * <b>`ValueError`</b>: if the shape of `image` not supported. - - - - ### `tf.image.transpose_image(image)` {#transpose_image} @@ -804,7 +755,6 @@ See also `transpose()`. * <b>`ValueError`</b>: if the shape of `image` not supported. - - - - ### `tf.image.rot90(image, k=1, name=None)` {#rot90} @@ -824,38 +774,6 @@ Rotate an image counter-clockwise by 90 degrees. -## Converting Between Colorspaces. - -Image ops work either on individual images or on batches of images, depending on -the shape of their input Tensor. - -If 3-D, the shape is `[height, width, channels]`, and the Tensor represents one -image. If 4-D, the shape is `[batch_size, height, width, channels]`, and the -Tensor represents `batch_size` images. - -Currently, `channels` can usefully be 1, 2, 3, or 4. Single-channel images are -grayscale, images with 3 channels are encoded as either RGB or HSV. Images -with 2 or 4 channels include an alpha channel, which has to be stripped from the -image before passing the image to most image processing functions (and can be -re-attached later). - -Internally, images are either stored in as one `float32` per channel per pixel -(implicitly, values are assumed to lie in `[0,1)`) or one `uint8` per channel -per pixel (values are assumed to lie in `[0,255]`). - -TensorFlow can convert between images in RGB or HSV. The conversion functions -work only on float images, so you need to convert images in other formats using -[`convert_image_dtype`](#convert-image-dtype). - -Example: - -```python -# Decode an image and convert it to HSV. -rgb_image = tf.image.decode_png(..., channels=3) -rgb_image_float = tf.image.convert_image_dtype(rgb_image, tf.float32) -hsv_image = tf.image.rgb_to_hsv(rgb_image) -``` - - - - ### `tf.image.rgb_to_grayscale(images, name=None)` {#rgb_to_grayscale} @@ -898,7 +816,6 @@ last dimension of the output is 3, containing the RGB value of the pixels. The converted grayscale image(s). - - - - ### `tf.image.hsv_to_rgb(images, name=None)` {#hsv_to_rgb} @@ -949,7 +866,6 @@ corresponds to pure red, hue 1/3 is pure green, and 2/3 is pure blue. A `Tensor`. Has the same type as `images`. `images` converted to HSV. - - - - ### `tf.image.convert_image_dtype(image, dtype, saturate=False, name=None)` {#convert_image_dtype} @@ -985,18 +901,6 @@ effect on casts between floats, or on casts that increase the type's range). `image`, converted to `dtype`. - -## Image Adjustments - -TensorFlow provides functions to adjust images in various ways: brightness, -contrast, hue, and saturation. Each adjustment can be done with predefined -parameters or with random parameters picked from predefined intervals. Random -adjustments are often useful to expand a training set and reduce overfitting. - -If several adjustments are chained it is advisable to minimize the number of -redundant conversions by first converting the images to the most natural data -type and representation (RGB or HSV). - - - - ### `tf.image.adjust_brightness(image, delta)` {#adjust_brightness} @@ -1053,7 +957,6 @@ interval `[-max_delta, max_delta)`. * <b>`ValueError`</b>: if `max_delta` is negative. - - - - ### `tf.image.adjust_contrast(images, contrast_factor)` {#adjust_contrast} @@ -1115,7 +1018,6 @@ picked in the interval `[lower, upper]`. * <b>`ValueError`</b>: if `upper <= lower` or if `lower < 0`. - - - - ### `tf.image.adjust_hue(image, delta, name=None)` {#adjust_hue} @@ -1176,7 +1078,6 @@ picked in the interval `[-max_delta, max_delta]`. * <b>`ValueError`</b>: if `max_delta` is invalid. - - - - ### `tf.image.adjust_gamma(image, gamma=1, gain=1)` {#adjust_gamma} @@ -1208,7 +1109,6 @@ Performs Gamma Correction on the input image. [1] http://en.wikipedia.org/wiki/Gamma_correction - - - - ### `tf.image.adjust_saturation(image, saturation_factor, name=None)` {#adjust_saturation} @@ -1267,7 +1167,6 @@ picked in the interval `[lower, upper]`. * <b>`ValueError`</b>: if `upper <= lower` or if `lower < 0`. - - - - ### `tf.image.per_image_standardization(image)` {#per_image_standardization} @@ -1296,9 +1195,6 @@ away from zero to protect against division by 0 when handling uniform images. * <b>`ValueError`</b>: if the shape of 'image' is incompatible with this function. - -## Working with Bounding Boxes - - - - ### `tf.image.draw_bounding_boxes(images, boxes, name=None)` {#draw_bounding_boxes} @@ -1474,9 +1370,6 @@ false and no bounding boxes are supplied, an error is raised. Provide as input to `tf.image.draw_bounding_boxes`. - -## Denoising - - - - ### `tf.image.total_variation(images, name=None)` {#total_variation} diff --git a/tensorflow/g3doc/api_docs/python/io_ops.md b/tensorflow/g3doc/api_docs/python/io_ops.md index fad7a6f12e..458480c876 100644 --- a/tensorflow/g3doc/api_docs/python/io_ops.md +++ b/tensorflow/g3doc/api_docs/python/io_ops.md @@ -7,11 +7,7 @@ Note: Functions taking `Tensor` arguments can also take anything accepted by [TOC] -## Placeholders - -TensorFlow provides a placeholder operation that must be fed with data -on execution. For more info, see the section on [Feeding -data](../../how_tos/reading_data/index.md#feeding). +Inputs and Readers. See the @{$python/io_ops} guide. - - - @@ -70,10 +66,6 @@ A placeholder op that passes through `input` when its output is not fed. A placeholder tensor that defaults to `input` if it is not fed. - -For feeding `SparseTensor`s which are composite type, -there is a convenience function: - - - - ### `tf.sparse_placeholder(dtype, shape=None, name=None)` {#sparse_placeholder} @@ -120,13 +112,6 @@ with tf.Session() as sess: evaluated directly. - -## Readers - -TensorFlow provides a set of Reader classes for reading data formats. -For more information on inputs and readers, see [Reading -data](../../how_tos/reading_data/index.md). - - - - ### `class tf.ReaderBase` {#ReaderBase} @@ -1213,12 +1198,6 @@ Whether the Reader implementation can serialize its state. - -## Converting - -TensorFlow provides several operations that you can use to convert various data -formats into tensors. - - - - ### `tf.decode_csv(records, record_defaults, field_delim=None, name=None)` {#decode_csv} @@ -1274,18 +1253,6 @@ Reinterpret the bytes of a string as a vector of numbers. of `bytes` divided by the number of bytes to represent `out_type`. - -- - - - -### Example protocol buffer - -TensorFlow's [recommended format for training -examples](../../how_tos/reading_data/index.md#standard-tensorflow-format) -is serialized `Example` protocol buffers, [described -here](https://www.tensorflow.org/code/tensorflow/core/example/example.proto). -They contain `Features`, [described -here](https://www.tensorflow.org/code/tensorflow/core/example/feature.proto). - - - - ### `class tf.VarLenFeature` {#VarLenFeature} @@ -1831,15 +1798,6 @@ Example-parsing ops. to the respective element of `json_examples`. - -## Queues - -TensorFlow provides several implementations of 'Queues', which are -structures within the TensorFlow computation graph to stage pipelines -of tensors together. The following describe the basic Queue interface -and some implementations. To see an example use, see [Threading and -Queues](../../how_tos/threading_and_queues/index.md). - - - - ### `class tf.QueueBase` {#QueueBase} @@ -2373,9 +2331,6 @@ an int64 scalar (for `enqueue`) or an int64 vector (for `enqueue_many`). - -## Conditional Accumulators - - - - ### `class tf.ConditionalAccumulatorBase` {#ConditionalAccumulatorBase} @@ -2815,9 +2770,6 @@ Once successful, the following actions are also triggered: - -## Dealing with the filesystem - - - - ### `tf.matching_files(pattern, name=None)` {#matching_files} @@ -2876,18 +2828,6 @@ Writes contents to the file at input filename. Creates file if not existing. The created Operation. - -## Input pipeline - -TensorFlow functions for setting up an input-prefetching pipeline. -Please see the [reading data how-to](../../how_tos/reading_data/index.md) -for context. - -### Beginning of an input pipeline - -The "producer" functions add a queue to the graph and a corresponding -`QueueRunner` for running the subgraph that fills that queue. - - - - ### `tf.train.match_filenames_once(pattern, name=None)` {#match_filenames_once} @@ -3085,27 +3025,6 @@ Note: if `num_epochs` is not `None`, this function creates local counter will fail with an assertion if string_tensor becomes a null tensor. - -### Batching at the end of an input pipeline - -These functions add a queue to the graph to assemble a batch of -examples, with possible shuffling. They also add a `QueueRunner` for -running the subgraph that fills that queue. - -Use [`batch`](#batch) or [`batch_join`](#batch_join) for batching -examples that have already been well shuffled. Use -[`shuffle_batch`](#shuffle_batch) or -[`shuffle_batch_join`](#shuffle_batch_join) for examples that would -benefit from additional shuffling. - -Use [`batch`](#batch) or [`shuffle_batch`](#shuffle_batch) if you want a -single thread producing examples to batch, or if you have a -single subgraph producing examples but you want to run it in *N* threads -(where you increase *N* until it can keep the queue full). Use -[`batch_join`](#batch_join) or [`shuffle_batch_join`](#shuffle_batch_join) -if you have *N* different subgraphs producing examples to batch and you -want them run by *N* threads. Use `maybe_*` to enqueue conditionally. - - - - ### `tf.train.batch(tensors, batch_size, num_threads=1, capacity=32, enqueue_many=False, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, shared_name=None, name=None)` {#batch} diff --git a/tensorflow/g3doc/api_docs/python/math_ops.md b/tensorflow/g3doc/api_docs/python/math_ops.md index 8a4a117907..c6e68117db 100644 --- a/tensorflow/g3doc/api_docs/python/math_ops.md +++ b/tensorflow/g3doc/api_docs/python/math_ops.md @@ -7,13 +7,7 @@ Note: Functions taking `Tensor` arguments can also take anything accepted by [TOC] -Note: Elementwise binary operations in TensorFlow follow [numpy-style -broadcasting](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html). - -## Arithmetic Operators - -TensorFlow provides several operations that you can use to add basic arithmetic -operators to your graph. +Basic arithmetic operators. See the @{$python/math_ops} guide. - - - @@ -376,12 +370,6 @@ of corresponding 3-element vectors is cross-multiplied independently. Pairwise cross product of the vectors in `a` and `b`. - -## Basic Math Functions - -TensorFlow provides several operations that you can use to add basic -mathematical functions to your graph. - - - - ### `tf.add_n(inputs, name=None)` {#add_n} @@ -1155,12 +1143,6 @@ rint([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) ==> [-2., -2., -0., 0., 2., 2., 2.] A `Tensor`. Has the same type as `x`. - -## Matrix Math Functions - -TensorFlow provides several operations that you can use to add linear algebra -functions on matrices to your graph. - - - - ### `tf.diag(diagonal, name=None)` {#diag} @@ -1330,7 +1312,6 @@ tf.transpose(x, perm=[0, 2, 1]) ==> [[[1 4] A transposed `Tensor`. - - - - ### `tf.eye(num_rows, num_columns=None, batch_shape=None, dtype=tf.float32, name=None)` {#eye} @@ -1597,7 +1578,6 @@ tf.matrix_transpose(x) ==> [[1 4] * <b>`ValueError`</b>: If `a` is determined statically to have `rank < 2`. - - - - ### `tf.matmul(a, b, transpose_a=False, transpose_b=False, adjoint_a=False, adjoint_b=False, a_is_sparse=False, b_is_sparse=False, name=None)` {#matmul} @@ -1691,7 +1671,6 @@ c = tf.matmul(a, b) => [[[ 94 100] are both set to True. - - - - ### `tf.norm(tensor, ord='euclidean', axis=None, keep_dims=False, name=None)` {#norm} @@ -2148,13 +2127,6 @@ arguments here is `s`, `u`, `v` when `compute_uv` is `True`, as opposed to @end_compatibility - - -## Tensor Math Function - -TensorFlow provides operations that you can use to add tensor functions to your -graph. - - - - ### `tf.tensordot(a, b, axes, name=None)` {#tensordot} @@ -2212,13 +2184,6 @@ In general, `order(c) = order(a) + order(b) - 2*len(axes[0])`. tensor. - - -## Complex Number Functions - -TensorFlow provides several operations that you can use to add complex number -functions to your graph. - - - - ### `tf.complex(real, imag, name=None)` {#complex} @@ -2352,12 +2317,6 @@ If `input` is already real, it is returned unchanged. A `Tensor` of type `float32` or `float64`. - -## Fourier Transform Functions - -TensorFlow provides several operations that you can use to add discrete -Fourier transform functions to your graph. - - - - ### `tf.fft(input, name=None)` {#fft} @@ -2500,12 +2459,6 @@ Compute the inverse 3-dimensional discrete Fourier Transform over the inner-most @end_compatibility - -## Reduction - -TensorFlow provides several operations that you can use to perform -common math computations that reduce various dimensions of a tensor. - - - - ### `tf.reduce_sum(input_tensor, axis=None, keep_dims=False, name=None, reduction_indices=None)` {#reduce_sum} @@ -2870,7 +2823,6 @@ tf.count_nonzero(x, [0, 1]) ==> 3 The reduced tensor (number of nonzero values). - - - - ### `tf.accumulate_n(inputs, shape=None, tensor_dtype=None, name=None)` {#accumulate_n} @@ -2914,7 +2866,6 @@ tf.accumulate_n([a, b, a], shape=[2, 2], tensor_dtype=tf.int32) cannot be inferred. - - - - ### `tf.einsum(equation, *inputs)` {#einsum} @@ -2992,12 +2943,6 @@ This function behaves like `numpy.einsum`, but does not support: - the input shapes are inconsistent along a particular axis. - -## Scan - -TensorFlow provides several operations that you can use to perform scans -(running totals) across one axis of a tensor. - - - - ### `tf.cumsum(x, axis=0, exclusive=False, reverse=False, name=None)` {#cumsum} @@ -3090,28 +3035,6 @@ tf.cumprod([a, b, c], exclusive=True, reverse=True) ==> [b * c, c, 1] A `Tensor`. Has the same type as `x`. - -## Segmentation - -TensorFlow provides several operations that you can use to perform common -math computations on tensor segments. -Here a segmentation is a partitioning of a tensor along -the first dimension, i.e. it defines a mapping from the first dimension onto -`segment_ids`. The `segment_ids` tensor should be the size of -the first dimension, `d0`, with consecutive IDs in the range `0` to `k`, -where `k<d0`. -In particular, a segmentation of a matrix tensor is a mapping of rows to -segments. - -For example: - -```python -c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]]) -tf.segment_sum(c, tf.constant([0, 0, 1])) - ==> [[0 0 0 0] - [5 6 7 8]] -``` - - - - ### `tf.segment_sum(data, segment_ids, name=None)` {#segment_sum} @@ -3281,7 +3204,6 @@ values summed. has size `k`, the number of segments. - - - - ### `tf.unsorted_segment_sum(data, segment_ids, num_segments, name=None)` {#unsorted_segment_sum} @@ -3364,7 +3286,6 @@ If the maximum is empty for a given segment ID `i`, it outputs the smallest poss has size `num_segments`. - - - - ### `tf.sparse_segment_sum(data, indices, segment_ids, name=None)` {#sparse_segment_sum} @@ -3477,15 +3398,6 @@ of segments. has size `k`, the number of segments. - - -## Sequence Comparison and Indexing - -TensorFlow provides several operations that you can use to add sequence -comparison and index extraction to your graph. You can use these operations to -determine sequence differences and determine the indexes of specific values in -a tensor. - - - - ### `tf.argmin(input, axis=None, name=None, dimension=None)` {#argmin} @@ -3526,7 +3438,6 @@ Returns the index with the largest value across axes of a tensor. A `Tensor` of type `int64`. - - - - ### `tf.setdiff1d(x, y, index_dtype=tf.int32, name=None)` {#setdiff1d} @@ -3658,7 +3569,6 @@ idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4] * <b>`idx`</b>: A `Tensor` of type `out_idx`. 1-D. - - - - ### `tf.edit_distance(hypothesis, truth, normalize=True, name='edit_distance')` {#edit_distance} @@ -3727,7 +3637,6 @@ output ==> [[inf, 1.0], # (0,0): no truth, (0,1): no hypothesis * <b>`TypeError`</b>: If either `hypothesis` or `truth` are not a `SparseTensor`. - - - - ### `tf.invert_permutation(x, name=None)` {#invert_permutation} diff --git a/tensorflow/g3doc/api_docs/python/nn.md b/tensorflow/g3doc/api_docs/python/nn.md index c348155bd7..cda8959391 100644 --- a/tensorflow/g3doc/api_docs/python/nn.md +++ b/tensorflow/g3doc/api_docs/python/nn.md @@ -7,16 +7,7 @@ Note: Functions taking `Tensor` arguments can also take anything accepted by [TOC] -## Activation Functions. - -The activation ops provide different types of nonlinearities for use in neural -networks. These include smooth nonlinearities (`sigmoid`, `tanh`, `elu`, -`softplus`, and `softsign`), continuous but not everywhere differentiable -functions (`relu`, `relu6`, `crelu` and `relu_x`), and random regularization -(`dropout`). - -All activation ops apply componentwise, and produce a tensor of the same -shape as the input tensor. +## Neural network support. See the @{$python/nn} guide. - - - @@ -242,78 +233,6 @@ Computes hyperbolic tangent of `x` element-wise. `x.dtype != qint32` otherwise the return type is `quint8`. - -## Convolution - -The convolution ops sweep a 2-D filter over a batch of images, applying the -filter to each window of each image of the appropriate size. The different -ops trade off between generic vs. specific filters: - -* `conv2d`: Arbitrary filters that can mix channels together. -* `depthwise_conv2d`: Filters that operate on each channel independently. -* `separable_conv2d`: A depthwise spatial filter followed by a pointwise filter. - -Note that although these ops are called "convolution", they are strictly -speaking "cross-correlation" since the filter is combined with an input window -without reversing the filter. For details, see [the properties of -cross-correlation](https://en.wikipedia.org/wiki/Cross-correlation#Properties). - -The filter is applied to image patches of the same size as the filter and -strided according to the `strides` argument. `strides = [1, 1, 1, 1]` applies -the filter to a patch at every offset, `strides = [1, 2, 2, 1]` applies the -filter to every other image patch in each dimension, etc. - -Ignoring channels for the moment, and assume that the 4-D `input` has shape -`[batch, in_height, in_width, ...]` and the 4-D `filter` has shape -`[filter_height, filter_width, ...]`, then the spatial semantics of the -convolution ops are as follows: first, according to the padding scheme chosen -as `'SAME'` or `'VALID'`, the output size and the padding pixels are computed. -For the `'SAME'` padding, the output height and width are computed as: - - out_height = ceil(float(in_height) / float(strides[1])) - out_width = ceil(float(in_width) / float(strides[2])) - -and the padding on the top and left are computed as: - - pad_along_height = max((out_height - 1) * strides[1] + - filter_height - in_height, 0) - pad_along_width = max((out_width - 1) * strides[2] + - filter_width - in_width, 0) - pad_top = pad_along_height // 2 - pad_bottom = pad_along_height - pad_top - pad_left = pad_along_width // 2 - pad_right = pad_along_width - pad_left - - -Note that the division by 2 means that there might be cases when the padding on -both sides (top vs bottom, right vs left) are off by one. In this case, the -bottom and right sides always get the one additional padded pixel. For example, -when `pad_along_height` is 5, we pad 2 pixels at the top and 3 pixels at the -bottom. Note that this is different from existing libraries such as cuDNN and -Caffe, which explicitly specify the number of padded pixels and always pad the -same number of pixels on both sides. - -For the `'VALID`' padding, the output height and width are computed as: - - out_height = ceil(float(in_height - filter_height + 1) / float(strides[1])) - out_width = ceil(float(in_width - filter_width + 1) / float(strides[2])) - -and the padding values are always zero. The output is then computed as - - output[b, i, j, :] = - sum_{di, dj} input[b, strides[1] * i + di - pad_top, - strides[2] * j + dj - pad_left, ...] * - filter[di, dj, ...] - -where any value outside the original input image region are considered zero ( -i.e. we pad zero values around the border of the image). - -Since `input` is 4-D, each `input[b, i, j, :]` is a vector. For `conv2d`, these -vectors are multiplied by the `filter[di, dj, :, :]` matrices to produce new -vectors. For `depthwise_conv_2d`, each scalar component `input[b, i, j, k]` -is multiplied by a vector `filter[di, dj, k]`, and all the vectors are -concatenated. - - - - ### `tf.nn.convolution(input, filter, padding, strides=None, dilation_rate=None, name=None, data_format=None)` {#convolution} @@ -1132,22 +1051,6 @@ Computes the gradients of depthwise convolution with respect to the input. w.r.t. the input of the convolution. - -## Pooling - -The pooling ops sweep a rectangular window over the input tensor, computing a -reduction operation for each window (average, max, or max with argmax). Each -pooling op uses rectangular windows of size `ksize` separated by offset -`strides`. For example, if `strides` is all ones every window is used, if -`strides` is all twos every other window is used in each dimension, etc. - -In detail, the output is - - output[i] = reduce(value[strides * i:strides * i + ksize]) - -where the indices also take into consideration the padding values. Please refer -to the `Convolution` section for details about the padding calculation. - - - - ### `tf.nn.avg_pool(value, ksize, strides, padding, data_format='NHWC', name=None)` {#avg_pool} @@ -1515,44 +1418,6 @@ simply transposed as follows: * <b>`ValueError`</b>: if arguments are invalid. - -## Morphological filtering - -Morphological operators are non-linear filters used in image processing. - -[Greyscale morphological dilation -](https://en.wikipedia.org/wiki/Dilation_(morphology)) -is the max-sum counterpart of standard sum-product convolution: - - output[b, y, x, c] = - max_{dy, dx} input[b, - strides[1] * y + rates[1] * dy, - strides[2] * x + rates[2] * dx, - c] + - filter[dy, dx, c] - -The `filter` is usually called structuring function. Max-pooling is a special -case of greyscale morphological dilation when the filter assumes all-zero -values (a.k.a. flat structuring function). - -[Greyscale morphological erosion -](https://en.wikipedia.org/wiki/Erosion_(morphology)) -is the min-sum counterpart of standard sum-product convolution: - - output[b, y, x, c] = - min_{dy, dx} input[b, - strides[1] * y - rates[1] * dy, - strides[2] * x - rates[2] * dx, - c] - - filter[dy, dx, c] - -Dilation and erosion are dual to each other. The dilation of the input signal -`f` by the structuring signal `g` is equal to the negation of the erosion of -`-f` by the reflected `g`, and vice versa. - -Striding and padding is carried out in exactly the same way as in standard -convolution. Please refer to the `Convolution` section for details. - - - - ### `tf.nn.dilation2d(input, filter, strides, rates, padding, name=None)` {#dilation2d} @@ -1797,12 +1662,6 @@ can be combined into a single `with_space_to_batch` operation as follows: * <b>`ValueError`</b>: if `spatial_dims` are invalid. - -## Normalization - -Normalization is useful to prevent neurons from saturating when inputs may -have varying scale, and to aid generalization. - - - - ### `tf.nn.l2_normalize(x, dim, epsilon=1e-12, name=None)` {#l2_normalize} @@ -2101,13 +1960,6 @@ This op is deprecated. See `tf.nn.batch_normalization`. A batch-normalized `t`. - -## Losses - -The loss ops measure error between two tensors, or between a tensor and zero. -These can be used for measuring accuracy of a network in a regression task -or for regularization purposes (weight decay). - - - - ### `tf.nn.l2_loss(t, name=None)` {#l2_loss} @@ -2177,11 +2029,6 @@ loss is * <b>`ValueError`</b>: If `log_input` and `targets` do not have the same shape. - -## Classification - -TensorFlow provides several operations that help you perform classification. - - - - ### `tf.nn.sigmoid_cross_entropy_with_logits(_sentinel=None, labels=None, logits=None, name=None)` {#sigmoid_cross_entropy_with_logits} @@ -2446,12 +2293,6 @@ the implementation uses * <b>`ValueError`</b>: If `logits` and `targets` do not have the same shape. - -## Embeddings - -TensorFlow provides library support for looking up values in embedding -tensors. - - - - ### `tf.nn.embedding_lookup(params, ids, partition_strategy='mod', name=None, validate_indices=True, max_norm=None)` {#embedding_lookup} @@ -2590,13 +2431,6 @@ is the sum of the size of params along dimension 0. * <b>`ValueError`</b>: If combiner is not one of {"mean", "sqrtn", "sum"}. - -## Recurrent Neural Networks - -TensorFlow provides a number of methods for constructing Recurrent -Neural Networks. Most accept an `RNNCell`-subclassed object -(see the documentation for `tf.contrib.rnn`). - - - - ### `tf.nn.dynamic_rnn(cell, inputs, sequence_length=None, initial_state=None, dtype=None, parallel_iterations=None, swap_memory=False, time_major=False, scope=None)` {#dynamic_rnn} @@ -2962,9 +2796,6 @@ outputs = outputs_ta.stack() a `callable`. - -## Connectionist Temporal Classification (CTC) - - - - ### `tf.nn.ctc_loss(labels, inputs, sequence_length, preprocess_collapse_repeated=False, ctc_merge_repeated=True, time_major=True)` {#ctc_loss} @@ -3159,12 +2990,6 @@ is `A B B B B`, the return value is: sequence log-probabilities. - -## Evaluation - -The evaluation ops are useful for measuring the performance of a network. -They are typically used at evaluation time. - - - - ### `tf.nn.top_k(input, k=1, sorted=True, name=None)` {#top_k} @@ -3235,24 +3060,6 @@ $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ A `Tensor` of type `bool`. Computed Precision at `k` as a `bool Tensor`. - -## Candidate Sampling - -Do you want to train a multiclass or multilabel model with thousands -or millions of output classes (for example, a language model with a -large vocabulary)? Training with a full Softmax is slow in this case, -since all of the classes are evaluated for every training example. -Candidate Sampling training algorithms can speed up your step times by -only considering a small randomly-chosen subset of contrastive classes -(called candidates) for each batch of training examples. - -See our -[Candidate Sampling Algorithms Reference](../../extras/candidate_sampling.pdf) - -### Sampled Loss Functions - -TensorFlow provides the following sampled loss functions for faster training. - - - - ### `tf.nn.nce_loss(weights, biases, labels, inputs, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=False, partition_strategy='mod', name='nce_loss')` {#nce_loss} @@ -3366,12 +3173,6 @@ Also see Section 3 of [Jean et al., 2014](http://arxiv.org/abs/1412.2007) A `batch_size` 1-D tensor of per-example sampled softmax losses. - -### Candidate Samplers - -TensorFlow provides the following samplers for randomly sampling candidate -classes when using one of the sampled loss functions above. - - - - ### `tf.nn.uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)` {#uniform_candidate_sampler} @@ -3617,9 +3418,6 @@ compute them approximately. of each of `sampled_candidates`. - -### Miscellaneous candidate sampling utilities - - - - ### `tf.nn.compute_accidental_hits(true_classes, sampled_candidates, num_true, seed=None, name=None)` {#compute_accidental_hits} @@ -3668,9 +3466,6 @@ target classes as noise classes for the same example. Each value is `-FLOAT_MAX`. - -### Quantization ops - - - - ### `tf.nn.quantized_conv2d(input, filter, min_input, max_input, min_filter, max_filter, strides, padding, out_type=None, name=None)` {#quantized_conv2d} |