Missed TensorFlow World? Check out the recap. Learn more

tf.contrib.rnn.EmbeddingWrapper

View source on GitHub

Class EmbeddingWrapper

Operator adding input embedding to the given cell.

Inherits From: RNNCell

__init__

View source

__init__(
    cell,
    embedding_classes,
    embedding_size,
    initializer=None,
    reuse=None
)

Create a cell with an added input embedding.

Args:

  • cell: an RNNCell, an embedding will be put before its inputs.
  • embedding_classes: integer, how many symbols will be embedded.
  • embedding_size: integer, the size of the vectors we embed into.
  • initializer: an initializer to use when creating the embedding; if None, the initializer from variable scope or a default one is used.
  • reuse: (optional) Python boolean describing whether to reuse variables in an existing scope. If not True, and the existing scope already has the given variables, an error is raised.

Raises:

  • TypeError: if cell is not an RNNCell.
  • ValueError: if embedding_classes is not positive.

Properties

graph

DEPRECATED FUNCTION

output_size

scope_name

state_size

Methods

get_initial_state

View source

get_initial_state(
    inputs=None,
    batch_size=None,
    dtype=None
)

zero_state

View source

zero_state(
    batch_size,
    dtype
)