This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-788] Fix for issue #11733 #12067
Merged
+21
−21
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ca14fa0
added support to check_consistency function to generate random number…
20f831a
updated from latest in master (had old version of the file)
d493036
shortened lines per lint spec
71c55fd
renamed default_type argument to rand_type for clarity
a2e878c
cleaned up check_consistency function docstring
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -614,13 +614,13 @@ def test_pooling_with_type(): | |
{'ctx': mx.cpu(0), 'pool_data': (2, 2, 10, 10), 'type_dict': {'pool_data': np.float64}}, | ||
{'ctx': mx.cpu(0), 'pool_data': (2, 2, 10, 10), 'type_dict': {'pool_data': np.float32}}] | ||
sym = mx.sym.Pooling(kernel=(3,3), pool_type='max', pooling_convention='valid', name='pool') | ||
check_consistency(sym, ctx_list) | ||
check_consistency(sym, ctx_list, rand_type=np.float16) | ||
|
||
sym = mx.sym.Pooling(kernel=(3,3), pool_type='max', pooling_convention='full', name='pool') | ||
check_consistency(sym, ctx_list) | ||
check_consistency(sym, ctx_list, rand_type=np.float16) | ||
|
||
sym = mx.sym.Pooling(kernel=(300,300), pool_type='max', global_pool=True, name='pool') | ||
check_consistency(sym, ctx_list) | ||
check_consistency(sym, ctx_list, rand_type=np.float16) | ||
|
||
|
||
@with_seed() | ||
|
@@ -765,31 +765,26 @@ def test_spatial_transformer_with_type(): | |
check_consistency(sym, ctx_list, grad_req="add") | ||
|
||
|
||
# Checking max pooling consistency over the data sets of different float types is problematic | ||
# as one max value in a float32 data set may not be the max value in a float16 data set. | ||
# This function will not be called. | ||
@with_seed(1234) | ||
def test_pooling_with_type(): | ||
@with_seed() | ||
def test_pooling_with_type2(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why rename the method since there is no test_pooling_with_type()? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is another There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, missed it, because this change shows an update on the previous method. It's also more informative to give a more descriptive method name than numerical suffix. |
||
ctx_list = [{'ctx': mx.gpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float64}}, | ||
{'ctx': mx.gpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float32}}, | ||
{'ctx': mx.gpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float16}}, | ||
{'ctx': mx.cpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float64}}, | ||
{'ctx': mx.cpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float32}}] | ||
|
||
sym = mx.sym.Pooling(name='pool', kernel=(3,3), stride=(2,2), pool_type='max') | ||
check_consistency(sym, ctx_list) | ||
check_consistency(sym, ctx_list, rand_type=np.float16) | ||
|
||
sym = mx.sym.Pooling(name='pool', kernel=(3,3), pad=(1,1), pool_type='avg') | ||
check_consistency(sym, ctx_list) | ||
|
||
# this is unstable | ||
# sym = mx.sym.Pooling(name='pool', kernel=(5,5), pad=(2,2), pool_type='max') | ||
# check_consistency(sym, ctx_list) | ||
sym = mx.sym.Pooling(name='pool', kernel=(5,5), pad=(2,2), pool_type='max') | ||
check_consistency(sym, ctx_list, rand_type=np.float16) | ||
|
||
sym = mx.sym.Pooling(name='pool', kernel=(3,3), pad=(1,1), pool_type='sum') | ||
check_consistency(sym, ctx_list) | ||
|
||
|
||
@unittest.skip("Flaky test https://github.com/apache/incubator-mxnet/issues/11517") | ||
@with_seed() | ||
def test_pooling_versions(): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not an expert in this. Someone familiar with it may want to check the math here since this change is not mentioned in the PR description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is mentioned in the description in the
changes
section.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks