-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from torch import tensor | ||
|
||
from stable_gnn.visualization.contracts.graph_contract import GraphContract | ||
from stable_gnn.visualization.contracts.graph_visualization_contract import GraphVisualizationContract | ||
from stable_gnn.visualization.graph_visualization import GraphVisualizer | ||
|
||
from stable_gnn.visualization.data_generation.graph_generator import GraphGenerator | ||
|
||
VERTEX_NUM = 1000 | ||
EDGE_NUM = 1200 | ||
|
||
|
||
generator = GraphGenerator(vertex_num=VERTEX_NUM, edge_num=EDGE_NUM) | ||
generated_data = generator() | ||
|
||
generated_edge_weights = [1.0 for _ in range(len(generated_data))] | ||
|
||
|
||
graph_contract: GraphContract = GraphContract( | ||
vertex_num=VERTEX_NUM, | ||
edge_list=( # noqa | ||
generated_data, | ||
generated_edge_weights | ||
), | ||
edge_num=EDGE_NUM, | ||
edge_weights=tensor( # noqa | ||
generated_edge_weights * 2 | ||
) | ||
) | ||
vis_contract: GraphVisualizationContract = GraphVisualizationContract(graph=graph_contract) | ||
|
||
vis: GraphVisualizer = GraphVisualizer(vis_contract) | ||
fig = vis.draw() | ||
fig.show() | ||
|
||
print("Complete...") |
35 changes: 35 additions & 0 deletions
35
stable_gnn/visualization/examples/draw_random_hypergraph.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from torch import tensor | ||
|
||
from stable_gnn.visualization.config.parameters.generator_methods import GeneratorMethods | ||
from stable_gnn.visualization.contracts.hypergraph_contract import HypergraphContract | ||
from stable_gnn.visualization.contracts.hypergraph_visualization_contract import HypergraphVisualizationContract | ||
from stable_gnn.visualization.hypergraph_visualization import HypergraphVisualizer | ||
|
||
from stable_gnn.visualization.data_generation.hypergraph_generator import HypergraphGenerator | ||
|
||
|
||
VERTEX_NUM = 500 | ||
EDGE_NUM = 300 | ||
|
||
generator = HypergraphGenerator(vertex_num=VERTEX_NUM, edge_num=EDGE_NUM, generation_method=GeneratorMethods.uniform) | ||
generated_data = generator() | ||
|
||
generated_edge_weights = [1.0 for _ in range(len(generated_data))] | ||
|
||
|
||
graph_contract: HypergraphContract = HypergraphContract( | ||
vertex_num=VERTEX_NUM, | ||
edge_list=( # noqa | ||
generated_data, | ||
generated_edge_weights | ||
), | ||
edge_num=EDGE_NUM, | ||
edge_weights=tensor( # noqa | ||
generated_edge_weights * 2 | ||
), | ||
) | ||
vis_contract: HypergraphVisualizationContract = HypergraphVisualizationContract(graph=graph_contract) | ||
|
||
vis: HypergraphVisualizer = HypergraphVisualizer(vis_contract) | ||
fig = vis.draw() | ||
fig.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.