Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Add dtype visualization to plot_network #14066

Merged
merged 9 commits into from
Mar 15, 2019
Merged

Conversation

ptrendx
Copy link
Member

@ptrendx ptrendx commented Feb 4, 2019

Description

Add possibility to print type information alongside shape in mx.vis.plot_network.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • Check the API doc at http:https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@ptrendx ptrendx requested a review from szha as a code owner February 4, 2019 23:39
shape_dict = dict(zip(interals.list_outputs(), out_shapes))
shape_dict = dict(zip(internals.list_outputs(), out_shapes))
draw_type = False
if dtype is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just if dtype: ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as shapes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this seems slightly more readable.

draw_type = dtype is not None
if draw_type:
   ...

python/mxnet/visualization.py Outdated Show resolved Hide resolved
python/mxnet/visualization.py Outdated Show resolved Hide resolved
@vandanavk
Copy link
Contributor

@mxnet-label-bot add [pr-awaiting-review, Visualization]

@marcoabreu marcoabreu added pr-awaiting-review PR is waiting for code review Visualization labels Feb 5, 2019
@@ -55,6 +56,7 @@ def test_plot_network():
net = mx.sym.SoftmaxOutput(data=net, name='out')
with warnings.catch_warnings(record=True) as w:
digraph = mx.viz.plot_network(net, shape={'data': (100, 200)},
dtype={'data': np.float32},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be testing for dtypes other than np.float32?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not really matter - this test just tries to catch errors during preparation of the picture, and for that the exact type used does not make any difference.

@ptrendx
Copy link
Member Author

ptrendx commented Mar 8, 2019

@szha Does anything else need to be done with this PR?

Copy link
Contributor

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wkcn wkcn merged commit b077965 into apache:master Mar 15, 2019
@wkcn
Copy link
Member

wkcn commented Mar 15, 2019

Merged. Thanks for your contribution!

vdantu pushed a commit to vdantu/incubator-mxnet that referenced this pull request Mar 31, 2019
* Add dtype to plot_network

* Added docstring for the new param

* Added dtype to the plot_network test

* Changes from review

* Fixes from review

* Fix typo

* Retrigger CI
nswamy pushed a commit that referenced this pull request Apr 5, 2019
* Add dtype to plot_network

* Added docstring for the new param

* Added dtype to the plot_network test

* Changes from review

* Fixes from review

* Fix typo

* Retrigger CI
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* Add dtype to plot_network

* Added docstring for the new param

* Added dtype to the plot_network test

* Changes from review

* Fixes from review

* Fix typo

* Retrigger CI
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review Visualization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants