tf.contrib.training.SequenceQueueingStateSaver.__init__()

tf.contrib.training.SequenceQueueingStateSaver.__init__(batch_size, num_unroll, input_length, input_key, input_sequences, input_context, initial_states, capacity=None, allow_small_batch=False, name=None)

Creates the SequenceQueueingStateSaver.

Args:
  • batch_size: int or int32 scalar Tensor, how large minibatches should be when accessing the state() method and context, sequences, etc, properties.
  • num_unroll: Python integer, how many time steps to unroll at a time. The input sequences of length k are then split into k / num_unroll many segments.
  • input_length: An int32 scalar Tensor, the length of the sequence prior to padding. This value may be at most padded_length for any given input (see below for the definition of padded_length). Batched and total lengths of the current iteration are made accessible via the length and total_length properties. The shape of input_length (scalar) must be fully specified.
  • input_key: A string scalar Tensor, the unique key for the given input. This is used to keep track of the split minibatch elements of this input. Batched keys of the current iteration are made accessible via the key property. The shape of input_key (scalar) must be fully specified.
  • input_sequences: A dict mapping string names to Tensor values. The values must all have matching first dimension, called padded_length. The SequenceQueueingStateSaver will split these tensors along this first dimension into minibatch elements of dimension num_unroll. Batched and segmented sequences of the current iteration are made accessible via the sequences property.

    Note: padded_length may be dynamic, and may vary from input to input, but must always be a multiple of num_unroll. The remainder of the shape (other than the first dimension) must be fully specified.

  • input_context: A dict mapping string names to Tensor values. The values are treated as "global" across all time splits of the given input, and will be copied across for all minibatch elements accordingly. Batched and copied context of the current iteration are made accessible via the context property.

    Note: All input_context values must have fully defined shapes.

  • initial_states: A dict mapping string state names to multi-dimensional values (e.g. constants or tensors). This input defines the set of states that will be kept track of during computing iterations, and which can be accessed via the state and save_state methods.

    Note: All initial_state values must have fully defined shapes.

  • capacity: The max capacity of the SQSS in number of examples. Needs to be at least batch_size. Defaults to unbounded.

  • allow_small_batch: If true, the SQSS will return smaller batches when there aren't enough input examples to fill a whole batch and the end of the input has been reached (i.e., the underlying barrier has been closed).

  • name: An op name string (optional).

Raises:
  • TypeError: if any of the inputs is not an expected type.
  • ValueError: if any of the input values is inconsistent, e.g. if not enough shape information is available from inputs to build the state saver.
doc_TensorFlow
2016-10-14 13:07:32
Comments
Leave a Comment

Please login to continue.