contrib.seq2seq.CustomHelper

tf.contrib.seq2seq.CustomHelper

class tf.contrib.seq2seq.CustomHelper

Defined in tensorflow/contrib/seq2seq/python/ops/helper.py.

See the guide: Seq2seq Library (contrib) > Dynamic Decoding

Base abstract class that allows the user to customize sampling.

Properties

batch_size

Methods

__init__

__init__(
    initialize_fn,
    sample_fn,
    next_inputs_fn
)

Initializer.

Args:

  • initialize_fn: callable that returns (finished, next_inputs) for the first iteration.
  • sample_fn: callable that takes (time, outputs, state) and emits tensor sample_ids.
  • next_inputs_fn: callable that takes (time, outputs, state, sample_ids) and emits (finished, next_inputs, next_state).

initialize

initialize(name=None)

next_inputs

next_inputs(
    time,
    outputs,
    state,
    sample_ids,
    name=None
)

sample

sample(
    time,
    outputs,
    state,
    name=None
)

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/seq2seq/CustomHelper

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部