Skip to content

Conversation

dzhwinter
Copy link
Contributor

@dzhwinter dzhwinter commented Nov 1, 2017

add a visualizer for drawing the ProgramDesc.
It's very simple for debugging your python program.
usage:

import paddle.v2.framework.net_drawer as drawer
print drawer.draw_graph(init_program, program)

then you will get the

digraph <function generator at 0x7f50ba8bfe60> {
	graph [rankdir=TB]
	node [color="#0F9D58" fontcolor="#FFFFFF" shape=oval style=filled]
	fill_constant [label=fill_constant color="#0F9D58" fontcolor="#FFFFFF" shape=oval style=filled]
	uniform_random [label=uniform_random color="#0F9D58" fontcolor="#FFFFFF" shape=oval style=filled]
	mul [label=mul color="#0F9D58" fontcolor="#FFFFFF" shape=oval style=filled]
	Feed -> mul [label="X(x)"]
	uniform_random -> mul [label="Y(fc_0.w_0)"]
	elementwise_add [label=elementwise_add color="#0F9D58" fontcolor="#FFFFFF" shape=oval style=filled]
	mul -> elementwise_add [label="X(fc_0.tmp_0)"]
	fill_constant -> elementwise_add [label="Y(fc_0.b_0)"]
	elementwise_sub [label=elementwise_sub color="#0F9D58" fontcolor="#FFFFFF" shape=oval style=filled]
	elementwise_add -> elementwise_sub [label="X(fc_0.tmp_1)"]
	Feed -> elementwise_sub [label="Y(y)"]
	square [label=square color="#0F9D58" fontcolor="#FFFFFF" shape=oval style=filled]
	elementwise_sub -> square [label="X(square_error_cost_0.tmp_0)"]
	mean [label=mean color="#0F9D58" fontcolor="#FFFFFF" shape=oval style=filled]
	square -> mean [label="X(square_error_cost_0.tmp_1)"]
}

which can be shown in a web browser.
image

Copy link

@tonyyang-svail tonyyang-svail left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@dzhwinter dzhwinter merged commit e0c3a66 into PaddlePaddle:develop Nov 2, 2017
@dzhwinter
Copy link
Contributor Author

We will enhance the RNN and other blocks supporting soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants