Commit 63967227 by zhlj

fix some change in all to all problem

parent 8a16ee73
WIKI &97.86\% &97.74\% &97.55\% &97.06\% 96.41\%
LASTFM &83.72\% &90.02\% &89.60\% &88.94\%
WikiTalk& 97.16\% &97.66\% &97.71\% &97.71\%
StackOverflow& 97.75\% &97.92\% &97.89\% &97.78\% 91.91\%
GDELT &98.88\% &98.97\% &&98.99\% &99.01\% &98.88\%
&98.06\% &97.86\% &97.89\% &97.87\% \\
&82.26\% &83.72\% &84.48\% &83.41\% \\
&96.11\% &97.16\% &97.36\% &96.88\% \\
&96.45\% &97.75\% &97.88\% &97.70\% \\
&98.07\% &98.88\% &98.91\% &98.84\% \\
import matplotlib.pyplot as plt
# 数据
x_values = [0]
y_values = [0.310754, 0.19102, 0.117148, 0.075549]
# 创建折线图
plt.figure(figsize=(10, 6))
plt.plot(y_values, marker='o', linestyle='-', color='b', linewidth=2, markersize=8)
# 添加标题和标签
plt.title('Number of Cross Edge vs shared node ratio', fontsize=16)
plt.xlabel('The ratio of Cross Edge', fontsize=14)
plt.ylabel('shared nodes ratio', fontsize=14)
# 显示网格
plt.grid(True, linestyle='--', alpha=0.7)
# 显示图表
plt.show()
plt.savefig('shared_ratio.png')
......@@ -14,12 +14,12 @@ probability_params=("0.1")
sample_type_params=("boundery_recent_decay")
#sample_type_params=("recent" "boundery_recent_decay") #"boundery_recent_uniform")
#memory_type=("all_update" "p2p" "all_reduce" "historical" "local")
memory_type=("local")
memory_type=("historical")
#"historical")
#memory_type=("local" "all_update" "historical" "all_reduce")
shared_memory_ssim=("0.3")
#data_param=("WIKI" "REDDIT" "LASTFM" "WikiTalk")
data_param=("WIKI" )
data_param=("WIKI" "LASTFM" "WikiTalk")
#"GDELT")
#data_param=("WIKI" "REDDIT" "LASTFM" "DGraphFin" "WikiTalk" "StackOverflow")
#data_param=("WIKI" "REDDIT" "LASTFM" "WikiTalk" "StackOverflow")
......@@ -34,7 +34,7 @@ mkdir -p all_"$seed"
for data in "${data_param[@]}"; do
model="APAN_large"
if [ "$data" = "WIKI" ] || [ "$data" = "REDDIT" ] || [ "$data" = "LASTFM" ]; then
model="TGN"
model="APAN"
fi
#model="APAN"
mkdir all_"$seed"/"$data"
......
......@@ -67,7 +67,7 @@ parser.add_argument('--probability', default=1, type=float, metavar='W',
help='name of model')
parser.add_argument('--sample_type', default='recent', type=str, metavar='W',
help='name of model')
parser.add_argument('--local_neg_sample', default=True, type=bool, metavar='W',
parser.add_argument('--local_neg_sample', default=False, type=bool, metavar='W',
help='name of model')
parser.add_argument('--shared_memory_ssim', default=2, type=float, metavar='W',
help='name of model')
......@@ -295,7 +295,7 @@ def main():
mode='train',
queue_size = 200,
mailbox = mailbox,
is_pipeline=False,
is_pipeline=True,
use_local_feature = False,
device = torch.device('cuda:{}'.format(local_rank)),
probability=args.probability,
......@@ -619,6 +619,7 @@ def main():
"""
torch.cuda.synchronize()
dist.barrier()
time_prep = time.time() - epoch_start_time
avg_time += time.time() - epoch_start_time
train_ap = float(torch.tensor(train_aps).mean())
......@@ -650,12 +651,13 @@ def main():
tt.ssim_cnt=0
ap, auc = eval('val')
print('finish val')
#torch.cuda.synchronize()
print('start')
torch.cuda.synchronize()
dist.barrier()
t_test = time.time()
print('test')
test_ap,test_auc = 0,0#eval('test')
#torch.cuda.synchronize()
test_ap,test_auc = eval('test')
torch.cuda.synchronize()
dist.barrier()
t_test = time.time() - t_test
total_test_time += t_test
test_ap_list.append((test_ap,test_auc))
......
......@@ -496,7 +496,7 @@ class AsyncMemeoryUpdater(torch.nn.Module):
self.last_updated_ts = b.srcdata['ts'].detach().clone()
self.last_updated_memory = updated_memory.detach().clone()
self.last_updated_nid = b.srcdata['ID'].detach().clone()
"""
with torch.no_grad():
if param is not None:
_,src,dst,ts,edge_feats,nxt_fetch_func = param
......@@ -523,7 +523,7 @@ class AsyncMemeoryUpdater(torch.nn.Module):
self.mailbox.set_memory_local(DistIndex(index[local_mask]).loc,memory[local_mask],memory_ts[local_mask], Reduce_Op = 'max')
is_deliver=(self.mailbox.deliver_to == 'neighbors')
self.update_hunk(index,memory,memory_ts,index0,mail,mail_ts,nxt_fetch_func,spread_mail= is_deliver)
"""
if self.memory_param['combine_node_feature'] and self.dim_node_feat > 0:
if self.dim_node_feat == self.dim_hid:
b.srcdata['h'] += updated_memory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment