资源简介
python语言画出Sigmoid,Tanh,RuLe函数图像,实现图像的可视化
代码片段和文件信息
# -*- coding: utf-8 -*-
“““
Created on Sun Nov 25 00:31:13 2018
@author: csu66
“““
#!/usr/bin/python #encoding:utf-8
import math
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
mpl.rcParams[‘axes.unicode_minus‘]=False
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
fig = plt.figure(figsize=(64))
ax = fig.add_subplot(111)
x = np.linspace(-10 10)
y = sigmoid(x)
def ReLu(x):
return np.where(x<=00x)
fig = plt.figure(figsize=(64))
ax = fig.add_subplot(111)
x = np.arange(-1
评论
共有 条评论