forked from mindspore-Ecosystem/mindspore
modify widedeep
This commit is contained in:
parent
b5957b5af6
commit
49437d13fc
|
@ -53,7 +53,7 @@ class LossCallBack(Callback):
|
|||
print("===loss===", cb_params.cur_epoch_num, cur_step_in_epoch, wide_loss, deep_loss)
|
||||
|
||||
# raise ValueError
|
||||
if self._per_print_times != 0 and cur_num % self._per_print_times == 0 and config is not None:
|
||||
if self._per_print_times != 0 and cur_num % self._per_print_times == 0 and self.config is not None:
|
||||
loss_file = open(self.config.loss_file_name, "a+")
|
||||
loss_file.write("epoch: %s, step: %s, wide_loss: %s, deep_loss: %s" %
|
||||
(cb_params.cur_epoch_num, cur_step_in_epoch, wide_loss, deep_loss))
|
||||
|
|
|
@ -22,8 +22,8 @@ def argparse_init():
|
|||
parser = argparse.ArgumentParser(description='WideDeep')
|
||||
parser.add_argument("--data_path", type=str, default="./test_raw_data/")
|
||||
parser.add_argument("--epochs", type=int, default=15)
|
||||
parser.add_argument("--batch_size", type=int, default=10000)
|
||||
parser.add_argument("--eval_batch_size", type=int, default=15)
|
||||
parser.add_argument("--batch_size", type=int, default=16000)
|
||||
parser.add_argument("--eval_batch_size", type=int, default=16000)
|
||||
parser.add_argument("--field_size", type=int, default=39)
|
||||
parser.add_argument("--vocab_size", type=int, default=184965)
|
||||
parser.add_argument("--emb_dim", type=int, default=80)
|
||||
|
@ -45,8 +45,8 @@ class WideDeepConfig():
|
|||
def __init__(self):
|
||||
self.data_path = "./test_raw_data/"
|
||||
self.epochs = 15
|
||||
self.batch_size = 10000
|
||||
self.eval_batch_size = 10000
|
||||
self.batch_size = 16000
|
||||
self.eval_batch_size = 16000
|
||||
self.field_size = 39
|
||||
self.vocab_size = 184965
|
||||
self.emb_dim = 80
|
||||
|
|
|
@ -91,4 +91,4 @@ if __name__ == "__main__":
|
|||
widedeep_config = WideDeepConfig()
|
||||
widedeep_config.argparse_init()
|
||||
|
||||
test_eval(widedeep_config.widedeep)
|
||||
test_eval(widedeep_config)
|
||||
|
|
Loading…
Reference in New Issue