update deepfm network.

pull/7055/head
linqingke 5 years ago
parent ca90924fa4
commit 3ac12129a6

@ -16,47 +16,40 @@
network config setting, will be used in train.py and eval.py network config setting, will be used in train.py and eval.py
""" """
class DataConfig: class DataConfig:
""" """data config"""
Define parameters of dataset.
"""
data_vocab_size = 184965 data_vocab_size = 184965
train_num_of_parts = 21 train_num_of_parts = 21
test_num_of_parts = 3 test_num_of_parts = 3
batch_size = 1000 batch_size = 16000
data_field_size = 39 data_field_size = 39
# dataset format, 1: mindrecord, 2: tfrecord, 3: h5
data_format = 2 data_format = 2
class ModelConfig: class ModelConfig:
""" """model config"""
Define parameters of model.
"""
batch_size = DataConfig.batch_size batch_size = DataConfig.batch_size
data_field_size = DataConfig.data_field_size data_field_size = DataConfig.data_field_size
data_vocab_size = DataConfig.data_vocab_size data_vocab_size = DataConfig.data_vocab_size
data_emb_dim = 80 data_emb_dim = 80
deep_layer_args = [[400, 400, 512], "relu"] deep_layer_args = [[1024, 512, 256, 128], "relu"]
init_args = [-0.01, 0.01] init_args = [-0.01, 0.01]
weight_bias_init = ['normal', 'normal'] weight_bias_init = ['normal', 'normal']
keep_prob = 0.9 keep_prob = 0.9
class TrainConfig: class TrainConfig:
""" """train config"""
Define parameters of training.
"""
batch_size = DataConfig.batch_size batch_size = DataConfig.batch_size
l2_coef = 1e-6 l2_coef = 8e-5
learning_rate = 1e-5 learning_rate = 5e-4
epsilon = 1e-8 epsilon = 5e-8
loss_scale = 1024.0 loss_scale = 1024.0
train_epochs = 15
train_epochs = 5
save_checkpoint = True save_checkpoint = True
ckpt_file_name_prefix = "deepfm" ckpt_file_name_prefix = "deepfm"
save_checkpoint_steps = 1 save_checkpoint_steps = 1
keep_checkpoint_max = 15 keep_checkpoint_max = 50
eval_callback = True eval_callback = True
loss_callback = True loss_callback = True

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save