Skip to content

Commit

Permalink
Timing output for test_factorization_module when Verbose enabled (apa…
Browse files Browse the repository at this point in the history
…che#8363)

* Timing output for test_factorization_module when Verbose enabled

* Trigger build

* Trigger build

* Trigger build

* Misc fixes for sparse distributed training (apache#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 (apache#8369)

* Allow test to converge (apache#8351)

* Allow test to converge

* Trigger build

* Trigger build

* Trigger build

* Update cudnn_algoreg-inl.h (apache#7988)

* [Perl] emulate Python zip() for Perl (apache#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 (apache#8171)

* add profile option for frontend profiling to image script

* Update image_classification.py

* Update image_classification.py

* Fix Typo (classification) (apache#8376)

Fix a typo in the example readme.
  • Loading branch information
cjolivier01 authored and Olivier committed Oct 23, 2017
1 parent 1f2dfcb commit 42886f5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/python/unittest/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 42886f5

Please sign in to comment.