tensorflow-ops-0.1.0.0: Friendly layer around TensorFlow bindings.

Safe HaskellNone
LanguageHaskell2010

TensorFlow.EmbeddingOps

Description

Parallel lookups on the list of tensors.

Synopsis

Documentation

embeddingLookup Source

Arguments

:: (TensorType a, OneOf `[Int64, Int32]` b, Num b) 
=> [Tensor v a]

A list of tensors which can be concatenated along dimension 0. Each Tensor must be appropriately sized for mod partition strategy.

-> Tensor Value b

A Tensor with type int32 or int64 containing the ids to be looked up in params. The ids are required to be flat on entry and have fewer than 2^31 entries.

-> Build (Tensor Value a)

A dense tensor with shape `shape(ids) + shape(params)[1:]`.

Looks up ids in a list of embedding tensors.

This function is used to perform parallel lookups on the list of tensors in params. It is a generalization of gather, where params is interpreted as a partition of a larger embedding tensor.

The partition_strategy is "mod", we assign each id to partition `p = id % len(params)`. For instance, 13 ids are split across 5 partitions as: `[[0, 5, 10], [1, 6, 11], [2, 7, 12], [3, 8], [4, 9]]`

The results of the lookup are concatenated into a dense tensor. The returned tensor has shape `shape(ids) + shape(params)[1:]`.