激励函数的绘制

import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt


x_vals = np.linspace(start=-10.,stop=10., num=100)
with tf.Session() as sess:
	y_logis =sess.run(tf.add(1.0/(1+np.exp(-x_vals)), 0))

plt.plot(x_vals, y_logis, 'r--', label='logistic', linewidth=2)
plt.legend(loc="top left")
plt.figure(figsize=(4, 4))

plt.axis('scaled')
plt.show()

效果图:

激励函数的绘制_第1张图片

你可能感兴趣的:(激励函数的绘制)