aravindsankar28 / dysat Goto Github PK
View Code? Open in Web Editor NEWRepresentation learning on dynamic graphs using self-attention networks
Representation learning on dynamic graphs using self-attention networks
Thank you so much for sharing the open source code.
However, I downloaded the ml-10m data set you provided.
On this dataset, I tried to use Enron's parameter settings for experiments, and I found that the results of the algorithm are lower than those given in the paper.
Can you provide your parameters on the ml-10m data set?
Thanks again for your work and time.
I wish you all the best!
Thank you for reading! The work was so interesting and it was attractive to me.
I am wondering if you could kindly send me the source dataset about it. I promise they will be used only for research purposed.
No matter whether you agree or not, best wishes to you. I would appreciate it if you could help me.
Thanks and regards.
I have a question about how to change the embedding size, I change the temporal_layer_config and structural_layer_config from 128 to 16 and the code doesnt work. If I only change the temporal_layer_config to 16, the result embedding size is still 128.
sorry to bother you, I found the following errors when running run_script.py, one is " Unresolved reference 'raw_input' ", One is the error "from layers import *" in the first line of model.py," ModuleNotFoundError: No module named 'layers' ", how to solve them?
thanks very much for your reply.
Hi,
Thanks for your contribution! I cloned your codes (python3 version) and trained the model using Enron_new you provided. When setting learning rate=0.001 (default value), the final AUC is around 0.86 (as you reported). However, when I increased the learning rate to 0.01 and regenerated context pairs and eval data, the final AUC reached 0.89. I have tested several times in the same environment as requirement.txt.
Did you try to tune the learning rate when you training this dataset? If not, this is a free and significant improvement, right?
I want to run my data with your code, my data's type is (u, v, t) and I follow the preprocess.ipynb in enron and create my graphs, my timestamp is float not date type and (u,v) is index , but I meet an error "No module named 'networkx.classes.reportviews' "when I use load_graphs to load my graphs.
slice_id = 0
for (a, b, t) in new_links:
prev_slice_id = slice_id
slice_id = time_dict[t]
datetime_object = t
if slice_id == 1+prev_slice_id and slice_id > 0:
slices_links[slice_id].add_nodes_from(slices_links[slice_id-1].nodes(data=True))
if a not in slices_links[slice_id]:
slices_links[slice_id].add_node(a)
if b not in slices_links[slice_id]:
slices_links[slice_id].add_node(b)
slices_links[slice_id].add_edge(a,b, date=datetime_object)
def new_remap(slices_graph):
slices_graph_remap = []
for slice_id in slices_graph:
G = nx.MultiGraph()
for x in slices_graph[slice_id].nodes():
G.add_node(x)
for x in slices_graph[slice_id].edges(data=True):
G.add_edge(x[0], x[1], date=x[2]['date'])
assert (len(G.nodes()) == len(slices_graph[slice_id].nodes()))
assert (len(G.edges()) == len(slices_graph[slice_id].edges()))
slices_graph_remap.append(G)
return slices_graph_remap
slices_links_remap = new_remap(slices_links)
np.savez('graphs.npz', graph=slices_links_remap)
Did anyone have the same error?
First of all thank you for your work. It is mentioned in the paper that undirected weighted graphs can be handled, but the weight of the edge can be processed is not withdrawn in the code. The data given in the code also has no weight. So how can you deal with weighted charts?
Dear authors, I successfully ran the codes run_script.py and generated the embeddings for each timestep.
When I run train.py, there is a problem following:
absl.flags._exceptions.DuplicateFlagError: The flag 'log_dir' is defined twice. First from absl.logging, Second from flags. Description from first occurrence: directory to write logfiles into
Thanks for your contribution. I find that DySAT w/o temporal attention is better in Enron.
I change code to delete Temporal Attention part in file models.py
.
# 5: Temporal Attention forward
temporal_inputs = structural_outputs
outputs= temporal_inputs
# for temporal_layer in self.temporal_attention_layers:
# outputs = temporal_layer(temporal_inputs) # [N, T, F]
# temporal_inputs = outputs
# self.attn_wts_all.append(temporal_layer.attn_wts_all)
return outputs
And run
python train.py --dataset Enron_new --time_steps 16
get results w/o temporal attention :
default results (val) [0.8700378071833649, 0.8700378071833649]
default results (val) [0.8851606805293006, 0.8851606805293006]
default results (test) [0.90290357641944, 0.90290357641944]
default results (test) [0.9008850473577972, 0.9008850473577972]
while DySat with temporal attention has results
default results (val) [0.9040642722117203, 0.9040642722117203]
default results (val) [0.9064272211720227, 0.9064272211720227]
default results (test) [0.8758863412866829, 0.8758863412866829]
default results (test) [0.8781636561254593, 0.8781636561254593]
It seems that DySAT w/o temporal attention performs better than one with temporal attention. Is there something wrong ?
I can only see you load graph snapshots .npz file in your code, but I want to know how to build it from your raw dataset.
I want to build graph snapshots in my own dataset, so I need your help. Thanks!
In preprocess.py it generates context pairs during 1 to T, and the model learned from 1 to T to predict link in time T?
def get_context_pairs(graphs, num_time_steps):
""" Load/generate context pairs for each snapshot through random walk sampling."""
load_path = "data/{}/train_pairs_n2v_{}.pkl".format(FLAGS.dataset, str(num_time_steps - 2))
try:
context_pairs_train = dill.load(open(load_path, 'rb'))
print("Loaded context pairs from pkl file directly")
except (IOError, EOFError):
print("Computing training pairs ...")
context_pairs_train = []
for i in range(0, num_time_steps):
context_pairs_train.append(run_random_walks_n2v(graphs[i], graphs[i].nodes()))
dill.dump(context_pairs_train, open(load_path, 'wb'))
print ("Saved pairs")
return context_pairs_train
maybe for i in range(0, num_time_steps - 1):
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.