forked from microsoft/CNTK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate sayanpa/dcgan3 into master
- Loading branch information
Showing
6 changed files
with
801 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Tests/EndToEndTests/CNTKv2Python/Tutorials/CNTK_206B_DCGAN_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
|
||
# Licensed under the MIT license. See LICENSE.md file in the project root | ||
# for full license information. | ||
# ============================================================================== | ||
|
||
import os | ||
import re | ||
import numpy as np | ||
|
||
abs_path = os.path.dirname(os.path.abspath(__file__)) | ||
notebook = os.path.join(abs_path, "..", "..", "..", "..", "Tutorials", "CNTK_206B_DCGAN.ipynb") | ||
notebook_deviceIdsToRun = [0] | ||
notebook_timeoutSeconds = 900 | ||
|
||
def test_cntk_206B_dcgan_noErrors(nb): | ||
errors = [output for cell in nb.cells if 'outputs' in cell | ||
for output in cell['outputs'] if output.output_type == "error"] | ||
assert errors == [] | ||
|
||
expectedEvalError = 2.05 | ||
expectedEvalErrorAtol = 0.45 | ||
|
||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.