Skip to content

Commit

Permalink
Merge branch 'master' into 2.0rc/breakingChanges
Browse files Browse the repository at this point in the history
For checkin
  • Loading branch information
ebarsoumMS committed Mar 28, 2017
2 parents 567d1c0 + 7a297b3 commit 0ee09cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
Expand Up @@ -16,12 +16,14 @@ def test_cntk_206A_basic_gan_noErrors(nb):
for output in cell['outputs'] if output.output_type == "error"]
assert errors == []

expectedEvalErrorByDeviceId = { -1: 2.0, 0: 2.05 }
expectedEvalErrorAtolByDeviceId = { -1: 0.45, 0: 0.3 }
# TODO: Enable the test once the results can be deterministically determined
# expectedEvalErrorByDeviceId = { -1: 5.0, 0: 5.0 }

def test_cntk_206A_basic_gan_evalCorrect(nb, device_id):
testCell = [cell for cell in nb.cells
if cell.cell_type == 'code' and re.search('# Print the generator loss', cell.source)]
assert len(testCell) == 1
m = re.match(r"Training loss of the generator is: (?P<actualEvalError>\d+\.\d+)\r?$", testCell[0].outputs[0]['text'])
assert np.isclose(float(m.group('actualEvalError')), expectedEvalErrorByDeviceId[device_id], atol=expectedEvalErrorAtolByDeviceId[device_id])
#def test_cntk_206A_basic_gan_evalCorrect(nb, device_id):
# testCell = [cell for cell in nb.cells
# if cell.cell_type == 'code' and re.search('# Print the generator loss', cell.source)]
# assert len(testCell) == 1
# m = re.match(r"Training loss of the generator is: (?P<actualEvalError>\d+\.\d+)\r?$", testCell[0].outputs[0]['text'])

# assert (float(m.group('actualEvalError')) > expectedEvalErrorByDeviceId[device_id])

Expand Up @@ -18,12 +18,12 @@ def test_cntk_206B_dcgan_noErrors(nb):
for output in cell['outputs'] if output.output_type == "error"]
assert errors == []

expectedEvalError = 2.05
expectedEvalErrorAtol = 0.45
# TODO: Enable the test once the results can be deterministically determined
# expectedEvalError = 5.00

def test_cntk_206B_dcgan_evalCorrect(nb):
testCell = [cell for cell in nb.cells
if cell.cell_type == 'code' and re.search('# Print the generator loss', cell.source)]
assert len(testCell) == 1
m = re.match(r"Training loss of the generator is: (?P<actualEvalError>\d+\.\d+)\r?$", testCell[0].outputs[0]['text'])
assert np.isclose(float(m.group('actualEvalError')), expectedEvalError, atol=expectedEvalErrorAtol)
#def test_cntk_206B_dcgan_evalCorrect(nb):
# testCell = [cell for cell in nb.cells
# if cell.cell_type == 'code' and re.search('# Print the generator loss', cell.source)]
# assert len(testCell) == 1
# m = re.match(r"Training loss of the generator is: (?P<actualEvalError>\d+\.\d+)\r?$", testCell[0].outputs[0]['text'])
# assert (float(m.group('actualEvalError')) > expectedEvalError)

0 comments on commit 0ee09cf

Please sign in to comment.