Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph visualization error #13

Closed
arpelletier opened this issue Jul 25, 2022 · 4 comments
Closed

Graph visualization error #13

arpelletier opened this issue Jul 25, 2022 · 4 comments

Comments

@arpelletier
Copy link

arpelletier commented Jul 25, 2022

Hello.
I am trying the Using CBOW to embed Cora python notebook (linked) and after replacing "CBOWEnsmallen" with "DeepWalkCBOWEnsmallen", the first order embedding runs successfully but fails at the graph visualization. I get the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_3453/3695275499.py in <module>
----> 1 GraphVisualizer(
      2     graph,
      3     node_embedding_method_name="CBOW - First order"
      4 ).fit_and_plot_all(first_embedding)

~/anaconda3/lib/python3.9/site-packages/embiggen/visualizations/graph_visualizer.py in fit_and_plot_all(self, node_embedding, number_of_columns, show_letters, include_distribution_plots, **node_embedding_kwargs)
   4236         distribution_plot_methods_to_call = []
   4237 
-> 4238         if not self._graph.has_constant_non_zero_node_degrees():
   4239             node_scatter_plot_methods_to_call.append(
   4240                 self.plot_node_degrees,

AttributeError: The method 'has_constant_non_zero_node_degrees' does not exists, did you mean one of the following?
* 'has_constant_edge_weights'
* 'get_non_zero_subgraph_node_degrees'
* 'has_nodes'
* 'has_edges'
* 'has_selfloops'
* 'has_node_ontologies'
* 'has_node_oddities'
* 'get_node_degrees'
* 'has_node_name'
* 'has_node_types'

Looks like the issue has to do with embiggen dependencies in the graph visualization. Below are the package versions I am using:
embiggen==0.11.13
ensmallen==0.8.7
grape==0.1.9

As well, I was not able to successfully run the second-order embeddings

model = DeepWalkCBOWEnsmallen(
    return_weight=2.0,
    explore_weight=0.1
)
second_embedding = model.fit_transform(graph).get_node_embedding_from_index(0)

The above code gives the below error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_3453/3112314827.py in <module>
----> 1 model = DeepWalkCBOWEnsmallen(
      2     return_weight=2.0,
      3     explore_weight=0.1
      4 )
      5 second_embedding = model.fit_transform(graph).get_node_embedding_from_index(0)

TypeError: __init__() got an unexpected keyword argument 'return_weight'```
@LucaCappelletti94
Copy link
Member

Thank you for the clear issue!

The issue boils down to a not up-to-date jupyter notebook; I have now inserted the execution of jupyter notebooks in the test suite to avoid such things from happening again.

I expect to make available the update Jupiters by later this afternoon (central European time).

@LucaCappelletti94
Copy link
Member

To keep you posted, I am currently rendering the Jupyter Notebooks. I had to solve some cross-browser compatibility issues to integrate the animated embeddings, which took far more than I had hoped.

If everything goes smoothly, I expect to push them online later today or tomorrow.

@LucaCappelletti94
Copy link
Member

Hello and sorry for the delay! The reported issue is solved in the current version of 🍇, namely the 0.1.10.

Furthermore, I have updated and extended the available tutorials in this directory.

@LucaCappelletti94
Copy link
Member

I assume the error is no more since I have tested all tutorials. Please feel free to reopen the issue if that is not the case.

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

No branches or pull requests

2 participants