인공지능 관련

sigmoid함수 시각화

PGNV 2021. 4. 29. 15:18
import numpy as np
import math
import tensorflow as tf
import matplotlib.pyplot as plt

def sigmoid(x):
  return 1/ (1+math.exp(-x))


A = []
D = [x for x in range(-10, 11, 1)]
print(D)

for x in D:
  A.append(sigmoid(x))

plt.plot(D, A, 'k--')
plt.show()