Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

This change uses tensorflow directly #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

This change uses tensorflow directly #31

wants to merge 1 commit into from

Conversation

aliakbarhamzeh1378
Copy link

I had trouble using the previous code by TensorFlow and the code could not correctly identify the layers so it didn't work

if layer == model.layers[0]:
input_layer = int(str(layer.input_shape).split(",")[1][1:-1])
hidden_layers_nr += 1
if type(layer) == Dense:
Copy link

Choose a reason for hiding this comment

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

Perhaps, rewrite this as:

Suggested change
if type(layer) == Dense:
if isinstance(Dense, layer):

Comment on lines +48 to +56
if type(layer) == Conv2D:
layer_types.append("Conv2D")
elif type(layer) == MaxPooling2D:
layer_types.append("MaxPooling2D")
elif type(layer) == Dropout:
layer_types.append("Dropout")
elif type(layer) == Flatten:
layer_types.append("Flatten")
elif type(layer) == Activation:
Copy link

Choose a reason for hiding this comment

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

Ditto!

input_layer = int(str(layer.input_shape).split(",")[1][1:-1])
hidden_layers_nr += 1
if type(layer) == Dense:
hidden_layers.append(int(str(layer.output_shape).split(",")[1][1:-1]))
Copy link

Choose a reason for hiding this comment

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

This is a bit complex for noobs to read, would be nice to simplify it.

Comment on lines +68 to +77
if (type(layer) == Conv2D):
layer_types.append("Conv2D")
elif (type(layer) == MaxPooling2D):
layer_types.append("MaxPooling2D")
elif (type(layer) == Dropout):
layer_types.append("Dropout")
elif (type(layer) == Flatten):
layer_types.append("Flatten")
elif (type(layer) == Activation):
layer_types.append("Activation")
Copy link

Choose a reason for hiding this comment

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

endolith referenced this pull request in endolith/ann-visualizer Apr 3, 2022
endolith referenced this pull request in endolith/ann-visualizer Apr 3, 2022
Unpythonic C-like syntax, like the semicolons at the end of each line
endolith referenced this pull request in endolith/ann-visualizer Apr 3, 2022
(but not all the "line too long" ones)
endolith referenced this pull request in endolith/ann-visualizer Apr 3, 2022
Maybe Keras returned only strings in an earlier version?
endolith added a commit to endolith/ann-visualizer that referenced this pull request Apr 3, 2022
These were suggested in
RedaOps#31
by @mmphego to support inheritance
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants