tf.contrib.seq2seq.TrainingHelper
Stay organized with collections
Save and categorize content based on your preferences.
A helper for use during training. Only reads inputs.
Inherits From: Helper
tf.contrib.seq2seq.TrainingHelper(
inputs, sequence_length, time_major=False, name=None
)
Returned sample_ids are the argmax of the RNN output logits.
Args |
inputs
|
A (structure of) input tensors.
|
sequence_length
|
An int32 vector tensor.
|
time_major
|
Python bool. Whether the tensors in inputs are time major.
If False (default), they are assumed to be batch major.
|
name
|
Name scope for any created operations.
|
Raises |
ValueError
|
if sequence_length is not a 1D tensor.
|
Attributes |
batch_size
|
Batch size of tensor returned by sample .
Returns a scalar int32 tensor.
|
inputs
|
|
sample_ids_dtype
|
DType of tensor returned by sample .
Returns a DType.
|
sample_ids_shape
|
Shape of tensor returned by sample , excluding the batch dimension.
Returns a TensorShape .
|
sequence_length
|
|
Methods
initialize
View source
initialize(
name=None
)
Returns (initial_finished, initial_inputs)
.
View source
next_inputs(
time, outputs, state, name=None, **unused_kwargs
)
next_inputs_fn for TrainingHelper.
sample
View source
sample(
time, outputs, name=None, **unused_kwargs
)
Returns sample_ids
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.seq2seq.TrainingHelper\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/seq2seq/python/ops/helper.py#L227-L312) |\n\nA helper for use during training. Only reads inputs.\n\nInherits From: [`Helper`](../../../tf/contrib/seq2seq/Helper) \n\n tf.contrib.seq2seq.TrainingHelper(\n inputs, sequence_length, time_major=False, name=None\n )\n\nReturned sample_ids are the argmax of the RNN output logits.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------------|------------------------------------------------------------------------------------------------------------------------|\n| `inputs` | A (structure of) input tensors. |\n| `sequence_length` | An int32 vector tensor. |\n| `time_major` | Python bool. Whether the tensors in `inputs` are time major. If `False` (default), they are assumed to be batch major. |\n| `name` | Name scope for any created operations. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|------------------------------------------|\n| `ValueError` | if `sequence_length` is not a 1D tensor. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|--------------------|------------------------------------------------------------------------------------------------------|\n| `batch_size` | Batch size of tensor returned by `sample`. \u003cbr /\u003e Returns a scalar int32 tensor. |\n| `inputs` | \u003cbr /\u003e \u003cbr /\u003e |\n| `sample_ids_dtype` | DType of tensor returned by `sample`. \u003cbr /\u003e Returns a DType. |\n| `sample_ids_shape` | Shape of tensor returned by `sample`, excluding the batch dimension. \u003cbr /\u003e Returns a `TensorShape`. |\n| `sequence_length` | \u003cbr /\u003e \u003cbr /\u003e |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `initialize`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/seq2seq/python/ops/helper.py#L285-L292) \n\n initialize(\n name=None\n )\n\nReturns `(initial_finished, initial_inputs)`.\n\n### `next_inputs`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/seq2seq/python/ops/helper.py#L300-L312) \n\n next_inputs(\n time, outputs, state, name=None, **unused_kwargs\n )\n\nnext_inputs_fn for TrainingHelper.\n\n### `sample`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/seq2seq/python/ops/helper.py#L294-L298) \n\n sample(\n time, outputs, name=None, **unused_kwargs\n )\n\nReturns `sample_ids`."]]