欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

已知热力图数据绘制热力图

程序员文章站 2022-05-19 15:19:02
...
import matplotlib.pyplot as plt
import pandas as pd
from pandas.core.frame import DataFrame
from pandas.core.indexes.base import Index
import seaborn

models=['d-tcm-hsh','d-tcm-hdh','d-chp-hsh','d-chp-hfh','dm-chp','dm-tcm']
embed_size=[str(int(64*pow(2,i))) for i in range(1,6)]

data=[
    [4667,	4278,	5279,	5574,	5361,	5444],
[5556,	4556,	5508,	6295,	6393,	5944],
[5917,	5472,	5689,	6787,	6557,	6500],
[6222,	5611,	6164,	6770,	6951,	6611],
[6083,	5667,	5836,	6492,	6721,	6500],
]
data=pd.DataFrame(data,index=embed_size,columns=models)
seaborn.heatmap(data,cmap='hot_r')

plt.title("heatmap")

plt.xlabel("models")
plt.xticks(rotation=30)

plt.ylabel("embed size")
plt.show()
相关标签: pytorch