DeepLearning 知识点整理

本文探讨了在神经网络中常用的激活函数如softmax、softplus、ReLU、tanh、sigmoid、hard_sigmoid和linear的功能及其在不同场景下的应用。

常用激活函数

import theano
from keras import backend as K
import keras.activations as A

#
from pylab import *
x = theano.tensor.dmatrix()
softmax = theano.function([x], A.softmax(x))
softplus = theano.function([x], A.softplus(x))
relu = theano.function([x], A.relu(x))
tanh = theano.function([x], A.tanh(x))
sigmoid = theano.function([x], A.sigmoid(x))
hard_sigmoid = theano.function([x], A.hard_sigmoid(x))
linear = theano.function([x], A.linear(x))
xv = np.array([range(-20, 20)])
for i, fn in enumerate(["softmax", "softplus", "relu", "tanh", "sigmoid", "hard_sigmoid", "linear"]):
    plt.subplot(3, 3, i + 1)
    plt.title(fn)
    plt.plot(xv[0], eval(fn)(xv)[0])

plt.show()

这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值