博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
DeepLearning 知识点整理
阅读量:2338 次
发布时间:2019-05-10

本文共 655 字,大约阅读时间需要 2 分钟。

常用激活函数

import theanofrom keras import backend as Kimport 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()

这里写图片描述

你可能感兴趣的文章
栈和堆的具体区别
查看>>
如何判断一个点在矩形内
查看>>
析构函数何时被调用
查看>>
C++虚函数底层机制
查看>>
面试题:随机数生成、蓄水池抽样、海量数据、设计秒杀系统
查看>>
malloc (0)详解
查看>>
linux清除cache的方法
查看>>
memmove 和 memcpy的区别以及处理内存重叠问题
查看>>
费雪耶兹(Fisher–Yates) 也被称作高纳德( Knuth)随机置乱算法
查看>>
C/C++中变量的存储位置
查看>>
C++中四种强制类型转换区别详解
查看>>
RTTI
查看>>
linux gdb的详细用法 运行与断点
查看>>
删除vector中重复元素
查看>>
和为s的连续正数序列
查看>>
什么是Redis?什么是nosql?NoSQL数据库的四大分类
查看>>
为什么说Redis是单线程的以及Redis为什么这么快!
查看>>
redis的过期健删除策略以及内存淘汰机制
查看>>
redis 双写一致性问题
查看>>
map 如何使用结构体作为自定义键值
查看>>