学習のコード

# Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0

tf.app.flags.DEFINE_float("learning_rate",0.5,"Learning rate.")tf.app.flags.DEFINE_float("learning_rate_decay_factor",0.99,"Learning rate decays by this much.")tf.app.flags.DEFINE_float("max_gradient_norm",5.0,"Clip gradients to this norm.")tf.app.flags.DEFINE_integer("batch_size",4,"Batch size to use during training.")tf.app.flags.DEFINE_integer("size",256,"Size of each model layer.")tf.app.flags.DEFINE_integer("num_layers",2,"Number of layers in the model.")tf.app.flags.DEFINE_integer("in_vocab_size",500,"input vocabulary size.")tf.app.flags.DEFINE_integer("out_vocab_size",500,"output vocabulary size.")tf.app.flags.DEFINE_string("data_dir","datas","Data directory")tf.app.flags.DEFINE_string("train_dir","datas","Training directory.")tf.app.flags.DEFINE_integer("max_train_data_size",0,"Limit on the size of training data (0: no limit).")tf.app.flags.DEFINE_integer("steps_per_checkpoint",100,"How many training steps to do per checkpoint.")tf.app.flags.DEFINE_boolean("decode",False,"Set to True for interactive decoding.")tf.app.flags.DEFINE_boolean("self_test",False,"Run a self-test if this is set to True.")