# 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. workspace: "models/contentunderstanding/textcnn" dataset: - name: data1 batch_size: 10 type: DataLoader data_path: "{workspace}/data/train" data_converter: "{workspace}/reader.py" - name: dataset_infer batch_size: 2 type: DataLoader data_path: "{workspace}/data/test" data_converter: "{workspace}/reader.py" hyper_parameters: optimizer: class: Adagrad learning_rate: 0.001 is_sparse: False 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 mode: [train_runner,infer_runner] runner: - name: train_runner class: train epochs: 16 device: cpu save_checkpoint_interval: 1 save_inference_interval: 1 save_checkpoint_path: "increment" save_inference_path: "inference" save_inference_feed_varnames: [] save_inference_fetch_varnames: [] 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 phase: - name: phase_train model: "{workspace}/model.py" dataset_name: data1 thread_num: 1 - name: phase_infer model: "{workspace}/model.py" # user-defined model dataset_name: dataset_infer # select dataset by name thread_num: 1