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 scalarTensor
, how large minibatches should be when accessing thestate()
method andcontext
,sequences
, etc, properties. -
num_unroll
: Python integer, how many time steps to unroll at a time. The input sequences of lengthk
are then split intok / num_unroll
many segments. -
input_length
: An int32 scalarTensor
, the length of the sequence prior to padding. This value may be at mostpadded_length
for any given input (see below for the definition ofpadded_length
). Batched and total lengths of the current iteration are made accessible via thelength
andtotal_length
properties. The shape of input_length (scalar) must be fully specified. -
input_key
: A string scalarTensor
, 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 thekey
property. The shape ofinput_key
(scalar) must be fully specified. -
input_sequences
: A dict mapping string names toTensor
values. The values must all have matching first dimension, calledpadded_length
. TheSequenceQueueingStateSaver
will split these tensors along this first dimension into minibatch elements of dimensionnum_unroll
. Batched and segmented sequences of the current iteration are made accessible via thesequences
property.Note:
padded_length
may be dynamic, and may vary from input to input, but must always be a multiple ofnum_unroll
. The remainder of the shape (other than the first dimension) must be fully specified. -
input_context
: A dict mapping string names toTensor
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 thecontext
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 thestate
andsave_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 leastbatch_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.
Please login to continue.