
from w import *

def plot_tanhs():

    
    L=1
    
    x=np.linspace(-L,L,100)
    
    a=1
    y1=np.sign(x)*np.arcsinh(abs(x)*a)/a
    
    a=5
    y2=np.sign(x)*np.arcsinh(abs(x)*a)/a
    
    
    
    
    # c()
    plot(x,-x)
    plt.text(0.24,-1,r'$\Delta x_t = - \tilde{g}_t$',fontsize=ft1)
    
    
    a=1
    y3=np.tanh(x/a)*a
    plot(x,-y3)
    plt.text(0.65,-0.64,r'$\gamma=1$',fontsize=ft1)
    
    a=0.50
    y3=np.tanh(x/a)*a
    plot(x,-y3)
    plt.text(0.6,-0.35,r'$\gamma=0.5$',fontsize=ft1)
    
    
    a=0.10
    y3=np.tanh(x/a)*a
    plot(x,-y3)
    plt.text(0.6,0,r'$\gamma=0.1$',fontsize=ft1)
    

    
    
    plt.xlabel(r'Gradient feature $\tilde{g}_t$',fontsize=19)
    plt.ylabel(r'$\Delta x_t$',fontsize=19)
    
    
    plt.text(0,0.8,'Function Series:',horizontalalignment='center', fontsize=19)
    plt.text(0,0.5,r'$-\gamma\cdot\tanh(\frac{\tilde{g}_t }{ \gamma})$',horizontalalignment='center', fontsize=19)
    
    
    
    
    
    
    

%matplotlib inline

ft1=16

c()
plt.axes([0,0,0.6,1])


plot_tanhs()
plt.savefig('tanhs.pdf', bbox_inches='tight')


