Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# from node2vec.src.main import *
import node2vec.src.main as nv
if __name__ == '__main__':
# model configuration
# hidden_size = 16 # hidden vector size for a single GRU layer
input_size = 4 # embedding vector size for each node
# embedding_size = 3+14 # the number of embedding vocabulary
n_layers = 1
# train configuration
# lr = 0.01
############# node2vec config###############
args = nv.config(dimension=input_size)
############################################
# clean logging directory
if os.path.isdir("logs"):
shutil.rmtree("logs")
# configure("logs/logs_toy", flush_secs=1)
# clean saving directory
if not os.path.exists("saves"):
os.makedirs("saves")
# Generate Graph
# G = nx.karate_club_graph()
G = nx.LCF_graph(14, [5, -5], 7)
graphdataset = GraphDataset(G, shuffle_neighbour=False)
# run node2vec
from sklearn.decomposition import PCA
# model configuration
# hidden_size = 16 # hidden vector size for a single GRU layer
input_size = 128 # embedding vector size for each node
# embedding_size = 3+14 # the number of embedding vocabulary
n_layers = 1
# train configuration
# lr = 0.01
############# node2vec config###############
args = nv.config(dimension=input_size, walk_length = 80, num_walks = 10, window_size = 2)
############################################
# clean logging directory
if os.path.isdir("logs"):
shutil.rmtree("logs")
configure("logs/logs_toy", flush_secs=1)
# clean saving directory
if not os.path.exists("saves"):
os.makedirs("saves")
# Generate Graph
G = nx.karate_club_graph()
# G = nx.LCF_graph(14,[5,-5],7)
# G = nx.LCF_graph(20,[-9,-9],10)