-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintelPythonBenchmarksGraphs.py
79 lines (66 loc) · 2.28 KB
/
intelPythonBenchmarksGraphs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from os import closerange
import pandas as pd
import matplotlib.pyplot as plt
import argparse
plt.style.use('fivethirtyeight')
ap = argparse.ArgumentParser()
ap.add_argument("-s", "--show", required=True,
help="to show or not")
args = vars(ap.parse_args())
df = pd.read_csv('./intelPythonBenchmarks.csv')
df_sklearn = df.loc[df['Test'] == 'Sklearn']
y_data = [float(df_sklearn['Intel']), float(df_sklearn['Normal'])]
plt.figure(figsize=(20, 9), dpi=100)
graph = plt.barh(['Intel Python', 'Python'], y_data)
for index, value in enumerate(y_data):
plt.text(value, index, str(value))
graph[0].set_color('g')
graph[1].set_color('r')
plt.ylabel('Version of Python')
plt.xlabel('Time in seconds')
plt.title('Sklearn Benchmarks with Intel Python')
plt.savefig('sklearn.png')
if args['show'] == "true":
plt.show()
df_tf = df.loc[df['Test'] == 'TensorFlow']
y_data = [float(df_tf['Intel']), float(df_tf['Normal'])]
plt.figure(figsize=(20, 9), dpi=100)
graph = plt.barh(['Intel Python', 'Python'], y_data)
for index, value in enumerate(y_data):
plt.text(value, index, str(value))
graph[0].set_color('g')
graph[1].set_color('r')
plt.ylabel('Version of Python')
plt.xlabel('Time in seconds')
plt.title('TensorFlow Benchmarks with Intel Python')
plt.savefig('tensorflow.png')
if args['show'] == "true":
plt.show()
df_pyt = df.loc[df['Test'] == 'PyTorch']
y_data = [float(df_pyt['Intel']), float(df_pyt['Normal'])]
plt.figure(figsize=(20, 9), dpi=100)
graph = plt.barh(['Intel Python', 'Python'], y_data)
for index, value in enumerate(y_data):
plt.text(value, index, str(value))
graph[0].set_color('g')
graph[1].set_color('r')
plt.ylabel('Version of Python')
plt.xlabel('Time in seconds')
plt.title('PyTorch Benchmarks with Intel Python')
plt.savefig('pytorch.png')
if args['show'] == "true":
plt.show()
df_pan = df.loc[df['Test'] == 'Pandas']
y_data = [float(df_pan['Intel']), float(df_pan['Normal'])]
plt.figure(figsize=(20, 9), dpi=100)
graph = plt.barh(['Intel Python', 'Python'], y_data)
for index, value in enumerate(y_data):
plt.text(value, index, str(value))
graph[0].set_color('g')
graph[1].set_color('r')
plt.ylabel('Version of Python')
plt.xlabel('Time in seconds')
plt.title('Pandas Benchmarks with Intel Python')
plt.savefig('pandas.png')
if args['show'] == "true":
plt.show()