diff options
8 files changed, 150 insertions, 16 deletions
diff --git a/tensorflow/g3doc/api_docs/python/constant_op.md b/tensorflow/g3doc/api_docs/python/constant_op.md index bdd39690a6..ccd881cca8 100644 --- a/tensorflow/g3doc/api_docs/python/constant_op.md +++ b/tensorflow/g3doc/api_docs/python/constant_op.md @@ -537,6 +537,54 @@ Example: - - - +### `tf.random_gamma(shape, alpha, beta=None, dtype=tf.float32, seed=None, name=None)` {#random_gamma} + +Draws `shape` samples from each of the given Gamma distribution(s). + +`alpha` is the shape parameter describing the distribution(s), and `beta` is +the inverse scale parameter(s). + +Example: + + samples = tf.random_gamma([10], [0.5, 1.5]) + # samples has shape [10, 2], where each slice [:, 0] and [:, 1] represents + # the samples drawn from each distribution + + samples = tf.random_gamma([7, 5], [0.5, 1.5]) + # samples has shape [7, 5, 2], where each slice [:, :, 0] and [:, :, 1] + # represents the 7x5 samples drawn from each of the two distributions + + samples = tf.random_gamma([30], [[1.],[3.],[5.]], beta=[[3., 4.]]) + # samples has shape [30, 3, 2], with 30 samples each of 3x2 distributions. + +##### Args: + + +* <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output samples + to be drawn per alpha/beta-parameterized distribution. +* <b>`alpha`</b>: A Tensor or Python value or N-D array of type `dtype`. `alpha` + provides the shape parameter(s) describing the gamma distribution(s) to + sample. Must be broadcastable with `beta`. +* <b>`beta`</b>: A Tensor or Python value or N-D array of type `dtype`. Defaults to 1. + `beta` provides the inverse scale parameter(s) of the gamma + distribution(s) to sample. Must be broadcastable with `alpha`. +* <b>`dtype`</b>: The type of alpha, beta, and the output: `float16`, `float32`, or + `float64`. +* <b>`seed`</b>: A Python integer. Used to create a random seed for the distributions. + See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. +* <b>`name`</b>: Optional name for the operation. + +##### Returns: + + +* <b>`samples`</b>: a `Tensor` of shape `tf.concat(shape, tf.shape(alpha + beta))` with + values of type `dtype`. + + +- - - + ### `tf.set_random_seed(seed)` {#set_random_seed} Sets the graph-level random seed. diff --git a/tensorflow/g3doc/api_docs/python/contrib.distributions.md b/tensorflow/g3doc/api_docs/python/contrib.distributions.md index 5bf9a4edb0..08f753b28e 100644 --- a/tensorflow/g3doc/api_docs/python/contrib.distributions.md +++ b/tensorflow/g3doc/api_docs/python/contrib.distributions.md @@ -1050,14 +1050,17 @@ Pdf of observations in `x` under these Gamma distribution(s). #### `tf.contrib.distributions.Chi2.sample(n, seed=None, name='sample')` {#Chi2.sample} -Generate `n` samples. +Draws `n` samples from the Gamma distribution(s). + +See the doc for tf.random_gamma for further detail. ##### Args: -* <b>`n`</b>: scalar. Number of samples to draw from each distribution. -* <b>`seed`</b>: Python integer seed for RNG -* <b>`name`</b>: name to give to the op. +* <b>`n`</b>: Python integer, the number of observations to sample from each + distribution. +* <b>`seed`</b>: Python integer, the random seed for this operation. +* <b>`name`</b>: Optional name for the operation. ##### Returns: @@ -1646,14 +1649,17 @@ Pdf of observations in `x` under these Gamma distribution(s). #### `tf.contrib.distributions.Gamma.sample(n, seed=None, name='sample')` {#Gamma.sample} -Generate `n` samples. +Draws `n` samples from the Gamma distribution(s). + +See the doc for tf.random_gamma for further detail. ##### Args: -* <b>`n`</b>: scalar. Number of samples to draw from each distribution. -* <b>`seed`</b>: Python integer seed for RNG -* <b>`name`</b>: name to give to the op. +* <b>`n`</b>: Python integer, the number of observations to sample from each + distribution. +* <b>`seed`</b>: Python integer, the random seed for this operation. +* <b>`name`</b>: Optional name for the operation. ##### Returns: diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard2/tf.contrib.distributions.Chi2.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard2/tf.contrib.distributions.Chi2.md index 5d568cee76..d104424bea 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard2/tf.contrib.distributions.Chi2.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard2/tf.contrib.distributions.Chi2.md @@ -249,14 +249,17 @@ Pdf of observations in `x` under these Gamma distribution(s). #### `tf.contrib.distributions.Chi2.sample(n, seed=None, name='sample')` {#Chi2.sample} -Generate `n` samples. +Draws `n` samples from the Gamma distribution(s). + +See the doc for tf.random_gamma for further detail. ##### Args: -* <b>`n`</b>: scalar. Number of samples to draw from each distribution. -* <b>`seed`</b>: Python integer seed for RNG -* <b>`name`</b>: name to give to the op. +* <b>`n`</b>: Python integer, the number of observations to sample from each + distribution. +* <b>`seed`</b>: Python integer, the random seed for this operation. +* <b>`name`</b>: Optional name for the operation. ##### Returns: diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard3/tf.contrib.distributions.Gamma.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard3/tf.contrib.distributions.Gamma.md index 881fd6628d..8a704e1e7d 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard3/tf.contrib.distributions.Gamma.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard3/tf.contrib.distributions.Gamma.md @@ -273,14 +273,17 @@ Pdf of observations in `x` under these Gamma distribution(s). #### `tf.contrib.distributions.Gamma.sample(n, seed=None, name='sample')` {#Gamma.sample} -Generate `n` samples. +Draws `n` samples from the Gamma distribution(s). + +See the doc for tf.random_gamma for further detail. ##### Args: -* <b>`n`</b>: scalar. Number of samples to draw from each distribution. -* <b>`seed`</b>: Python integer seed for RNG -* <b>`name`</b>: name to give to the op. +* <b>`n`</b>: Python integer, the number of observations to sample from each + distribution. +* <b>`seed`</b>: Python integer, the random seed for this operation. +* <b>`name`</b>: Optional name for the operation. ##### Returns: diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard3/tf.random_gamma.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard3/tf.random_gamma.md new file mode 100644 index 0000000000..1873ced0a2 --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard3/tf.random_gamma.md @@ -0,0 +1,45 @@ +### `tf.random_gamma(shape, alpha, beta=None, dtype=tf.float32, seed=None, name=None)` {#random_gamma} + +Draws `shape` samples from each of the given Gamma distribution(s). + +`alpha` is the shape parameter describing the distribution(s), and `beta` is +the inverse scale parameter(s). + +Example: + + samples = tf.random_gamma([10], [0.5, 1.5]) + # samples has shape [10, 2], where each slice [:, 0] and [:, 1] represents + # the samples drawn from each distribution + + samples = tf.random_gamma([7, 5], [0.5, 1.5]) + # samples has shape [7, 5, 2], where each slice [:, :, 0] and [:, :, 1] + # represents the 7x5 samples drawn from each of the two distributions + + samples = tf.random_gamma([30], [[1.],[3.],[5.]], beta=[[3., 4.]]) + # samples has shape [30, 3, 2], with 30 samples each of 3x2 distributions. + +##### Args: + + +* <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output samples + to be drawn per alpha/beta-parameterized distribution. +* <b>`alpha`</b>: A Tensor or Python value or N-D array of type `dtype`. `alpha` + provides the shape parameter(s) describing the gamma distribution(s) to + sample. Must be broadcastable with `beta`. +* <b>`beta`</b>: A Tensor or Python value or N-D array of type `dtype`. Defaults to 1. + `beta` provides the inverse scale parameter(s) of the gamma + distribution(s) to sample. Must be broadcastable with `alpha`. +* <b>`dtype`</b>: The type of alpha, beta, and the output: `float16`, `float32`, or + `float64`. +* <b>`seed`</b>: A Python integer. Used to create a random seed for the distributions. + See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. +* <b>`name`</b>: Optional name for the operation. + +##### Returns: + + +* <b>`samples`</b>: a `Tensor` of shape `tf.concat(shape, tf.shape(alpha + beta))` with + values of type `dtype`. + diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.train.SummaryWriter.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.train.SummaryWriter.md index a7f5aef5f1..8d32d95f79 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.train.SummaryWriter.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.train.SummaryWriter.md @@ -168,3 +168,17 @@ Flushes the event file to disk and close the file. Call this method when you do not need the summary writer anymore. + +#### Other Methods +- - - + +#### `tf.train.SummaryWriter.reopen()` {#SummaryWriter.reopen} + +Reopens the summary writer. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the summary writer was not closed. + + diff --git a/tensorflow/g3doc/api_docs/python/index.md b/tensorflow/g3doc/api_docs/python/index.md index 8c713b90c0..2aad7565e6 100644 --- a/tensorflow/g3doc/api_docs/python/index.md +++ b/tensorflow/g3doc/api_docs/python/index.md @@ -58,6 +58,7 @@ * [`ones`](../../api_docs/python/constant_op.md#ones) * [`ones_like`](../../api_docs/python/constant_op.md#ones_like) * [`random_crop`](../../api_docs/python/constant_op.md#random_crop) + * [`random_gamma`](../../api_docs/python/constant_op.md#random_gamma) * [`random_normal`](../../api_docs/python/constant_op.md#random_normal) * [`random_shuffle`](../../api_docs/python/constant_op.md#random_shuffle) * [`random_uniform`](../../api_docs/python/constant_op.md#random_uniform) diff --git a/tensorflow/g3doc/api_docs/python/train.md b/tensorflow/g3doc/api_docs/python/train.md index 3cdb0abe1c..7bae49b4a6 100644 --- a/tensorflow/g3doc/api_docs/python/train.md +++ b/tensorflow/g3doc/api_docs/python/train.md @@ -3272,6 +3272,20 @@ Call this method when you do not need the summary writer anymore. +#### Other Methods +- - - + +#### `tf.train.SummaryWriter.reopen()` {#SummaryWriter.reopen} + +Reopens the summary writer. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the summary writer was not closed. + + + - - - ### `tf.train.summary_iterator(path)` {#summary_iterator} |