Pythonでの引数について質問です。
最近pythonをやりはじめまして、シグモイド関数における引数の意味がよく分からず・・・
Python
1import matplotlib.pyplot as plt 2import numpy as np 3import math 4 5def sigmoid(a): 6 s = 1 / (1 + e**-x) 7 return s 8 9e = math.e 10dx = 0.1 11 12x = np.arange(-8, 8, dx) 13 14# y_sig = 1 / (1 + e**-x) 15 16y_sig = sigmoid(x) 17 18plt.plot(x, y_sig) 19plt.show()
こちらはシグモイド関数をaという関数で書いたものですが、
下から3行目のy_sig = sigmoid(x)がなぜxなのかが理解できず・・・
aではないなと思ったのですが、xの理由が分からずでして
どなたかご教示いただけますでしょうか。
よろしくお願いいたします
回答1件
あなたの回答
tips
プレビュー