File size: 1,479 Bytes
246c106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

# Sample data based on the provided image structure
tasks = [ "Add", "Concat", "Cross Attention", "Modulation"]
values = np.array([
    [0.46],
    [0.18],
    [0.02],
    [1.87],
])
# Bar colors matching the provided image
bar_colors = ['#1f78b4', '#a6cee3', '#1f78b4', '#ffffff', '#cab2d6', '#b3b3cc', '#33a02c']

# Plotting the data
fig, ax = plt.subplots(figsize=(5, 3))

# Set bar width and x positions for each group
bar_width = 0.4
x = np.arange(len(tasks))

# Plot each group's bars with the specified colors
for i in range(values.shape[1]):
    bars = ax.bar(x + i * bar_width, values[:, i], width=bar_width,  color=bar_colors[i], edgecolor='black')

for container in ax.containers:
    ax.bar_label(container, label_type="edge", fontsize="x-large", fmt="%.2f")
bars[-1].set_color('#cab2d6')
bars[-1].set_edgecolor('black')

# Set titles, labels, and ticks
# ax.set_title("Zero-Shot Performance Comparison Across Tasks")
ax.set_xlabel("Model", fontsize=14)
ax.set_ylabel("Delta PSNR", fontsize=14)
ax.set_xticks(x )
ax.tick_params(axis='x', rotation=15)  
ax.set_xticklabels(tasks, fontsize=12)
ax.set_ylim(0, values.max() + 0.2)

# Adding the legend outside the plot area
# ax.legend(loc='upper center', bbox_to_anchor=(0.5, 1.15), ncol=3)

# Display the plot
plt.tight_layout()
# plt.show()
plt.savefig("output/arch_ablation_controllability.png", dpi=300)