config.yaml 2.3 KB
Newer Older
C
chengmo 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

train:
  trainer:
    # for cluster training
    strategy: "async"

C
chengmo 已提交
20
  epochs: 2
C
upadet  
chengmo 已提交
21
  workspace: "paddlerec.models.treebased.tdm"
C
chengmo 已提交
22 23 24 25

  reader:
    batch_size: 32
    class: "{workspace}/tdm_reader.py"
C
chengmo 已提交
26 27
    train_data_path: "{workspace}/data/train"
    test_data_path: "{workspace}/data/test"
C
chengmo 已提交
28
    reader_debug_mode: False
C
chengmo 已提交
29 30 31 32 33

  model:
    models: "{workspace}/model.py"
    hyper_parameters:
      node_emb_size: 64
C
chengmo 已提交
34
      input_emb_size: 768
C
chengmo 已提交
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
      neg_sampling_list: [1, 2, 3, 4]
      output_positive: True
      topK: 1
      learning_rate: 0.0001
      act: "tanh"
      optimizer: ADAM
    tree_parameters:
      max_layers: 4
      node_nums: 26
      leaf_node_nums: 13
      layer_node_num_list: [2, 4, 7, 12]
      child_nums: 2
      
  
  startup:
C
chengmo 已提交
50 51 52
    tree:
      # 单机训练建议tree只load一次,保存为paddle tensor,之后从paddle模型热启
      # 分布式训练trainer需要独立load 
C
chengmo 已提交
53
      load_tree: True
C
chengmo 已提交
54 55 56 57
      tree_layer_path: "{workspace}/tree/layer_list.txt"
      tree_travel_path: "{workspace}/tree/travel_list.npy"
      tree_info_path: "{workspace}/tree/tree_info.npy"
      tree_emb_path: "{workspace}/tree/tree_emb.npy"
C
chengmo 已提交
58 59 60
    single:
      load_persistables: False
      persistables_model_path: ""
C
chengmo 已提交
61
      save_init_model: True
C
chengmo 已提交
62
      init_model_path: "{workspace}/init_model"
C
chengmo 已提交
63
    cluster:
C
chengmo 已提交
64
      init_model_path: "{workspace}/init_model"
C
chengmo 已提交
65 66 67 68

  save:
    increment:
      dirname: "increment"
C
chengmo 已提交
69
      epoch_interval: 1
C
chengmo 已提交
70 71 72
      save_last: True
    inference:
      dirname: "inference"
C
chengmo 已提交
73
      epoch_interval: 10
C
chengmo 已提交
74
      save_last: True
C
chengmo 已提交
75 76

evaluate:
77
  workspace: "paddlerec.models.recall.tdm"
C
chengmo 已提交
78 79 80 81
  reader:
    batch_size: 1
    class: "{workspace}/tdm_evaluate_reader.py"
    test_data_path: "{workspace}/data/test"