MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / UpdateSparseDeltaWeights

Method UpdateSparseDeltaWeights

tensorflow/core/kernels/sdca_internal.cc:64–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void FeatureWeightsSparseStorage::UpdateSparseDeltaWeights(
65 const Eigen::ThreadPoolDevice& device,
66 const Example::SparseFeatures& sparse_features,
67 const std::vector<double>& normalized_bounded_dual_delta) {
68 for (int64 k = 0; k < sparse_features.indices->size(); ++k) {
69 const double feature_value =
70 sparse_features.values == nullptr ? 1.0 : (*sparse_features.values)(k);
71 auto it = indices_to_id_.find((*sparse_features.indices)(k));
72 for (size_t l = 0; l < normalized_bounded_dual_delta.size(); ++l) {
73 deltas_(l, it->second) +=
74 feature_value * normalized_bounded_dual_delta[l];
75 }
76 }
77}
78
79void ModelWeights::UpdateDeltaWeights(
80 const Eigen::ThreadPoolDevice& device, const Example& example,

Callers 1

UpdateDeltaWeightsMethod · 0.80

Calls 2

sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected