[DL] Softsign : tanh의 유사품

2023. 8. 15. 17:53·.../Math
728x90
728x90

hyperbolic tangent (=tanh)와 유사한 함수.

tanh 대신 activation function으로 사용되는 경우도 있음.

$$\text{softsign}(x)=\frac{x}{1+|x|}$$

softsign의 derivative는 다음과 같음.

$$\dfrac{d}{dx}\text{softsign}(x)=\dfrac{1}{\left(1+|x|\right)^2}$$


차트 비교


관련소스

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-20.,20., 100)
softsign = x/ (1.+np.abs(x))
logistic = 1/ (1+np.exp(-x))
tanh = np.tanh(x)

fig,ax = plt.subplots(1,1)
ax.plot(x,softsign, label='soft sign')
ax.plot(x,logistic, label='logistic')
ax.plot(x,tanh, label='tanh')
ax.legend()
ax.grid()

참고자료들

2023.08.13 - [Computer] - [DL] Hyperbolic Tangent Function (tanh)

 

[DL] Hyperbolic Tangent Function (tanh)

logistic function과 함께 sigmoid의 대표적인 함수가 바로 $\text{tanh}$임. 값이 $[-1,1]$의 range를 가지며, logistic에 비해 기울기가 보다 급격하기 때문에 좀 더 빠른 수렴속도를 보임. 하지만, sigmoid의 일종

dsaint31.tistory.com

2022.12.28 - [.../Math] - [Math] Sigmoid function

 

[Math] Sigmoid function

S자형 곡선을 갖는 함수. (대표적인 예가 logistic function이나 sigmoid는 다음과 같이 여러 종류가 있음) Artificial Neural Network의 Artificial Neron의 Activation function으로 초창기에 많이 사용되었음. Logistic dist

dsaint31.tistory.com

https://gist.github.com/dsaint31x/9de184e851b49f3f3232b0498648bc0c

 

math_softsign.ipynb

math_softsign.ipynb. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

 

'... > Math' 카테고리의 다른 글

[Math] The Cauchy-Schwarz Inequality  (0) 2023.08.22
[Math] Bernoulli Distribution (베르누이 분포)  (0) 2023.08.17
[Math] Random Variable의 연산에 따른 Mean과 Variance.  (0) 2023.08.14
[Math] log의 base 변환하기.  (0) 2023.08.13
[Math] log (logarithmic) function  (0) 2023.08.13
'.../Math' 카테고리의 다른 글
  • [Math] The Cauchy-Schwarz Inequality
  • [Math] Bernoulli Distribution (베르누이 분포)
  • [Math] Random Variable의 연산에 따른 Mean과 Variance.
  • [Math] log의 base 변환하기.
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (740)
      • Private Life (13)
      • Programming (186)
        • DIP (104)
        • ML (26)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (351)
        • Signals and Systems (103)
        • Math (172)
        • Linear Algebra (33)
        • Physics (42)
        • 인성세미나 (1)
      • 정리필요. (54)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (1)
        • PET Study 2009 (1)
        • 방사선 장해방호 (4)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    SIGNAL
    numpy
    검사
    Optimization
    math
    fourier transform
    Vector
    signal_and_system
    Term
    SS
    Probability
    Convolution
    signals_and_systems
    linear algebra
    random
    opencv
    인허가제도
    function
    Programming
    Python
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[DL] Softsign : tanh의 유사품
상단으로

티스토리툴바