import matplotlib.pyplot as plt
import numpy as np
#支持中文显示
from pylab import *
from matplotlib import rcParams
from matplotlib.font_manager import FontProperties
import matplotlib.pyplot as plt
myfont = FontProperties(fname='/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc',size=12)
rcParams['axes.unicode_minus']=False #解决负号'-'显示为方块的问题
mpl.rcParams['font.sans-serif'] = ['SimHei']
# x= [0,1,'200k','300k','400k','500k','600k',
# '700k','800k','900k','1M','1.1M','1.2M','1.3M','1.4M'
# ,'1.5M','1.6M','1.7M']
x = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
x1 = [0,1,2,3,4,5,6]
x2 = [0,1,2,3,4,5,6,7,8,9,10,11,12]
x3 = [12,13,14,15,16,17]
# x1 = ['0k','100k','200k','300k','400k','500k','600k']
# x2 = ['0k','100k','200k','300k','400k','500k','600k',
# '700k','800k','900k','1M','1.1M','1.2M']
# x3 = ['1.2M','1.3M','1.4M','1.5M','1.6M','1.7M']
#x=[3,4]
y=np.linspace(0,1,11)
y1=[1,1,1,1,0.5,0.25,0.125]
y2=[1,1,1,1,1,0.5,0.5,0.25,0.25,0.125,0.125,0.0625,0.0625]
y3=[0.1,0.1,0.05,0.025,0.0125,0.0125]
plt.scatter([6],[0.125], s=100, color='r', zorder=2,marker='x')
plt.scatter([12,17],[0.0625,0.0125], s=100, color='r', zorder=2,marker='x')
plt.step(x1,y1,color='red', linewidth=2.0)
plt.step(x2,y2,color='green', linewidth=2.0)
plt.step(x3,y3,color='orange', linewidth=2.0)
plt.step([12,12],[0.0625,0.1],color='orange', linewidth=2.0)
plt.xlim((0, 18))
plt.ylim((0, 1.1))
plt.yticks(y)
plt.xticks(x)
plt.xticks(fontproperties = 'Times New Roman', size = 14)
# mngr = plt.get_current_fig_manager()
# mngr.window.setGeometry(0,0,1000, 1200)
# plt.tight_layout()
plt.xlabel(u'迭代次数',fontproperties=myfont)
plt.ylabel(u'学习率',fontproperties=myfont)
plt.legend([u'短学习率',u'长学习率',u'微调学习率'],loc='upper right',prop=myfont)
plt.text(0.1,1.1, r'$x10^{-4}$', fontsize=13)
plt.text(16,-0.15, r'$x10^{5}$', fontsize=13)
# plt.savefig('scheme.png',dpi=600)
plt.show()
import matplotlib.pyplot as plt
import numpy as np
#支持中文显示
from pylab import *
from matplotlib import rcParams
from matplotlib.font_manager import FontProperties
import matplotlib.pyplot as plt
myfont = FontProperties(fname='/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc',size=12)
rcParams['axes.unicode_minus']=False #解决负号'-'显示为方块的问题
mpl.rcParams['font.sans-serif'] = ['SimHei']
# x= ['0k','25k','50k','75k','100k','125k','150k','175k',
# '200k','225k','250k','275k','300k']
x= [0,0.5,1,1.5,2,2.5,3]
x1 = [0,0.45,0.65,0.85,0.95,0.975,1,1.1,1.2,1.3,1.4,1.5]
x2 = list(np.array(x1)+1.5)
y=np.linspace(0,3,4)
# y=[1,2,3]
y2=[]
y1=[3.0,3.0, 1.5, 0.75, 0.375, 0.1875,
0.09375, 0.046875, 0.0234375, 0.01171875, 0.005859375, 0.0029296875]
y2=[2.0,2.0, 1.0, 0.5, 0.25, 0.125, 0.0625, 0.03125,
0.015625, 0.0078125, 0.00390625, 0.001953125]
plt.step(x1,y1,color='red', linewidth=2.0)
plt.step(x2,y2,color='red', linewidth=2.0)
plt.step([1.5,1.5],[0,2],color='red', linewidth=2.0)
# plt.show()
plt.xlim((0, 3))
plt.ylim((0, 3.1))
plt.yticks(y)
plt.xticks(x)
plt.yticks(fontproperties = 'Times New Roman', size = 14)
plt.xticks(fontproperties = 'Times New Roman', size = 14)
# mngr = plt.get_current_fig_manager()
# mngr.window.setGeometry(0,0,1000, 1200)
plt.xlabel(u'迭代次数',fontproperties=myfont)
plt.ylabel(u'学习率',fontproperties=myfont)
# plt.legend([u'短学习率',u'长学习率',u'微调学习率'],loc='upper right',prop=myfont)
plt.text(0.01,3.1, r'$x10^{-5}$', fontsize=14)
plt.text(2.6,-0.4, r'$x10^{5}$', fontsize=14)
plt.tight_layout()
plt.savefig('sintel.png',dpi=600)
# plt.show()
import matplotlib.pyplot as plt
import numpy as np
#支持中文显示
from pylab import *
from matplotlib import rcParams
from matplotlib.font_manager import FontProperties
import matplotlib.pyplot as plt
myfont = FontProperties(fname='/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc',size=12)
rcParams['axes.unicode_minus']=False #解决负号'-'显示为方块的问题
mpl.rcParams['font.sans-serif'] = ['SimHei']
# x= [0,1,'200k','300k','400k','500k','600k',
# '700k','800k','900k','1M','1.1M','1.2M','1.3M','1.4M'
# ,'1.5M','1.6M','1.7M']
x = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
x1 = [0,1,2,3,4,5,6]
x2 = [0,1,2,3,4,5,6,7,8,9,10,11,12]
x3 = [12,13,14,15,16,17]
x4 = [17,17.45,17.65,17.85,17.95,17.975,18,18.1,18.2,18.3,18.4,18.5]
x5 = list(np.array(x4)+1.5)
# x1 = ['0k','100k','200k','300k','400k','500k','600k']
# x2 = ['0k','100k','200k','300k','400k','500k','600k',
# '700k','800k','900k','1M','1.1M','1.2M']
# x3 = ['1.2M','1.3M','1.4M','1.5M','1.6M','1.7M']
#x=[3,4]
y=np.linspace(0,1,11)
y1=[1,1,1,1,0.5,0.25,0.125]
y2=[1,1,1,1,1,0.5,0.5,0.25,0.25,0.125,0.125,0.0625,0.0625]
y3=[0.1,0.1,0.05,0.025,0.0125,0.0125]
y4=[0.3,0.3, 0.15, 0.075, 0.0375, 0.01875,
0.009375, 0.0046875, 0.00234375, 0.001171875, 0.0005859375, 0.00029296875]
y5=[0.2,0.2, 0.1, 0.05, 0.025, 0.0125, 0.00625, 0.003125,
0.0015625, 0.00078125, 0.000390625, 0.0001953125]
plt.scatter([6],[0.125], s=100, color='r', zorder=2,marker='x')
plt.scatter([12,17,20],[0.0625,0.0125,0.001953125], s=100, color='r', zorder=2,marker='x')
plt.step(x1,y1,color='red', linewidth=2.0)
plt.step(x2,y2,color='green', linewidth=2.0)
plt.step(x3,y3,color='orange', linewidth=2.0)
plt.step(x4,y4,color='blue', linewidth=2.0)
plt.step(x5,y5,color='blue', linewidth=2.0)
plt.step([12,12],[0.0625,0.1],color='orange', linewidth=2.0)
plt.step([17,17],[0.0125,0.3],color='blue', linewidth=2.0)
plt.step([18.5,18.5],[0.00029296875,0.2],color='blue', linewidth=2.0)
plt.xlim((0, 21))
plt.ylim((0, 1.1))
plt.yticks(y)
plt.xticks(x)
plt.xticks(fontproperties = 'Times New Roman', size = 14)
# mngr = plt.get_current_fig_manager()
# mngr.window.setGeometry(0,0,1000, 1200)
# plt.tight_layout()
plt.xlabel(u'迭代次数',fontproperties=myfont)
plt.ylabel(u'学习率',fontproperties=myfont)
plt.legend([u'短学习策略',u'长学习策略',u'微调学习策略A',u'微调学习策略B'],loc='upper right',prop=myfont)
plt.text(0.1,1.1, r'$x10^{-4}$', fontsize=13)
plt.text(16,-0.15, r'$x10^{5}$', fontsize=13)
plt.savefig('scheme.png',dpi=600)
# plt.show()