텐서플로 정리 3탄
# 그림 4.5 출력 코드 import math def sigmoid(x): return 1 / (1 + math.exp(-x)) x = np.arange(-5, 5, 0.01) sigmoid_x = [sigmoid(z) for z in x] tanh_x = [math.tanh(z) for z in x] relu = [0 if z < 0 else z for z in x] plt.axhline(0, color='gray') plt.axvline(0, color='gray') plt.plot(x, sigmoid_x, 'b-', label='sigmoid') plt.plot(x, tanh_x, 'r--', label='tanh') plt.plot(x, relu, 'g.', label='relu') plt.le..
텐서플로 정리 3탄
# 그림 4.5 출력 코드 import math def sigmoid(x): return 1 / (1 + math.exp(-x)) x = np.arange(-5, 5, 0.01) sigmoid_x = [sigmoid(z) for z in x] tanh_x = [math.tanh(z) for z in x] relu = [0 if z < 0 else z for z in x] plt.axhline(0, color='gray') plt.axvline(0, color='gray') plt.plot(x, sigmoid_x, 'b-', label='sigmoid') plt.plot(x, tanh_x, 'r--', label='tanh') plt.plot(x, relu, 'g.', label='relu') plt.le..
텐서플로 정리 2탄
선형회귀 아래코드는 지역별로 인구증가율과 고령인구비율을 그래프로 출력하는 코드이다. # 4.1 지역별 인구증가율과 고령인구비율 시각화 import matplotlib.pyplot as plt population_inc = [0.3, -0.78, 1.26, 0.03, 1.11, 15.17, 0.24, -0.24, -0.47, -0.77, -0.37, -0.85, -0.41, -0.27, 0.02, -0.76, 2.66] population_old = [12.27, 14.44, 11.87, 18.75, 17.52, 9.29, 16.37, 19.78, 19.51, 12.65, 14.74, 10.72, 21.94, 12.83, 15.51, 17.14, 14.42] plt.plot(population_inc,po..