Skip to content

Commit

Permalink
Update network_creation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
meiertgrootes authored Aug 20, 2024
1 parent 3c8eae4 commit 59d8294
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dgl_ptm/dgl_ptm/network/network_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import dgl
import networkx as nx
import random
import torch

# network_creation - Creates the network between the initialized nodes using edges from DGL

Expand All @@ -25,7 +26,7 @@ def network_creation(num_agents, method, **kwargs):
seed = kwargs['seed']
print(f"using seed {seed} for network creation.")
else:
seed = random.randint(1, 100000)
seed = torch.initial_seed()

if 'new_node_edges' in kwargs.keys():
new_node_edges = kwargs['new_node_edges']
Expand Down Expand Up @@ -58,4 +59,4 @@ def barabasi_albert_graph(num_agents, new_node_edges=1, seed=1):
print(new_node_edges, seed)

#Return DGL graph from networkx graph
return dgl.from_scipy(barabasi_albert_coo)
return dgl.from_scipy(barabasi_albert_coo)

0 comments on commit 59d8294

Please sign in to comment.