Type NextQueuedSequenceBatch
Namespace tensorflow.contrib.training
Parent PythonObjectContainer
Interfaces INextQueuedSequenceBatch
NextQueuedSequenceBatch stores deferred SequenceQueueingStateSaver data. This class is instantiated by `SequenceQueueingStateSaver` and is accessible
via its `next_batch` property.
Methods
Properties
Public instance methods
object save_state(string state_name, IGraphNodeBase value, string name)
Returns an op to save the current batch of state `state_name`.
Parameters
-
string
state_name - string, matches a key provided in `initial_states`.
-
IGraphNodeBase
value - A `Tensor`. Its type must match that of `initial_states[state_name].dtype`. If we had at input: ```python initial_states[state_name].get_shape() == [d1, d2,...] ``` then the shape of `value` must match: ```python tf.shape(value) == [batch_size, d1, d2,...] ```
-
string
name - string (optional). The name scope for newly created ops.
Returns
-
object
- A control flow op that stores the new state of each entry into the state saver. This op must be run for every iteration that accesses data from the state saver (otherwise the state saver will never progress through its states and run out of capacity).
object save_state_dyn(object state_name, object value, object name)
Returns an op to save the current batch of state `state_name`.
Parameters
-
object
state_name - string, matches a key provided in `initial_states`.
-
object
value - A `Tensor`. Its type must match that of `initial_states[state_name].dtype`. If we had at input: ```python initial_states[state_name].get_shape() == [d1, d2,...] ``` then the shape of `value` must match: ```python tf.shape(value) == [batch_size, d1, d2,...] ```
-
object
name - string (optional). The name scope for newly created ops.
Returns
-
object
- A control flow op that stores the new state of each entry into the state saver. This op must be run for every iteration that accesses data from the state saver (otherwise the state saver will never progress through its states and run out of capacity).
object state(string state_name)
Returns batched state tensors.
Parameters
-
string
state_name - string, matches a key provided in `initial_states`.
Returns
-
object
- A `Tensor`: a batched set of states, either initial states (if this is the first run of the given example), or a value as stored during a previous iteration via `save_state` control flow. Its type is the same as `initial_states["state_name"].dtype`. If we had at input: ```python initial_states[state_name].get_shape() == [d1, d2,...], ``` then ```python state(state_name).get_shape() == [batch_size, d1, d2,...] ```
object state_dyn(object state_name)
Returns batched state tensors.
Parameters
-
object
state_name - string, matches a key provided in `initial_states`.
Returns
-
object
- A `Tensor`: a batched set of states, either initial states (if this is the first run of the given example), or a value as stored during a previous iteration via `save_state` control flow. Its type is the same as `initial_states["state_name"].dtype`. If we had at input: ```python initial_states[state_name].get_shape() == [d1, d2,...], ``` then ```python state(state_name).get_shape() == [batch_size, d1, d2,...] ```
Public properties
Tensor batch_size get;
The batch_size of the given batch. Usually, this is the batch_size requested when initializing the SQSS, but
if allow_small_batch=True this will become smaller when inputs are
exhausted.
object batch_size_dyn get;
The batch_size of the given batch. Usually, this is the batch_size requested when initializing the SQSS, but
if allow_small_batch=True this will become smaller when inputs are
exhausted.
PythonClassContainer context get;
A dict mapping keys of `input_context` to batched context.
object context_dyn get;
A dict mapping keys of `input_context` to batched context.
object insertion_index get;
The insertion indices of the examples (when they were first added). These indices start with the value -2**63 and increase with every
call to the prefetch op. Each whole example gets its own insertion
index, and this is used to prioritize the example so that its truncated
segments appear in adjacent iterations, even if new examples are inserted
by the prefetch op between iterations.
object insertion_index_dyn get;
The insertion indices of the examples (when they were first added). These indices start with the value -2**63 and increase with every
call to the prefetch op. Each whole example gets its own insertion
index, and this is used to prioritize the example so that its truncated
segments appear in adjacent iterations, even if new examples are inserted
by the prefetch op between iterations.
object key get;
The key names of the given truncated unrolled examples. The format of the key is:
where `original_key` is the unique key read in by the prefetcher.
Show Example
"%05d_of_%05d:%s" % (sequence, sequence_count, original_key)
object key_dyn get;
The key names of the given truncated unrolled examples. The format of the key is:
where `original_key` is the unique key read in by the prefetcher.
Show Example
"%05d_of_%05d:%s" % (sequence, sequence_count, original_key)
object length get;
The lengths of the given truncated unrolled examples. For initial iterations, for which `sequence * num_unroll < length`,
this number is `num_unroll`. For the remainder,
this number is between `0` and `num_unroll`.
object length_dyn get;
The lengths of the given truncated unrolled examples. For initial iterations, for which `sequence * num_unroll < length`,
this number is `num_unroll`. For the remainder,
this number is between `0` and `num_unroll`.
object next_key get;
The key names of the next (in iteration) truncated unrolled examples. The format of the key is:
if `sequence + 1 < sequence_count`, otherwise:
where `original_key` is the unique key read in by the prefetcher.
Show Example
"%05d_of_%05d:%s" % (sequence + 1, sequence_count, original_key)
object next_key_dyn get;
The key names of the next (in iteration) truncated unrolled examples. The format of the key is:
if `sequence + 1 < sequence_count`, otherwise:
where `original_key` is the unique key read in by the prefetcher.
Show Example
"%05d_of_%05d:%s" % (sequence + 1, sequence_count, original_key)
object PythonObject get;
object sequence get;
An int32 vector, length `batch_size`: the sequence index of each entry. When an input is split up, the sequence values
```
0, 1,..., sequence_count - 1
```
are assigned to each split.
object sequence_count get;
An int32 vector, length `batch_size`: the sequence count of each entry. When an input is split up, the number of splits is equal to:
`padded_length / num_unroll`. This is the sequence_count.
object sequence_count_dyn get;
An int32 vector, length `batch_size`: the sequence count of each entry. When an input is split up, the number of splits is equal to:
`padded_length / num_unroll`. This is the sequence_count.
object sequence_dyn get;
An int32 vector, length `batch_size`: the sequence index of each entry. When an input is split up, the sequence values
```
0, 1,..., sequence_count - 1
```
are assigned to each split.
PythonClassContainer sequences get;
A dict mapping keys of `input_sequences` to split and rebatched data.
object sequences_dyn get;
A dict mapping keys of `input_sequences` to split and rebatched data.
object total_length get;
The lengths of the original (non-truncated) unrolled examples.
object total_length_dyn get;
The lengths of the original (non-truncated) unrolled examples.