| 77 | } |
| 78 | |
| 79 | void ModelWeights::UpdateDeltaWeights( |
| 80 | const Eigen::ThreadPoolDevice& device, const Example& example, |
| 81 | const std::vector<double>& normalized_bounded_dual_delta) { |
| 82 | // Sparse weights. |
| 83 | for (size_t j = 0; j < sparse_weights_.size(); ++j) { |
| 84 | sparse_weights_[j].UpdateSparseDeltaWeights( |
| 85 | device, example.sparse_features_[j], normalized_bounded_dual_delta); |
| 86 | } |
| 87 | |
| 88 | // Dense weights. |
| 89 | for (size_t j = 0; j < dense_weights_.size(); ++j) { |
| 90 | dense_weights_[j].UpdateDenseDeltaWeights( |
| 91 | device, *example.dense_vectors_[j], normalized_bounded_dual_delta); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | Status ModelWeights::Initialize(OpKernelContext* const context) { |
| 96 | OpInputList sparse_indices_inputs; |
no test coverage detected