BianKov / iterEmb

Iterative Embedding and ReWeighting (IERW)
1 stars 0 forks source link

Separating the embedding and edge weighting code for clarity #7

Closed skojaku closed 1 year ago

skojaku commented 1 year ago

In the current implementation, an embedding function performs graph embedding, followed by edge weighting. I think it is better to separate the two for clarity, code reuse, and easy maintenance. My proposal is the following:

  1. Create a new file "edge_weighting.py" and define a function that takes an embedding and graph and produces a weighted graph.
  2. Remove the edge weighting code from embedding.py so that the "embedding.py" contains pure embedding functions that do only graph embedding.
  3. Instead, we put together the edge weighting and graph embedding in a new script "iterative_embedding.py", in which we define the combination of embedding + edge weighting.

Simply put, I propose to split the script into three modules, "embedding.py", "edge_weighting.py", and "iterative_embedding.py", each of which contains the functions that the filename implies.

BianKov commented 1 year ago

I put embedding and edge weighting in one function only to ensure the application of the correct weight formula (i.e., a distance-like or a proximity-like measure) for each embedding. But if you want to create a new script for iterative embedding where you give fixed choices for embedding-weight formula pairs, that's totally fine for me.

skojaku commented 1 year ago

Done. See my PR @BianKov

skojaku commented 1 year ago

Here is the readme. https://github.com/BianKov/iterEmb/tree/change-modularization