Coder Social home page Coder Social logo

Comments (6)

realCrush avatar realCrush commented on August 30, 2024

Hi, if it's hard to find the original code for efficiency experiment, could you please provide the raw results for drawing Figure 3 and Figure 4? We want to follow your work and reuse your results for a fair comparison. 😊

from gmt.

JinheonBaek avatar JinheonBaek commented on August 30, 2024

Hi, thanks for your interest, and sorry for getting back to you late.

I did my best to find the code for drawing those two figures, and below one is the latest code that I found so far.

import numpy as np
import matplotlib
import matplotlib.pyplot as plt

matplotlib.rc('font', size=15)

# # Default
# fig, ax = plt.subplots(figsize=(6.4,4.8))

# Changed
fig, ax = plt.subplots(figsize=(5,3))

ax.plot([1000, 3000, 5000, 10000, 15000, 20000], [631, 825, 1185, 3285, 6653, 11315], '-r', marker='o', label='DiffPool')
ax.plot([1000, 3000, 5000, 10000, 15000, 20000, 25000, 30000], [611, 717, 913, 1811, 3289, 5311, 7925, 11101], '-g', marker='o', label='MinCutPool')
ax.plot([1000, 3000, 5000, 10000, 15000, 20000, 25000, 30000, 40000, 50000], [611, 611, 625, 663, 707, 731, 765, 797, 869, 939], '-m', marker='o', label='TopKPool')
ax.plot([1000, 3000, 5000, 10000], [689, 1343, 2653, 8621], c='orange', marker='o', label='StructPool')
ax.plot([1000, 3000, 5000, 10000, 15000, 20000, 25000, 30000, 40000, 50000], [611, 659, 685, 879, 1029, 1153, 1297, 1431, 1723, 2067], c='salmon', marker='o', label='EdgePool')
ax.plot([1000, 3000, 5000, 10000, 15000, 20000, 25000, 30000, 40000, 50000], [625, 643, 693, 761, 849, 915, 989, 1059, 1219, 1371], '-b', marker='o', label='GMT (Ours)')

# for OOM
ax.plot([25000, 30000, 40000, 50000], [11315, 11315, 11315, 11315], 'rx')
ax.plot([40000, 50000], [11101, 11101], 'gx')
ax.plot([15000, 20000, 25000, 30000, 40000, 50000], [8621, 8621, 8621, 8621, 8621, 8621], c='orange', marker='x', linestyle='')

ax.axis([0, 52500, 0, 12500])

ax.tick_params(axis='both', which='major', labelsize=18)
ax.tick_params(axis='both', which='minor', labelsize=15)

# legend = ax.legend(loc='upper left', prop={'size': 13}, bbox_to_anchor=(0.1, 1.3), ncol=2, handleheight=0.5, labelspacing=0.05, facecolor='white', framealpha=1)
legend = ax.legend(loc='upper left', prop={'size': 11}, bbox_to_anchor=(-0.02, 1.3), ncol=3, handleheight=0.5, labelspacing=0.05, facecolor='white', framealpha=1,
                   columnspacing=0.5)

plt.xlabel('# Nodes', fontsize=22)
plt.ylabel('# Memory (Mib)', fontsize=22)
plt.grid(True, alpha=0.3)

plt.subplots_adjust(left=0.175, bottom=0.22, right=0.985, top=0.83)

plt.ticklabel_format(style='sci', axis='both', scilimits=(0,0))
ax.get_yaxis().get_offset_text().set_position((-0.1,0))

plt.savefig('./images/temp.png', dpi=200)
plt.savefig('./images/temp.pdf')
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt

matplotlib.rc('font', size=15)

# # Default
# fig, ax = plt.subplots(figsize=(6.4,4.8))

# Changed
fig, ax = plt.subplots(figsize=(5,3))
# fig, ax = plt.subplots(figsize=(15,9))

with open("report.txt", 'r') as f:
    logs = f.readlines()

models = ['MinCutPool', 'TopKPool', 'StructPool', 'EdgePool', 'HaarPool', 'Global_PSP']
model_to_logs = {}
for model in models:
    model_to_logs[model] = []

max_time = -1
min_time = 1000

for log in logs:
    log = log.strip().split(',')
    if log[0] not in models:
        continue

    if len(log) == 4:
        epoch = int(log[-1])
    else:
        epoch = 10
    time = float(log[2]) / float(epoch)
    # time = math.log10(time)
    if time > max_time:
        max_time = time
    if time < min_time:
        min_time = time

    if int(log[1]) > 1000:
        continue

    model_to_logs[log[0]].append((int(log[1]), time))

# min_time = min(0, min_time)

color = ['g', 'r', 'm', 'c', 'orange', 'b']

ax.plot([800, 900, 1000], [1.1825729714008049, 1.1825729714008049, 1.1825729714008049], 'mx')

for i, model in enumerate(models):

    if model == 'Global_PSP':
        label = 'GMT (Ours)'
    else:
        label = model

    ax.plot([x[0] for x in model_to_logs[model]], [x[1] for x in model_to_logs[model]], color=color[i], marker='o', label=label)

# for OOM
ax.plot([1000], [128.59316874993965], 'cx')
# ax.plot([40000, 50000], [11101, 11101], 'gx')

min_time = math.log10(min_time)
max_time = math.log10(max_time)
# ax.axis([200, 1100, min_time, max_time])
# ax.axis([200, 1100])
plt.xlim([200, 1025])

ax.tick_params(axis='both', which='major', labelsize=15)
ax.tick_params(axis='both', which='minor', labelsize=12)

# legend = ax.legend(loc='upper left', prop={'size': 13}, bbox_to_anchor=(0.1, 1.3), ncol=2, handleheight=0.5, labelspacing=0.05, facecolor='white', framealpha=1)
legend = ax.legend(loc='upper left', prop={'size': 11}, bbox_to_anchor=(-0.02, 1.3), ncol=3, handleheight=0.5, labelspacing=0.05, facecolor='white', framealpha=1,
                   columnspacing=0.5)

plt.yscale('log')
plt.xlabel('# Nodes', fontsize=22)
plt.ylabel('Time (sec)', fontsize=22)
plt.grid(True, alpha=0.3)

plt.subplots_adjust(left=0.175, bottom=0.22, right=0.985, top=0.83)

# plt.ticklabel_format(style='sci', axis='both', scilimits=(0,0))
# plt.ticklabel_format(style='sci', axis='x', scilimits=(0,0))

plt.savefig('./images/temp.png', dpi=200)
plt.savefig('./images/temp.pdf')

from gmt.

realCrush avatar realCrush commented on August 30, 2024

Thank you!

from gmt.

realCrush avatar realCrush commented on August 30, 2024

Hi, it seems we need a file report.txt since you read it in line 15-16 (in you second code block):

with open("report.txt", 'r') as f:
    logs = f.readlines()

Could you find that file?

from gmt.

JinheonBaek avatar JinheonBaek commented on August 30, 2024

Yes, I found it.

MinCutPool,200,0.2733267149887979
MinCutPool,300,0.6444454189622775
MinCutPool,400,0.7400230660568923
MinCutPool,500,1.2900819840142503
MinCutPool,600,9.509350273059681
MinCutPool,700,10.011134122032672
MinCutPool,800,12.9637699900195
MinCutPool,900,13.655144226038828
MinCutPool,1000,17.418636401067488
MinCutPool,1100,19.294721700018272
DiffPool,200,0.289935969049111
DiffPool,300,0.5860068500041962
DiffPool,400,0.46314192505087703
DiffPool,500,0.8776361570926383
DiffPool,600,7.274572791066021
DiffPool,700,9.029437826946378
DiffPool,800,11.368384078028612
DiffPool,900,14.686787422047928
DiffPool,1000,17.086433116928674
DiffPool,1100,19.08682999899611
Global_PSP,200,0.2925415240461007
Global_PSP,300,0.6646514890016988
Global_PSP,400,0.7740594049682841
Global_PSP,500,1.9585885220440105
Global_PSP,600,8.486218261066824
Global_PSP,700,9.899331627995707
Global_PSP,800,12.778576432960108
Global_PSP,900,16.063793076900765
Global_PSP,1000,19.029446316999383
Global_PSP,1100,20.586135289049707
TopKPool,200,0.4096342899138108
TopKPool,300,0.4677019570954144
TopKPool,400,0.6381961150327697
TopKPool,500,1.7624713740078732
TopKPool,600,6.9512748250272125
TopKPool,700,10.660618075053208
TopKPool,800,11.67667623993475
TopKPool,900,13.65400811098516
TopKPool,1000,17.481171266990714
TopKPool,1100,18.137944153044373
StructPool,200,0.42638209892902523
StructPool,300,0.7738214880228043
StructPool,400,1.1902747260173783
StructPool,500,2.101313638035208
StructPool,600,8.497683405061252
StructPool,700,11.825729714008048
EdgePool,200,60.267253710888326
EdgePool,300,133.35788353497628
EdgePool,400,227.59507120703347
EdgePool,500,378.72136002907064
EdgePool,600,583.2073595869588
EdgePool,700,789.6687415459892
EdgePool,800,102.11950952198822,1
EdgePool,900,128.59316874993965,1
HaarPool,200,285.1396268159151,1
HaarPool,300,957.5407739210641,1
HaarPool,400,1909.633476507035,1
HaarPool,500,2669.1515704180347,1
HaarPool,600,4563.499295442016,1
HaarPool,700,8459.317894556094,1
HaarPool,800,12485.313604742987,1
HaarPool,900,15781.382588604,1
HaarPool,1000,16846.906700351043,1
HaarPool,1100,14569.883776415023,1

from gmt.

realCrush avatar realCrush commented on August 30, 2024

Thank you for you reply!

from gmt.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.