0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

(Python)sigmoid関数と偏微分のグラフの壁画

0
Posted at

sigmoid関数

sigmoid_fnc.py
import numpy as np
import matplotlib.pylab as plt # import library

def sigmoid(x):
    return 1 / (1 + np.exp(-x)) # define sigmoid function

x = np.arange(-3.0, 3.0, 0.1)
y = sigmoid(x)
plt.plot(x, y)
plt.ylim(-0.1, 1.1)
plt.show()

偏微分

pertial_derivative.py
from mpl_toolkits.mplot3d import Axes3D
# import numpy as np
# import matplotlib.pylab as plt

def pertial_derivative(x,y):
    return x**2 + y**2

# x = np.arange(-3.0, 3.0, 0.1)
y = np.arange(-3.0, 3.0, 0.1)

X, Y= np.meshgrid(x,y)
Z = pertial_derivative(X, Y)
fig = plt.figure()
ax = Axes3D(fig)
ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("f(x, y)")
ax.plot_wireframe(X, Y, Z)
# plt.show()

共通している部分はコメントアウトしています。
自分の学習の記録なので知識として誤りがあるかもしれません。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?