Home
last modified time | relevance | path

Searched refs:embeddings (Results 1 – 25 of 53) sorted by relevance

123

/external/libtextclassifier/annotator/
Dquantization_test.cc41 std::vector<uint8> embeddings{{/*0: */ 0x00, 0xFF, 0x09, 0x00, in TEST() local
51 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
69 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
93 std::vector<uint8> embeddings(bytes_per_embedding * num_buckets); in TEST() local
95 std::fill(embeddings.begin(), embeddings.end(), 0); in TEST()
98 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
116 std::vector<uint8> embeddings(bytes_per_embedding * num_buckets, 0xFF); in TEST() local
119 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
137 std::vector<uint8> embeddings(bytes_per_embedding * num_buckets, 0); in TEST() local
139 embeddings[4] = (1 << 7) | (1 << 6) | (1 << 4) | 1; in TEST()
[all …]
Dquantization.cc28 void DequantizeAdd8bit(const float* scales, const uint8* embeddings, in DequantizeAdd8bit() argument
36 embeddings[bucket_id * bytes_per_embedding + k]); in DequantizeAdd8bit()
40 void DequantizeAddNBit(const float* scales, const uint8* embeddings, in DequantizeAddNBit() argument
50 uint16 data = embeddings[bucket_id * bytes_per_embedding + read16_offset]; in DequantizeAddNBit()
54 data |= embeddings[bucket_id * bytes_per_embedding + read16_offset + 1] in DequantizeAddNBit()
73 bool DequantizeAdd(const float* scales, const uint8* embeddings, in DequantizeAdd() argument
78 DequantizeAdd8bit(scales, embeddings, bytes_per_embedding, in DequantizeAdd()
81 DequantizeAddNBit(scales, embeddings, bytes_per_embedding, in DequantizeAdd()
Dmodel-executor.cc66 const TfLiteTensor* embeddings = interpreter->tensor(0); in FromBuffer() local
67 if (embeddings->dims->size != 2) { in FromBuffer()
70 int num_buckets = embeddings->dims->data[0]; in FromBuffer()
76 int bytes_per_embedding = embeddings->dims->data[1]; in FromBuffer()
85 embedding_size, scales, embeddings, std::move(interpreter), in FromBuffer()
92 const TfLiteTensor* scales, const TfLiteTensor* embeddings, in TFLiteEmbeddingExecutor() argument
101 embeddings_(embeddings), in TFLiteEmbeddingExecutor()
Dquantization.h32 bool DequantizeAdd(const float* scales, const uint8* embeddings,
/external/tensorflow/tensorflow/python/ops/
Dembedding_ops.py485 embeddings = embedding_lookup(
487 if embeddings.dtype in (dtypes.float16, dtypes.bfloat16):
488 embeddings = math_ops.cast(embeddings, dtypes.float32)
491 if weights.dtype != embeddings.dtype:
492 weights = math_ops.cast(weights, embeddings.dtype)
494 embeddings = array_ops.gather(embeddings, idx)
498 array_ops.expand_dims(array_ops.rank(embeddings) - 1, 0), 1)
507 if embeddings.get_shape().ndims is not None:
510 [1 for _ in range(embeddings.get_shape().ndims - 1)]))
512 embeddings *= weights
[all …]
/external/libtextclassifier/actions/
Dactions-suggestions_test.cc1094 std::vector<float> embeddings; in TEST_F() local
1097 EXPECT_TRUE(embedder.EmbedTokensPerMessage(tokens, &embeddings, in TEST_F()
1101 EXPECT_EQ(embeddings.size(), 3); in TEST_F()
1102 EXPECT_THAT(embeddings[0], in TEST_F()
1105 EXPECT_THAT(embeddings[1], in TEST_F()
1108 EXPECT_THAT(embeddings[2], in TEST_F()
1118 std::vector<float> embeddings; in TEST_F() local
1121 EXPECT_TRUE(embedder.EmbedTokensPerMessage(tokens, &embeddings, in TEST_F()
1125 EXPECT_EQ(embeddings.size(), 5); in TEST_F()
1126 EXPECT_THAT(embeddings[0], in TEST_F()
[all …]
Dactions-suggestions.cc602 std::vector<float>* embeddings, int* max_num_tokens_per_message) const { in EmbedTokensPerMessage() argument
633 tokens[i][pos], embedding_executor_.get(), embeddings)) { in EmbedTokensPerMessage()
640 embeddings->insert(embeddings->end(), embedded_padding_token_.begin(), in EmbedTokensPerMessage()
650 std::vector<float>* embeddings, int* total_token_count) const { in EmbedAndFlattenTokens() argument
681 embeddings->insert(embeddings->end(), embedded_start_token_.begin(), in EmbedAndFlattenTokens()
689 tokens[i][pos], embedding_executor_.get(), embeddings)) { in EmbedAndFlattenTokens()
697 embeddings->insert(embeddings->end(), embedded_end_token_.begin(), in EmbedAndFlattenTokens()
708 embeddings->insert(embeddings->end(), embedded_padding_token_.begin(), in EmbedAndFlattenTokens()
Dactions-suggestions.h131 std::vector<float>* embeddings,
142 std::vector<float>* embeddings,
/external/tensorflow/tensorflow/contrib/layers/python/layers/
Dencoders.py72 embeddings = variables.model_variable(
82 [embeddings], sparse_ids, combiner='mean', default_id=0)
87 embedding_ops.embedding_lookup(embeddings, ids), axis=1)
135 embeddings = variables.model_variable(
140 return contrib_embedding_ops.embedding_lookup_unique(embeddings, ids)
141 return embedding_ops.embedding_lookup(embeddings, ids)
Dembedding_ops.py444 embeddings = scattered_embedding_lookup(
448 embeddings = math_ops.sparse_segment_sum(embeddings, idx, segment_ids,
451 embeddings = math_ops.sparse_segment_mean(embeddings, idx, segment_ids,
454 embeddings = math_ops.sparse_segment_sqrt_n(embeddings, idx, segment_ids,
459 return embeddings
564 embeddings = _sampled_scattered_embedding_lookup(
573 embeddings = math_ops.multiply(signs, embeddings, name="signs_hash")
579 return math_ops.unsorted_segment_sum(embeddings, segment_ids,
671 embeddings = _embedding_lookup_with_distributed_aggregation(
682 if weights.dtype != embeddings.dtype:
[all …]
Dfeature_column.py1223 embeddings = contrib_variables.model_variable(
1232 embeddings,
1252 embeddings = shared_embedding_collection[0]
1253 if embeddings.get_shape() != shape:
1261 embeddings = contrib_variables.model_variable(
1268 graph.add_to_collection(shared_embedding_collection_name, embeddings)
1270 embeddings = contrib_variables.model_variable(
1278 if _is_variable(embeddings):
1279 embeddings = [embeddings]
1281 embeddings = embeddings._get_variable_list() # pylint: disable=protected-access
[all …]
/external/tensorflow/tensorflow/contrib/learn/python/learn/ops/
Dops_test.py65 embeddings = ops.categorical_variable(
68 emb1 = sess.run(embeddings,
70 emb2 = sess.run(embeddings,
Dembeddings_ops.py90 embeddings = vs.get_variable(name + '_embeddings',
92 return embedding_lookup(embeddings, tensor_in)
/external/tensorflow/tensorflow/examples/tutorials/word2vec/
Dword2vec_basic.py174 embeddings = tf.Variable(
176 embed = tf.nn.embedding_lookup(embeddings, train_inputs)
210 norm = tf.sqrt(tf.reduce_sum(tf.square(embeddings), 1, keepdims=True))
211 normalized_embeddings = embeddings / norm
295 embedding_conf = config.embeddings.add()
296 embedding_conf.tensor_name = embeddings.name
/external/tensorflow/tensorflow/contrib/losses/python/metric_learning/
Dmetric_loss_ops_test.py140 embeddings=ops.convert_to_tensor(embedding),
193 embeddings=ops.convert_to_tensor(embedding),
532 embeddings, labels = self._genClusters(n_samples=128, n_clusters=64)
535 embeddings, labels, margin_multiplier, enable_pam_finetuning=False)
538 embeddings=ops.convert_to_tensor(embeddings),
549 embeddings, labels = self._genClusters(n_samples=128, n_clusters=64)
552 embeddings, labels, margin_multiplier, enable_pam_finetuning=True)
555 embeddings=ops.convert_to_tensor(embeddings),
Dmetric_loss_ops.py160 def triplet_semihard_loss(labels, embeddings, margin=1.0): argument
186 pdist_matrix = pairwise_distance(embeddings, squared=True)
411 def lifted_struct_loss(labels, embeddings, margin=1.0): argument
436 pairwise_distances = pairwise_distance(embeddings)
954 embeddings, argument
989 pairwise_distances = pairwise_distance(embeddings)
991 all_ids = math_ops.range(array_ops.shape(embeddings)[0])
/external/tensorflow/tensorflow/examples/saved_model/integration_tests/
Dexport_simple_text_embedding.py64 self.embeddings = tf.Variable(
66 self.variables = [self.embeddings]
90 embedding_weights=self.embeddings,
/external/tensorflow/tensorflow/python/keras/layers/
Dembeddings.py129 self.embeddings = self.add_weight(
136 self.embeddings = self.add_weight(
178 out = embedding_ops.embedding_lookup(self.embeddings, inputs)
/external/icu/icu4j/eclipse-build/plugins.template/com.ibm.icu.base/src/com/ibm/icu/text/
DBidi.java2254 byte[] embeddings, in Bidi() argument
2261 this(new java.text.Bidi(text, textStart, embeddings, embStart, paragraphLength, flags)); in Bidi()
/external/tensorflow/tensorflow/contrib/seq2seq/python/kernel_tests/
Dbasic_decoder_test.py137 embeddings = np.random.randn(vocabulary_size,
140 helper = helper_py.GreedyEmbeddingHelper(embeddings, start_tokens,
189 expected_step_next_inputs = embeddings[expected_sample_ids]
213 embeddings = np.random.randn(vocabulary_size,
216 helper = helper_py.SampleEmbeddingHelper(embeddings, start_tokens,
265 expected_step_next_inputs = embeddings[sample_ids]
281 embeddings = np.random.randn(
288 embedding=embeddings,
352 embeddings[sample_ids[batch_where_sampling]])
Dbasic_decoder_v2_test.py139 embeddings = np.random.randn(vocabulary_size,
141 embeddings_t = constant_op.constant(embeddings)
195 expected_step_next_inputs = embeddings[expected_sample_ids]
216 embeddings = np.random.randn(vocabulary_size,
218 embeddings_t = constant_op.constant(embeddings)
271 expected_step_next_inputs = embeddings[sample_ids]
288 embeddings = np.random.randn(
301 input_t, sequence_length=sequence_length, embedding=embeddings,
358 embeddings[sample_ids[batch_where_sampling]])
/external/tensorflow/tensorflow/contrib/nn/python/ops/
Dsampling_ops.py87 def logsumexp_logit(embeddings): argument
89 math_ops.matmul(embeddings, reweighted_inputs, transpose_b=True),
/external/libtextclassifier/lang_id/common/flatbuffers/
Dembedding-network-params-from-flatbuffer.cc211 Matrix embeddings = GetEmbeddingMatrix(i); in ValidityChecking() local
212 if (!VerifyMatrix(embeddings, bytes)) { in ValidityChecking()
216 input_size += embedding_num_features(i) * embeddings.cols; in ValidityChecking()
/external/tensorflow/tensorflow/contrib/tensorboard/plugins/projector/
Dprojector_api_test.py39 emb1 = config.embeddings.add()
/external/tensorflow/tensorflow/python/kernel_tests/
Dembedding_ops_test.py270 embeddings = constant_op.constant([[2.0]])
274 [embeddings], ids, max_norm=1.0)
281 embeddings = constant_op.constant([[2.0, 4.0], [3.0, 1.0]])
285 [embeddings], ids, max_norm=2.0)
288 math_ops.reduce_sum(embeddings * embeddings, axis=1))
289 normalized = embeddings / array_ops.stack([norms, norms], axis=1)

123