config.yaml 1.9 KB
Newer Older
X
xujiaqi01 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# 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.

Y
yinhaofeng 已提交
15
workspace: "models/contentunderstanding/textcnn_pretrain"
X
xujiaqi01 已提交
16

X
xjqbest 已提交
17
dataset:
Y
yinhaofeng 已提交
18 19
- name: dataset_train
  batch_size: 128
X
xjqbest 已提交
20
  type: DataLoader
Y
yinhaofeng 已提交
21
  data_path: "{workspace}/senta_data/train"
22 23
  data_converter: "{workspace}/reader.py"
- name: dataset_infer
Y
yinhaofeng 已提交
24
  batch_size: 256
25
  type: DataLoader
Y
yinhaofeng 已提交
26
  data_path: "{workspace}/senta_data/test"
X
xjqbest 已提交
27 28 29 30
  data_converter: "{workspace}/reader.py"

hyper_parameters:
  optimizer:
Y
yinhaofeng 已提交
31
    class: adam
X
xjqbest 已提交
32
    learning_rate: 0.001
Y
yinhaofeng 已提交
33
    strategy: async
X
xujiaqi01 已提交
34

35
mode: [train_runner,infer_runner]
X
xujiaqi01 已提交
36

X
xjqbest 已提交
37
runner:
38
- name: train_runner
J
Jinhua Liang 已提交
39
  class: train
Y
yinhaofeng 已提交
40
  epochs: 6
X
xjqbest 已提交
41
  device: cpu
42
  save_checkpoint_interval: 1
X
xjqbest 已提交
43
  save_checkpoint_path: "increment"
44 45
  init_model_path: "" 
  print_interval: 10
Y
yinhaofeng 已提交
46 47 48 49 50
  # startup class for finetuning
  startup_class_path: "{workspace}/finetune_startup.py"
  # path of pretrained model. Please set empty if you don't use finetune function.
  init_pretraining_model_path: "{workspace}/pretrain_model/pretrain_model_params"
 
51
  phases: phase_train
Y
yinhaofeng 已提交
52

53 54 55 56 57
- name: infer_runner
  class: infer
  # device to run training or infer
  device: cpu
  print_interval: 1
Y
yinhaofeng 已提交
58
  init_model_path: "increment/3" # load model path
59
  phases: phase_infer
X
xujiaqi01 已提交
60

61
  
X
xjqbest 已提交
62
phase:
63
- name: phase_train
X
xjqbest 已提交
64
  model: "{workspace}/model.py"
Y
yinhaofeng 已提交
65
  dataset_name: dataset_train
X
xjqbest 已提交
66
  thread_num: 1
67 68 69 70
- name: phase_infer
  model: "{workspace}/model.py" # user-defined model
  dataset_name: dataset_infer # select dataset by name
  thread_num: 1