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"
X
xujiaqi01 已提交
16

X
xjqbest 已提交
17 18
dataset:
- name: data1
19
  batch_size: 10
X
xjqbest 已提交
20
  type: DataLoader
21 22 23 24 25 26
  data_path: "{workspace}/data/train"
  data_converter: "{workspace}/reader.py"
- name: dataset_infer
  batch_size: 2
  type: DataLoader
  data_path: "{workspace}/data/test"
X
xjqbest 已提交
27 28 29 30 31 32
  data_converter: "{workspace}/reader.py"

hyper_parameters:
  optimizer:
    class: Adagrad
    learning_rate: 0.001
X
fix  
xjqbest 已提交
33
  is_sparse: False
34 35 36 37 38 39 40 41 42
  dict_dim: 33257
  max_len: 100
  cnn_dim: 128
  cnn_filter_size1: 1
  cnn_filter_size2: 2
  cnn_filter_size3: 3
  emb_dim: 128
  hid_dim: 96
  class_dim: 2
X
xujiaqi01 已提交
43

44
mode: [train_runner,infer_runner]
X
xujiaqi01 已提交
45

X
xjqbest 已提交
46
runner:
47
- name: train_runner
J
Jinhua Liang 已提交
48
  class: train
49
  epochs: 16
X
xjqbest 已提交
50
  device: cpu
51 52
  save_checkpoint_interval: 1
  save_inference_interval: 1
X
xjqbest 已提交
53 54 55 56
  save_checkpoint_path: "increment"
  save_inference_path: "inference"
  save_inference_feed_varnames: []
  save_inference_fetch_varnames: []
57 58 59 60 61 62 63 64 65 66
  init_model_path: "" 
  print_interval: 10
  phases: phase_train
- name: infer_runner
  class: infer
  # device to run training or infer
  device: cpu
  print_interval: 1
  init_model_path: "increment/14" # load model path
  phases: phase_infer
X
xujiaqi01 已提交
67

68
  
X
xjqbest 已提交
69
phase:
70
- name: phase_train
X
xjqbest 已提交
71 72 73
  model: "{workspace}/model.py"
  dataset_name: data1
  thread_num: 1
74 75 76 77
- name: phase_infer
  model: "{workspace}/model.py" # user-defined model
  dataset_name: dataset_infer # select dataset by name
  thread_num: 1