-
Notifications
You must be signed in to change notification settings - Fork 0
Bug fixing #12
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
base: main
Are you sure you want to change the base?
Bug fixing #12
Changes from all commits
6ce6ea2
cd6a224
6a16a14
da47995
51faac7
7d4f4a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,8 @@ def __init__( | |
| resolution: float = 1, | ||
| community: list | None = None, | ||
| use_weights: bool = True, | ||
| version: str = "Advantage_system5.4", | ||
| region: str = "eu-central-1", | ||
| version: str | None = None, | ||
| region: str | None = None, | ||
| num_reads: int = 100, | ||
| chain_strength: float | None = None, | ||
| use_clique_embedding: bool = False, | ||
|
|
@@ -28,9 +28,19 @@ def __init__( | |
| self.chain_strength = chain_strength | ||
| self.use_clique_embedding = use_clique_embedding | ||
| self._use_weights = use_weights | ||
|
|
||
| weight = "weight" if use_weights else None | ||
| network = Network(G, resolution=resolution, weight=weight, community=community) | ||
|
|
||
| if not hasattr(self, "_full_modularity_matrix"): | ||
| self._full_modularity_matrix = Network( | ||
| G, resolution=resolution, weight=weight, community=community | ||
| ).calculate_full_modularity_matrix() | ||
| network = Network( | ||
| G, | ||
| resolution=resolution, | ||
| weight=weight, | ||
| community=community, | ||
| full_modularity_matrix=self._full_modularity_matrix, | ||
| ) | ||
|
Comment on lines
+32
to
+43
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool. However GurobiSampler needs it, as well. How about adding this code as a method to the abstract class (HierarchicalSampler)? As an optional method (without "@ abstractmethod") with default implementation? By the way, I think self.weight can be saved as an attribute in AdvantageSampler and GurobiSampler, "community" would stay then as the only argument that isn't saved (cannot be) and is special. Self.weights can be saved I think. |
||
| problem = CommunityDetectionProblem( | ||
| network, communities=2, one_hot_encoding=False | ||
| ) | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here ok, but args "version" and "region" have gotten lost in Advantage in QHyper kacper3615/bug_fixing, they are not used there. Looks like a small mistake after refactoring. I added a comment in the PR in QHyper. Make sure nothing else got lost in Advantage after refactor ;)