From 42886f5c410d012d306e47da57a0950238513a5d Mon Sep 17 00:00:00 2001 From: Chris Olivier Date: Sun, 22 Oct 2017 15:08:56 -0700 Subject: [PATCH] Timing output for test_factorization_module when Verbose enabled (#8363) * Timing output for test_factorization_module when Verbose enabled * Trigger build * Trigger build * Trigger build * Misc fixes for sparse distributed training (#8345) * remove mshadow::range in init_op.h * add unit test * remove pass by ptr, add unit test for pull empty wieghts * fix range in key partition * remove wrong comment * remove change for partition * remove unused var * add int64 to arange. add checkpointing example * Fix the Readme (#8369) * Allow test to converge (#8351) * Allow test to converge * Trigger build * Trigger build * Trigger build * Update cudnn_algoreg-inl.h (#7988) * [Perl] emulate Python zip() for Perl (#8192) * [Perl] emulate Python zip() for Perl * [Perl] retool zip() uses away from the callback form * add profile option for frontend profiling to image script (#8171) * add profile option for frontend profiling to image script * Update image_classification.py * Update image_classification.py * Fix Typo (classification) (#8376) Fix a typo in the example readme. --- tests/python/unittest/test_module.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/python/unittest/test_module.py b/tests/python/unittest/test_module.py index bfe129e88321..d79657a85af5 100644 --- a/tests/python/unittest/test_module.py +++ b/tests/python/unittest/test_module.py @@ -460,7 +460,7 @@ def test_shared_exec_group(exec_grp_shared, exec_grp_created, shared_arg_names=N shared_arg_names=shared_arg_names, extra_args=extra_args) -def test_factorization_machine_module(): +def test_factorization_machine_module(verbose=False): """ Test factorization machine model with sparse operators """ def check_factorization_machine_module(optimizer=None, num_epochs=None): print("check_factorization_machine_module( {} )".format(optimizer)) @@ -558,9 +558,22 @@ def fm(factor_size, feature_dim, init): if num_epochs > 1: assert(metric.get()[1] < expected_accuracy) - check_factorization_machine_module('adam') + if verbose is True: + print("============ SGD ==========================") + start = time.clock() check_factorization_machine_module('sgd') + if verbose is True: + print("Duration: {}".format(time.clock() - start)) + print("============ ADAM ==========================") + start = time.clock() + check_factorization_machine_module('adam') + if verbose is True: + print("Duration: {}".format(time.clock() - start)) + print("============ ADAGRAD ==========================") + start = time.clock() check_factorization_machine_module('adagrad') + if verbose is True: + print("Duration: {}".format(time.clock() - start)) def test_module_initializer():