tf.estimator.WarmStartSettings函数
WarmStartSettings类
在Estimators中进行warm-starting的设置.
示例:使用 DNNEstimator 罐头emb_vocab_file = tf.feature_column.embedding_column(
tf.feature_column.categorical_column_with_vocabulary_file(
"sc_vocab_file", "new_vocab.txt", vocab_size=100),
dimension=8)
emb_vocab_list = tf.feature_column.embedding_column(
tf.feature_column.categorical_column_with_vocabulary_list(
"sc_vocab_list", vocabulary_list=["a", "b"]),
dimension=8)
estimator = tf.estimator.DNNClassifier(
hidden_units=[128, 64], feature_columns=[emb_vocab_file, emb_vocab_list],
warm_start_from=ws)
其中ws可以定义为:
模型中warm-start的所有权重(输入层和隐藏权重).可以提供目录或特定的检查点(在前者的情况下,将使用最新的检查点):ws = WarmStartSettings(ckpt_to_initialize_from="/tmp")