Home
last modified time | relevance | path

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

12

/external/tensorflow/tensorflow/python/ops/
Dembedding_ops.py444 embeddings = embedding_lookup(
448 if weights.dtype != embeddings.dtype:
449 weights = math_ops.cast(weights, embeddings.dtype)
453 array_ops.expand_dims(array_ops.rank(embeddings) - 1, 0), 1)
462 if embeddings.get_shape().ndims is not None:
465 [1 for _ in range(embeddings.get_shape().ndims - 1)]))
467 embeddings *= weights
470 embeddings = math_ops.segment_sum(embeddings, segment_ids, name=name)
472 embeddings = math_ops.segment_sum(embeddings, segment_ids)
474 embeddings = math_ops.div(embeddings, weight_sum, name=name)
[all …]
/external/libtextclassifier/
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 Instance() local
67 if (embeddings->dims->size != 2) { in Instance()
70 int num_buckets = embeddings->dims->data[0]; in Instance()
76 int bytes_per_embedding = embeddings->dims->data[1]; in Instance()
85 embedding_size, scales, embeddings, std::move(interpreter))); in Instance()
91 const TfLiteTensor* scales, const TfLiteTensor* embeddings, in TFLiteEmbeddingExecutor() argument
99 embeddings_(embeddings), in TFLiteEmbeddingExecutor()
Dquantization.h32 bool DequantizeAdd(const float* scales, const uint8* 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),
136 embeddings = variables.model_variable(
141 return contrib_embedding_ops.embedding_lookup_unique(embeddings, ids)
142 return embedding_ops.embedding_lookup(embeddings, ids)
Dembedding_ops.py430 embeddings = scattered_embedding_lookup(
434 embeddings = math_ops.sparse_segment_sum(embeddings, idx, segment_ids,
437 embeddings = math_ops.sparse_segment_mean(embeddings, idx, segment_ids,
440 embeddings = math_ops.sparse_segment_sqrt_n(embeddings, idx, segment_ids,
445 return embeddings
546 embeddings = _sampled_scattered_embedding_lookup(
555 embeddings = math_ops.multiply(signs, embeddings, name="signs_hash")
561 return math_ops.unsorted_segment_sum(embeddings, segment_ids,
653 embeddings = _embedding_lookup_with_distributed_aggregation(
664 if weights.dtype != embeddings.dtype:
[all …]
Dfeature_column.py1219 embeddings = contrib_variables.model_variable(
1228 embeddings,
1248 embeddings = shared_embedding_collection[0]
1249 if embeddings.get_shape() != shape:
1257 embeddings = contrib_variables.model_variable(
1264 graph.add_to_collection(shared_embedding_collection_name, embeddings)
1266 embeddings = contrib_variables.model_variable(
1274 if _is_variable(embeddings):
1275 embeddings = [embeddings]
1277 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.py86 embeddings = vs.get_variable(name + '_embeddings',
88 return embedding_lookup(embeddings, tensor_in)
/external/tensorflow/tensorflow/examples/tutorials/word2vec/
Dword2vec_basic.py191 embeddings = tf.Variable( variable
193 embed = tf.nn.embedding_lookup(embeddings, train_inputs)
227 norm = tf.sqrt(tf.reduce_sum(tf.square(embeddings), 1, keep_dims=True))
228 normalized_embeddings = embeddings / norm
310 embedding_conf = config.embeddings.add()
311 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.py161 def triplet_semihard_loss(labels, embeddings, margin=1.0): argument
187 pdist_matrix = pairwise_distance(embeddings, squared=True)
412 def lifted_struct_loss(labels, embeddings, margin=1.0): argument
437 pairwise_distances = pairwise_distance(embeddings)
947 embeddings, argument
982 pairwise_distances = pairwise_distance(embeddings)
984 all_ids = math_ops.range(array_ops.shape(embeddings)[0])
/external/tensorflow/tensorflow/docs_src/programmers_guide/
Dembedding.md3 This document introduces the concept of embeddings, gives a simple example of
4 how to train an embedding in TensorFlow, and explains how to view embeddings
35 Embeddings are also valuable as outputs of machine learning. Because embeddings
39 neighbors. Using the same word embeddings as above, for instance, here are the
54 To create word embeddings in TensorFlow, we first split the text into words
70 in our example and contain the embeddings (dense vectors) for each of the 5
71 words. At the end of training, `word_embeddings` will contain the embeddings
84 interactively visualize embeddings. This tool can read embeddings from your
246 producing word embeddings (things). Common to both is the notion of embedding
250 **Are embeddings high-dimensional or low-dimensional?**
Dindex.md40 of embeddings, provides a simple example of training an embedding in
41 TensorFlow, and explains how to view embeddings with the TensorBoard
/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.py140 embeddings = np.random.randn(vocabulary_size,
143 helper = helper_py.GreedyEmbeddingHelper(embeddings, start_tokens,
192 expected_step_next_inputs = embeddings[expected_sample_ids]
216 embeddings = np.random.randn(vocabulary_size,
219 helper = helper_py.SampleEmbeddingHelper(embeddings, start_tokens,
268 expected_step_next_inputs = embeddings[sample_ids]
284 embeddings = np.random.randn(
291 embedding=embeddings,
355 embeddings[sample_ids[batch_where_sampling]])
/external/tensorflow/tensorflow/docs_src/tutorials/
Dword2vec.md6 embeddings".
31 But first, let's look at why we would want to learn word embeddings in the first
80 learning word embeddings from raw text. It comes in two flavors, the Continuous
165 [noise-contrastive estimation (NCE)](https://papers.nips.cc/paper/5165-learning-word-embeddings-eff…
180 [Levy et al.](https://levyomer.files.wordpress.com/2014/04/dependency-based-word-embeddings-acl-201…
218 embeddings by taking a small step in the direction of the gradient. When this
250 This is all about embeddings, so let's define our embedding matrix.
255 embeddings = tf.Variable(
262 embeddings`). So let's define that.
290 embed = tf.nn.embedding_lookup(embeddings, train_inputs)
[all …]
Dwide_and_deep.md126 appeared in the training data. Let's add a deep model with embeddings to fix
138 training loss. If you're interested in learning more about embeddings, check out
147 fixed representation, whereas embeddings are more flexible and calculated at
150 We'll configure the embeddings for the categorical columns using
179 Through dense embeddings, deep models can generalize better and make predictions
184 should be zero except a few, but dense embeddings will lead to nonzero
/external/tensorflow/tensorflow/python/keras/_impl/keras/layers/
Dembeddings.py116 self.embeddings = self.add_weight(
156 out = K.gather(self.embeddings, inputs)
D__init__.py30 from tensorflow.python.keras._impl.keras.layers.embeddings import *
Dserialization.py29 from tensorflow.python.keras._impl.keras.layers.embeddings import *
/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/tensorflow/tensorflow/python/kernel_tests/
Dembedding_ops_test.py260 embeddings = constant_op.constant([[2.0]])
264 [embeddings], ids, max_norm=1.0)
270 embeddings = constant_op.constant([[2.0, 4.0], [3.0, 1.0]])
274 [embeddings], ids, max_norm=2.0)
277 math_ops.reduce_sum(embeddings * embeddings, axis=1))
278 normalized = embeddings / array_ops.stack([norms, norms], axis=1)
/external/tensorflow/tensorflow/contrib/tensorboard/plugins/projector/
Dprojector_api_test.py39 emb1 = config.embeddings.add()

12