forked from Tencent/embedx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_deepfm2.sh
executable file
·48 lines (43 loc) · 1.46 KB
/
run_deepfm2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /bin/bash
#
# Tencent is pleased to support the open source community by making embedx
# available.
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License and other third-party components,
# please refer to LICENSE for details.
#
# Author: Chunchen Su ([email protected])
#
set -e
cd "$(dirname "$0")"
source runtime.sh
readonly DATASET="ctr"
readonly DATASET_DIR="${DEMO_DIR}/data/${DATASET}"
readonly GROUP_CONFIG="${DATASET_DIR}/feature_group_config.txt"
# trainer & predictor flags
readonly FLAGS_gnn_model=false
readonly FLAGS_thread_num=8
readonly FLAGS_model="deepfm2"
readonly FLAGS_model_config="config=${GROUP_CONFIG};deep_dims=64,32;sparse=1"
readonly FLAGS_instance_reader="libsvm"
readonly FLAGS_instance_reader_config="w=0"
readonly FLAGS_optimizer="adam"
readonly FLAGS_optimizer_config="rho1=0.9;rho2=0.999;alpha=1e-4;beta=1e-8"
readonly FLAGS_model_shard=10
readonly FLAGS_epoch=10
readonly FLAGS_in="${DATASET_DIR}/libsvm.txt"
readonly FLAGS_out_model="model"
readonly FLAGS_out_predict="probs"
################################################################
# Train
################################################################
FLAGS_target_type=0
run_trainer ${DATASET}
################################################################
# Predict
################################################################
FLAGS_target_type=1
FLAGS_in_model="${FLAGS_out_model}"
run_predictor ${DATASET}