tf.contrib.learn.TensorFlowRNNRegressor.__init__()

tf.contrib.learn.TensorFlowRNNRegressor.__init__(rnn_size, cell_type='gru', num_layers=1, input_op_fn=null_input_op_fn, initial_state=None, bidirectional=False, sequence_length=None, attn_length=None, attn_size=None, attn_vec_size=None, n_classes=0, batch_size=32, steps=50, optimizer='Adagrad', learning_rate=0.1, clip_gradients=5.0, continue_training=False, config=None, verbose=1)

Initializes a TensorFlowRNNRegressor instance.

Args:
  • rnn_size: The size for rnn cell, e.g. size of your word embeddings.
  • cell_type: The type of rnn cell, including rnn, gru, and lstm.
  • num_layers: The number of layers of the rnn model.
  • input_op_fn: Function that will transform the input tensor, such as creating word embeddings, byte list, etc. This takes an argument x for input and returns transformed x.
  • bidirectional: boolean, Whether this is a bidirectional rnn.
  • sequence_length: If sequence_length is provided, dynamic calculation is performed. This saves computational time when unrolling past max sequence length.
  • attn_length: integer, the size of attention vector attached to rnn cells.
  • attn_size: integer, the size of an attention window attached to rnn cells.
  • attn_vec_size: integer, the number of convolutional features calculated on attention state and the size of the hidden layer built from base cell state.
  • initial_state: An initial state for the RNN. This must be a tensor of appropriate type and shape [batch_size x cell.state_size].
  • batch_size: Mini batch size.
  • steps: Number of steps to run over data.
  • optimizer: Optimizer name (or class), for example "SGD", "Adam", "Adagrad".
  • learning_rate: If this is constant float value, no decay function is used. Instead, a customized decay function can be passed that accepts global_step as parameter and returns a Tensor. e.g. exponential decay function:

    def exp_decay(global_step):
        return tf.train.exponential_decay(
            learning_rate=0.1, global_step,
            decay_steps=2, decay_rate=0.001)
    
  • continue_training: when continue_training is True, once initialized model will be continuely trained on every call of fit.

  • config: RunConfig object that controls the configurations of the session, e.g. num_cores, gpu_memory_fraction, etc.

  • verbose: Controls the verbosity, possible values:

    • 0: the algorithm and debug information is muted.
    • 1: trainer prints the progress.
    • 2: log device placement is printed.
doc_TensorFlow
2016-10-14 13:07:08
Comments
Leave a Comment

Please login to continue.