Skip to content

Instantly share code, notes, and snippets.

@pritul2
Last active November 16, 2020 02:21
Show Gist options
  • Save pritul2/f91f1074a1de8366970effc6a760287e to your computer and use it in GitHub Desktop.
Save pritul2/f91f1074a1de8366970effc6a760287e to your computer and use it in GitHub Desktop.
#Convert singular value of y to one hot encoding#
from tensorflow.keras.utils import to_categorical
y_train_encoded = to_categorical(y_train)
y_test_encoded = to_categorical(y_test)
#Visualize the keras model#
from tensorflow.keras.utils import plot_model
from IPython.display import Image
plot_model(model, to_file='model.png', show_shapes=True, show_layer_names=True,rankdir='LR',dpi=96)#change rankdir='TB' for horizontal plot
Image('model.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment