| import matplotlib.pyplot as plt |
| import numpy as np |
|
|
| |
| modalities = ["Image", "VisDoc", "Video"] |
| lora_8 = [62.7, 52.5, 32.4] |
| lora_16 = [63.2, 52.6, 33.5] |
| lora_32 = [60.0, 52.1, 32.7] |
|
|
| |
| x = np.array([0, 1, 2]) |
| bar_width = 0.2 |
| offset = 0.24 |
|
|
| |
| plt.rcParams['font.family'] = 'DejaVu Sans' |
| plt.rcParams['font.size'] = 14 |
|
|
| |
| plt.figure(figsize=(7, 6)) |
| bars1 = plt.bar(x - offset, lora_8, bar_width, label='LoRA 8', color='#1f77b4') |
| bars2 = plt.bar(x, lora_16, bar_width, label='LoRA 16', color='#ff7f0e') |
| bars3 = plt.bar(x + offset, lora_32, bar_width, label='LoRA 32', color='#2ca02c') |
|
|
| |
| plt.xticks(x, modalities, fontsize=16) |
| plt.yticks(fontsize=16) |
| plt.xlabel("Modality", fontsize=18) |
| plt.ylabel("Performance", fontsize=18) |
| plt.title("Performance under Different LoRA Ranks", fontsize=18) |
| plt.ylim(30, 70) |
|
|
| |
| for bars in [bars1, bars2, bars3]: |
| for bar in bars: |
| height = bar.get_height() |
| plt.text(bar.get_x() + bar.get_width() / 2, height + 0.5, |
| f'{height:.1f}', ha='center', va='bottom', fontsize=14) |
|
|
| |
| plt.legend(frameon=False, fontsize=14) |
| plt.grid(axis='y', linestyle='--', alpha=0.6) |
| plt.tight_layout() |
|
|
| |
| plt.savefig("lora_rank_comparison_y30_wider.pdf", format='pdf', dpi=300) |
| plt.show() |
|
|