Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- GitHub
- Godot
- C
- error
- JS
- react
- RaspberryPi
- ruby
- gnuplot
- CPP
- gradle
- Python
- Android
- Vane
- plugin
- Java
- kotlin
- Shell
- 루비
- Spring
- Baekjoon
- ruby2d
- OAuth
- OTLanguage
- rubymine
- IntelliJ
- jetbrains
- boj
- 개발노트
- maven
Archives
- Today
- Total
PersesTitan(페르) 기술블로그
[Python] 시그모이드(sigmoid) 함수 그래프 구현하기 본문
관련된 글
[Python] sin, cos, tan 그래프 출력하기
import
numpy
- exp
자연지수 e
를 받은 값인x
승의 값을 반환해주는 라이브러리 입니다.
나머지 matplotlib.pyplot
, numpy
는 상단의 관련된 글
에서 확인해주세요.
코드
import matplotlib.pyplot as plt
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
array = np.arange(-10, 10, 0.1)
plt.axvline(x=0, color='r', linestyle='--', linewidth=1)
plt.axhline(y=0, color='r', linestyle='--', linewidth=1)
plt.plot(array, sigmoid(array))
plt.show()
출력
'Language > Python' 카테고리의 다른 글
[Python] 그래프 함수 이름 넣기 (0) | 2023.04.11 |
---|---|
[Python] 원하는 함수 그래프 출력하기 (0) | 2023.04.11 |
[Python] 파이썬 연립방정식 풀기 (0) | 2023.03.31 |
[Python] 파이썬 버전 변경 없이 pip install 하기 (0) | 2023.03.23 |
[Python] sin, cos, tan 그래프 출력하기 (2) | 2023.03.09 |