waleedka / hiddenlayer

Neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.
MIT License
1.79k stars 266 forks source link

Is latest `draw_graph()` function work in progress? (Codebase merge issue 3 of 3) #3

Closed philferriere closed 5 years ago

philferriere commented 6 years ago

Hello @waleedka Please see: https://github.com/waleedka/weightwatcher/blob/aa8f1546f27401b61296d96be8095e290318f8b3/ww/graph.py#L273-L322

waleedka commented 6 years ago

I guess everything is work in progress at this point. Did it not work for you? It works on my PyTorch version on the two networks I tested VGG and ResNet50. Obviously there is a lot more to be done.

The rational for switching to HTML-like labels is that it gives more flexibility to control the text rendering.

philferriere commented 6 years ago

You're correct, it is functional. A commented code block made me think this was work in progress, for some reason.

Also, are you open to having the notion of "schemas"? As in, we could have a "blue" schema, or a "black & white classic" schema. I felt that what you had before looked perhaps sharper than the new color schema. It's really not a big deal.

waleedka commented 6 years ago

Yes, I isolated the color values into separate constants to make it easy to customize the look. Currently, only these values are separated and we should add more as we go along:

COLOR_OUTLINE = "#4080A0"
COLOR_FILL = "#F0F0F0"
COLOR_FONT = "#204050"

We can make these values into a dict and then it's easy to override as such:

ww.theme = {"outline_color": "#4080A0", "fill_color": "#F0F0F0", "font_color": "#204050"}
philferriere commented 6 years ago

@waleedka, I've added the styling but also decided to keep the HTML rendering in a different method (draw_graph_html() instead of draw_graph()) because of the much lower quality of the output at this time.

Please take a look at the section Inception v1 in the TF graph notebook to see what I mean. I've rendered the graph using the two different methods one after the other so you can compare.

The non-HTML version looks quite great while the HTML one is pretty much impossible to read. Let me know if you disagree.