linear_graph_autoencoders icon indicating copy to clipboard operation
linear_graph_autoencoders copied to clipboard

printing a model summary

Open StefanBloemheuvel opened this issue 2 years ago • 1 comments

Hello,

I want to inspect your work a bit more, and I am normally using Keras for implementing models. How could I print a model summary to inspect the input shapes of the layers a bit more? Or, how could I rewrite the code to a keras model? Do you have tips?

Kind regards,

Stefan

StefanBloemheuvel avatar May 12 '22 14:05 StefanBloemheuvel

Dear @StefanBloemheuvel,

First of all, thank you very much for your message and your interest!

While I don't have any Keras implementation, I think placing this code at the end of train.py should give you what you are looking for:

tvars = tf.trainable_variables()
tvars_vals = sess.run(tvars)
for var, val in zip(tvars, tvars_vals):
    print(var.name, val.shape)

In addition, if you are more familiar with PyTorch than with TF, this working example from pytorch_geometric might also be useful for your project.

Best,

Guillaume

GuillaumeSalhaGalvan avatar May 12 '22 14:05 GuillaumeSalhaGalvan