提交 adac28f2 编写于 作者: M malin10

update config.yaml

上级 150b2886
...@@ -12,60 +12,63 @@ ...@@ -12,60 +12,63 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# 轮数
epochs: 4
# 设备
device: cpu
# 工作目录
workspace: "paddlerec.models.match.dssm" workspace: "paddlerec.models.match.dssm"
# dataset列表
dataset: dataset:
- name: dataset_train # 名字,用来区分不同的dataset - name: dataset_train
batch_size: 4 batch_size: 4
type: QueueDataset type: QueueDataset
data_path: "{workspace}/data/train" # 数据路径 data_path: "{workspace}/data/train"
data_converter: "{workspace}/synthetic_reader.py" data_converter: "{workspace}/synthetic_reader.py"
#- name: dataset_infer # 名字,用来区分不同的dataset - name: dataset_infer
# batch_size: 1 batch_size: 1
# type: QueueDataset type: QueueDataset
# data_path: "{workspace}/data/train" # 数据路径 data_path: "{workspace}/data/train"
# data_converter: "{workspace}/synthetic_evaluate_reader.py" data_converter: "{workspace}/synthetic_evaluate_reader.py"
# 超参数
hyper_parameters: hyper_parameters:
#优化器
optimizer: optimizer:
class: sgd class: sgd
learning_rate: 0.01 learning_rate: 0.01
strategy: async strategy: async
# 用户自定义
TRIGRAM_D: 1000 TRIGRAM_D: 1000
NEG: 4 NEG: 4
fc_sizes: [300, 300, 128] fc_sizes: [300, 300, 128]
fc_acts: ['tanh', 'tanh', 'tanh'] fc_acts: ['tanh', 'tanh', 'tanh']
# executor配置 mode: runner1
epoch: # config of each runner.
name: # runner is a kind of paddle training class, which wraps the train/infer process.
trainer_class: single runner:
save_checkpoint_interval: 2 # 保存模型 - name: runner1
save_inference_interval: 4 # 保存预测模型 class: single_train
save_checkpoint_path: "increment" # 保存模型路径 # num of epochs
save_inference_path: "inference" # 保存预测模型路径 epochs: 4
save_inference_feed_varnames: ["query", "doc_pos"] # 预测模型feed vars # device to run training or infer
save_inference_fetch_varnames: ["cos_sim_0.tmp_0"] # 预测模型 fetch vars device: cpu
#init_model_path: "xxxx" # 加载模型 save_checkpoint_interval: 2 # save model interval of epochs
save_inference_interval: 4 # save inference
save_checkpoint_path: "increment" # save checkpoint path
save_inference_path: "inference" # save inference path
save_inference_feed_varnames: ["query", "doc_pos"] # feed vars of save inference
save_inference_fetch_varnames: ["cos_sim_0.tmp_0"] # fetch vars of save inference
init_model_path: "" # load model path
fetch_period: 10
- name: runner2
class: single_infer
# num of epochs
epochs: 1
# device to run training or infer
device: cpu
init_model_path: "increment/2" # load model path
# 执行器,每轮要跑的所有模型 # runner will run all the phase in each epoch
executor: phase:
- name: train - name: phase1
model: "{workspace}/model.py" # 模型路径 model: "{workspace}/model.py" # user-defined model
dataset_name: dataset_train # 名字,用来区分不同的阶段 dataset_name: dataset_train # select dataset by name
thread_num: 1 # 线程数 thread_num: 1
is_infer: False # 是否是infer #- name: phase2
# - name: infer # model: "{workspace}/model.py" # user-defined model
# model: "{workspace}/model.py" # 模型路径 # dataset_name: dataset_infer # select dataset by name
# dataset_name: dataset_infer # 名字,用来区分不同的阶段 # thread_num: 1
# thread_num: 1 # 线程数
# is_infer: True # 是否是infer
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册