Skip to content
Snippets Groups Projects
Commit f27aea54 authored by Walid Megherbi's avatar Walid Megherbi
Browse files

Upload files

parent 1d3e60e5
No related branches found
No related tags found
No related merge requests found
Showing
with 36 additions and 17 deletions
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/node2vec/src/graph/test.npy" charset="windows-1252" />
<file url="file://$PROJECT_DIR$/node2vec/src/graph/test_Cliques.npy" charset="UTF-16" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
...@@ -80,14 +80,17 @@ def PatternFinding(dat,lab): ...@@ -80,14 +80,17 @@ def PatternFinding(dat,lab):
adj = np.count_nonzero(lab == 1) adj = np.count_nonzero(lab == 1)
size = len(lab) size = len(lab)
for i in range(1): for i in range(1):
Ufin = np.random.uniform(-19, -1, size) * 0 Ufin = np.random.uniform(-1, 0, size) * 0
#print("ufin",Ufin)
#print(len(dat) * 2 / ((size-1) * (size - 1)))
x = 1 x = 1
U = np.random.uniform(-19, -1, size) U = np.random.uniform(-1, 0, size)
V = np.random.randint(1, size=size) V = np.random.randint(1, size=size)
B = (adj / (size * (len(dat) * 2 / (size * (size - 1))))) * 20 B = (adj / (size * (len(list(O.edges)) * 2 / (size * (size - 1)))))
#print("B",B)
Arrange(lab,Ufin,B,V) Arrange(lab,Ufin,B,V)
print(np.count_nonzero(V == 1)) #print(np.count_nonzero(V == 1))
print(np.count_nonzero(lab == 1)) #print(np.count_nonzero(lab == 1))
""" """
while len(dat) > 0: while len(dat) > 0:
x = x + 1 x = x + 1
......
...@@ -16,7 +16,7 @@ def generate_clique(nb,size,total_size): ...@@ -16,7 +16,7 @@ def generate_clique(nb,size,total_size):
cliques=np.asarray(([y for x in cliques for y in x if len(x)>=4])) cliques=np.asarray(([y for x in cliques for y in x if len(x)>=4]))
nodes_cliques = np.unique(cliques) nodes_cliques = np.unique(cliques)
x = len(nodes_cliques) x = len(nodes_cliques)
print("nodes_cliques",x) #print("nodes_cliques",x)
output=np.zeros(total_size) output=np.zeros(total_size)
output[nodes_cliques]=1 output[nodes_cliques]=1
return G_new,output,x,nodes_cliques,size,nb return G_new,output,x,nodes_cliques,size,nb
...@@ -51,7 +51,7 @@ total_size = 100 ...@@ -51,7 +51,7 @@ total_size = 100
max_size_clique = 10 max_size_clique = 10
max_clique_count = 10 max_clique_count = 10
outputs = [] outputs = []
Gr_size = 1 Gr_size = 1000
graph = [] graph = []
data = [] data = []
lab = [] lab = []
...@@ -91,24 +91,27 @@ for id in range(Gr_size): ...@@ -91,24 +91,27 @@ for id in range(Gr_size):
for k in range(len(t)): for k in range(len(t)):
if (t[r, 0] == t[k, 0]) and r != k and w != t[r, 0]: if (t[r, 0] == t[k, 0]) and r != k and w != t[r, 0]:
w = t[r, 0] w = t[r, 0]
print(w) #print(w)
P = np.delete(T,w,axis=0) P = np.delete(T,w,axis=0)
print(len(P),E[i])
T=P T=P
print("id",id)
sz.append(T) sz.append(T)
np.save(os.path.join(PATH, "size.npy"), np.asarray(sz[0])) ########################### np.save(os.path.join(PATH, "size.npy"), np.asarray(sz)) ###########################
np.save(os.path.join(PATH, "data.npy"), np.asarray(graph)) ############################ #np.save(os.path.join(PATH, "data.npy"), np.asarray(graph)) ############################
np.save(os.path.join(PATH, "data2.npy"), np.asarray(data)) ########################## #np.save(os.path.join(PATH, "data2.npy"), np.asarray(data)) ##########################
#print("out",sz[0])
#print("out",graph[0])
#print("out",data[0])
output = np.asarray(outputs) output = np.asarray(outputs)
np.save(os.path.join(PATH,"output.npy"),output) #generation des outputs ####################### #np.save(os.path.join(PATH,"output.npy"),output) #generation des outputs #######################
print("out",output[0]) #print("out",output[0])
labs = np.asarray(lab) labs = np.asarray(lab)
np.save(os.path.join(PATH,"labels2.npy"),labs) #generation des outputs ########################## np.save(os.path.join(PATH,"labels2.npy"),labs) #generation des outputs ##########################
print("labs",labs[0]) #print("labs",labs[0])
print(s) #print(s)
print(len(sz[0])) print(len(sz[0]))
#nx.draw(G,with_labels=True) #nx.draw(G,with_labels=True)
......
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment