mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-07 12:20:24 +01:00
Fix typos
This commit is contained in:
parent
af0cbace1d
commit
72e2918ccd
|
|
@ -218,7 +218,7 @@ class FtrlOptimizerTest(XLATestCase):
|
||||||
self.assertAllClose(np.array([-0.24059935, -0.46829352]), var0.eval())
|
self.assertAllClose(np.array([-0.24059935, -0.46829352]), var0.eval())
|
||||||
self.assertAllClose(np.array([-0.02406147, -0.04830509]), var1.eval())
|
self.assertAllClose(np.array([-0.02406147, -0.04830509]), var1.eval())
|
||||||
|
|
||||||
# When variables are intialized with Zero, FTRL-Proximal has two properties:
|
# When variables are initialized with Zero, FTRL-Proximal has two properties:
|
||||||
# 1. Without L1&L2 but with fixed learning rate, FTRL-Proximal is identical
|
# 1. Without L1&L2 but with fixed learning rate, FTRL-Proximal is identical
|
||||||
# with GradientDescent.
|
# with GradientDescent.
|
||||||
# 2. Without L1&L2 but with adaptive learning rate, FTRL-Proximal is idential
|
# 2. Without L1&L2 but with adaptive learning rate, FTRL-Proximal is idential
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ message OpMetadata {
|
||||||
string op_name = 2;
|
string op_name = 2;
|
||||||
// Indicate a file and line that this op is associated to in a user's program.
|
// Indicate a file and line that this op is associated to in a user's program.
|
||||||
//
|
//
|
||||||
// e.g. it could be be the file and line of user code that generated the op.
|
// e.g. it could be the file and line of user code that generated the op.
|
||||||
string source_file = 3;
|
string source_file = 3;
|
||||||
int32 source_line = 4;
|
int32 source_line = 4;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class RelaxedBernoulli(transformed_distribution.TransformedDistribution):
|
||||||
the RelaxedBernoulli can suffer from underflow issues. In many case loss
|
the RelaxedBernoulli can suffer from underflow issues. In many case loss
|
||||||
functions such as these are invariant under invertible transformations of
|
functions such as these are invariant under invertible transformations of
|
||||||
the random variables. The KL divergence, found in the variational autoencoder
|
the random variables. The KL divergence, found in the variational autoencoder
|
||||||
loss, is an example. Because RelaxedBernoullis are sampled by by a Logistic
|
loss, is an example. Because RelaxedBernoullis are sampled by a Logistic
|
||||||
random variable followed by a `tf.sigmoid` op, one solution is to treat
|
random variable followed by a `tf.sigmoid` op, one solution is to treat
|
||||||
the Logistic as the random variable and `tf.sigmoid` as downstream. The
|
the Logistic as the random variable and `tf.sigmoid` as downstream. The
|
||||||
KL divergences of two Logistics, which are always followed by a `tf.sigmoid`
|
KL divergences of two Logistics, which are always followed by a `tf.sigmoid`
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ def percentile(x,
|
||||||
"""Compute the `q`-th percentile of `x`.
|
"""Compute the `q`-th percentile of `x`.
|
||||||
|
|
||||||
Given a vector `x`, the `q`-th percentile of `x` is the value `q / 100` of the
|
Given a vector `x`, the `q`-th percentile of `x` is the value `q / 100` of the
|
||||||
way from the minimum to the maximum in in a sorted copy of `x`.
|
way from the minimum to the maximum in a sorted copy of `x`.
|
||||||
|
|
||||||
The values and distances of the two nearest neighbors as well as the
|
The values and distances of the two nearest neighbors as well as the
|
||||||
`interpolation` parameter will determine the percentile if the normalized
|
`interpolation` parameter will determine the percentile if the normalized
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,7 @@ class Transformer(object):
|
||||||
# TODO(fkp): return a subgraph?
|
# TODO(fkp): return a subgraph?
|
||||||
op_, op_outputs_ = self.transform_op_handler(info, op)
|
op_, op_outputs_ = self.transform_op_handler(info, op)
|
||||||
if op is op_:
|
if op is op_:
|
||||||
raise ValueError("In-place tranformation not allowed.")
|
raise ValueError("In-place transformation not allowed.")
|
||||||
|
|
||||||
# Process op.
|
# Process op.
|
||||||
info.transformed_ops[op] = op_
|
info.transformed_ops[op] = op_
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ def checkpoints_iterator(checkpoint_dir,
|
||||||
|
|
||||||
This behavior gives control to callers on what to do if checkpoints do not
|
This behavior gives control to callers on what to do if checkpoints do not
|
||||||
come fast enough or stop being generated. For example, if callers have a way
|
come fast enough or stop being generated. For example, if callers have a way
|
||||||
to detect that the training has stopped and know that no new new checkpoints
|
to detect that the training has stopped and know that no new checkpoints
|
||||||
will be generated, they can provide a `timeout_fn` that returns `True` when
|
will be generated, they can provide a `timeout_fn` that returns `True` when
|
||||||
the training has stopped. If they know that the training is still going on
|
the training has stopped. If they know that the training is still going on
|
||||||
they return `False` instead.
|
they return `False` instead.
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,7 @@ class optional : private internal_optional::optional_data<T>,
|
||||||
constexpr const T& reference() const { return *this->pointer(); }
|
constexpr const T& reference() const { return *this->pointer(); }
|
||||||
T& reference() { return *(this->pointer()); }
|
T& reference() { return *(this->pointer()); }
|
||||||
|
|
||||||
// T constaint checks. You can't have an optional of nullopt_t, in_place_t or
|
// T constraint checks. You can't have an optional of nullopt_t, in_place_t or
|
||||||
// a reference.
|
// a reference.
|
||||||
static_assert(
|
static_assert(
|
||||||
!std::is_same<nullopt_t, typename std::remove_cv<T>::type>::value,
|
!std::is_same<nullopt_t, typename std::remove_cv<T>::type>::value,
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ of samples in the batch and `d1` ... `dN` are the remaining dimensions.
|
||||||
It is common, when training with multiple loss functions, to adjust the relative
|
It is common, when training with multiple loss functions, to adjust the relative
|
||||||
strengths of individual losses. This is performed by rescaling the losses via
|
strengths of individual losses. This is performed by rescaling the losses via
|
||||||
a `weight` parameter passed to the loss functions. For example, if we were
|
a `weight` parameter passed to the loss functions. For example, if we were
|
||||||
training with both log_loss and mean_square_error, and we wished that the
|
training with both log_loss and mean_squared_error, and we wished that the
|
||||||
log_loss penalty be twice as severe as the mean_square_error, we would
|
log_loss penalty be twice as severe as the mean_squared_error, we would
|
||||||
implement this as:
|
implement this as:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
|
@ -22,7 +22,7 @@ implement this as:
|
||||||
tf.contrib.losses.log(predictions, labels, weight=2.0)
|
tf.contrib.losses.log(predictions, labels, weight=2.0)
|
||||||
|
|
||||||
# Uses default weight of 1.0
|
# Uses default weight of 1.0
|
||||||
tf.contrib.losses.mean_square_error(predictions, labels)
|
tf.contrib.losses.mean_squared_error(predictions, labels)
|
||||||
|
|
||||||
# All the losses are collected into the `GraphKeys.LOSSES` collection.
|
# All the losses are collected into the `GraphKeys.LOSSES` collection.
|
||||||
losses = tf.get_collection(tf.GraphKeys.LOSSES)
|
losses = tf.get_collection(tf.GraphKeys.LOSSES)
|
||||||
|
|
@ -74,7 +74,7 @@ these predictions.
|
||||||
predictions = MyModelPredictions(images)
|
predictions = MyModelPredictions(images)
|
||||||
|
|
||||||
weight = tf.cast(tf.greater(depths, 0), tf.float32)
|
weight = tf.cast(tf.greater(depths, 0), tf.float32)
|
||||||
loss = tf.contrib.losses.mean_square_error(predictions, depths, weight)
|
loss = tf.contrib.losses.mean_squared_error(predictions, depths, weight)
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that when using weights for the losses, the final average is computed
|
Note that when using weights for the losses, the final average is computed
|
||||||
|
|
@ -100,7 +100,7 @@ weighted average over the individual prediction errors:
|
||||||
|
|
||||||
weight = MyComplicatedWeightingFunction(labels)
|
weight = MyComplicatedWeightingFunction(labels)
|
||||||
weight = tf.div(weight, tf.size(weight))
|
weight = tf.div(weight, tf.size(weight))
|
||||||
loss = tf.contrib.losses.mean_square_error(predictions, depths, weight)
|
loss = tf.contrib.losses.mean_squared_error(predictions, depths, weight)
|
||||||
```
|
```
|
||||||
|
|
||||||
@{tf.contrib.losses.absolute_difference}
|
@{tf.contrib.losses.absolute_difference}
|
||||||
|
|
|
||||||
|
|
@ -1312,7 +1312,7 @@ class DebugAnalyzer(object):
|
||||||
all_inputs = copy.copy(tracker(node_name, is_control=False))
|
all_inputs = copy.copy(tracker(node_name, is_control=False))
|
||||||
is_ctrl = [False] * len(all_inputs)
|
is_ctrl = [False] * len(all_inputs)
|
||||||
if include_control:
|
if include_control:
|
||||||
# Sort control inputs or recipients in in alphabetical order of the node
|
# Sort control inputs or recipients in alphabetical order of the node
|
||||||
# names.
|
# names.
|
||||||
ctrl_inputs = sorted(tracker(node_name, is_control=True))
|
ctrl_inputs = sorted(tracker(node_name, is_control=True))
|
||||||
all_inputs.extend(ctrl_inputs)
|
all_inputs.extend(ctrl_inputs)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user