aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/linear_optimizer/ops/sdca_ops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/linear_optimizer/ops/sdca_ops.cc')
-rw-r--r--tensorflow/contrib/linear_optimizer/ops/sdca_ops.cc36
1 files changed, 13 insertions, 23 deletions
diff --git a/tensorflow/contrib/linear_optimizer/ops/sdca_ops.cc b/tensorflow/contrib/linear_optimizer/ops/sdca_ops.cc
index ff2bae8fea..7c0e27d19d 100644
--- a/tensorflow/contrib/linear_optimizer/ops/sdca_ops.cc
+++ b/tensorflow/contrib/linear_optimizer/ops/sdca_ops.cc
@@ -24,7 +24,7 @@ REGISTER_OP("SdcaSolver")
.Attr("num_dense_features: int >= 0")
.Attr("l1: float >= 0")
.Attr("l2: float >= 1")
- .Attr("num_inner_iterations: int >= 2")
+ .Attr("num_inner_iterations: int >= 1")
.Attr("container: string")
.Attr("solver_uuid: string")
.Input("sparse_features_indices: num_sparse_features * int64")
@@ -69,7 +69,7 @@ example_labels: a vector which contains the label/target associated with each
example_ids: a vector which contains the unique identifier associated with each
example.
sparse_weights: a list of vectors where each value is the weight associated with
- a feature index.
+ a feature group.
dense_weights: a list of vectors where the value is the weight associated with
a dense feature group.
)doc");
@@ -89,38 +89,28 @@ num_dense_features: Number of dense feature groups to train on.
l1: Symmetric l1 regularization strength.
l2: Symmetric l2 regularization strength.
sparse_weights: a list of vectors where each value is the weight associated with
- a feature index.
+ a feature group.
dense_weights: a list of vectors where the value is the weight associated with
a dense feature group.
)doc");
-// TODO(katsiapis): We should expand this scope of this op to compute other
-// statistics about the data.
-REGISTER_OP("ComputeDualityGap")
- .Attr("num_sparse_features: int >= 0")
- .Attr("num_dense_features: int >= 0")
- .Attr("l1: float >= 0")
- .Attr("l2: float >= 1")
+REGISTER_OP("SdcaTrainingStats")
.Attr("container: string")
.Attr("solver_uuid: string")
- .Input("sparse_weights: Ref(num_sparse_features * float)")
- .Input("dense_weights: Ref(num_dense_features * float)")
- .Output("duality_gap: float")
+ .Output("primal_loss: float64")
+ .Output("dual_loss: float64")
+ .Output("example_weights: float64")
.Doc(R"doc(
-Computes duality gap over all examples seen by the optimizer.
+Computes statistics over all examples seen by the optimizer.
-num_sparse_features: Number of sparse feature groups to train on.
-num_dense_features: Number of dense feature groups to train on.
-l1: Symmetric l1 regularization strength.
-l2: Symmetric l2 regularization strength.
container: Name of the Container that stores data across invocations of this
Kernel. Together with SolverUUID form an isolation unit for this solver.
solver_uuid: Universally Unique Identifier for this solver.
-sparse_weights: a list of vectors where each value is the weight associated with
- a feature index.
-dense_weights: a list of vectors where the value is the weight associated with
- a dense feature group.
-duality_gap: duality gap over all examples seen by the optimizer.
+primal_loss: total primal loss of all examples seen by the optimizer.
+dual_loss: total dual loss of all examples seen by the optimizer.
+example_weights: total example weights of all examples seen by the optimizer
+ (guaranteed to be positive; otherwise returns FAILED_PRECONDITION as it
+ probably indicates a bug in the training data).
)doc");
} // namespace tensorflow