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.
Merge commit '6822bb5e0a694a9a23c749b0d629c65484e6219a' into wilrich/…
…miscAlpha2
- Loading branch information
Showing
9 changed files
with
168 additions
and
66 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
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
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
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 numpy as np | ||
import os | ||
from cntk import DeviceDescriptor | ||
from cntk.io import ReaderConfig, ImageDeserializer | ||
|
||
from examples.CifarResNet.CifarResNet import cifar_resnet | ||
|
||
TOLERANCE_ABSOLUTE = 1E-1 | ||
|
||
def test_cifar_resnet_error(device_id): | ||
target_device = DeviceDescriptor.gpu_device(0) | ||
DeviceDescriptor.set_default_device(target_device) | ||
|
||
base_path = os.path.normpath(os.path.join( | ||
*"../../../../Examples/Image/Miscellaneous/CIFAR-10/cifar-10-batches-py".split("/"))) | ||
|
||
os.chdir(os.path.join(base_path, '..')) | ||
|
||
test_error = cifar_resnet(base_path) | ||
expected_test_error = 0.7 | ||
|
||
assert np.allclose(test_error, expected_test_error, | ||
atol=TOLERANCE_ABSOLUTE) |
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
21 changes: 21 additions & 0 deletions
21
bindings/python/examples/test/sequence_to_sequence_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,21 @@ | ||
# Copyright (c) Microsoft. All rights reserved. | ||
|
||
# Licensed under the MIT license. See LICENSE.md file in the project root | ||
# for full license information. | ||
# ============================================================================== | ||
|
||
import numpy as np | ||
from cntk import DeviceDescriptor | ||
|
||
from examples.Sequence2Sequence.Sequence2Sequence import sequence_to_sequence_translator | ||
|
||
TOLERANCE_ABSOLUTE = 1E-1 | ||
|
||
def test_sequence_to_sequence(device_id): | ||
#from cntk.utils import cntk_device | ||
#DeviceDescriptor.set_default_device(cntk_device(device_id)) | ||
|
||
error = sequence_to_sequence_translator() | ||
expected_error = 0.758458 | ||
|
||
assert np.allclose(error, expected_error, atol=TOLERANCE_ABSOLUTE) |
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