# 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. # 轮数 epochs: 4 # 设备 device: cpu # 工作目录 workspace: "paddlerec.models.match.dssm" # dataset列表 dataset: - name: dataset_train # 名字,用来区分不同的dataset batch_size: 4 type: QueueDataset data_path: "{workspace}/data/train" # 数据路径 data_converter: "{workspace}/synthetic_reader.py" #- name: dataset_infer # 名字,用来区分不同的dataset # batch_size: 1 # type: QueueDataset # data_path: "{workspace}/data/train" # 数据路径 # data_converter: "{workspace}/synthetic_evaluate_reader.py" # 超参数 hyper_parameters: #优化器 optimizer: class: sgd learning_rate: 0.01 strategy: async # 用户自定义 TRIGRAM_D: 1000 NEG: 4 fc_sizes: [300, 300, 128] fc_acts: ['tanh', 'tanh', 'tanh'] # executor配置 epoch: name: trainer_class: single save_checkpoint_interval: 2 # 保存模型 save_inference_interval: 4 # 保存预测模型 save_checkpoint_path: "increment" # 保存模型路径 save_inference_path: "inference" # 保存预测模型路径 save_inference_feed_varnames: ["query", "doc_pos"] # 预测模型feed vars save_inference_fetch_varnames: ["cos_sim_0.tmp_0"] # 预测模型 fetch vars #init_model_path: "xxxx" # 加载模型 # 执行器,每轮要跑的所有模型 executor: - name: train model: "{workspace}/model.py" # 模型路径 dataset_name: dataset_train # 名字,用来区分不同的阶段 thread_num: 1 # 线程数 is_infer: False # 是否是infer # - name: infer # model: "{workspace}/model.py" # 模型路径 # dataset_name: dataset_infer # 名字,用来区分不同的阶段 # thread_num: 1 # 线程数 # is_infer: True # 是否是infer