[Theano] Theano初探
1. Theano用来干嘛的?
Theano was written at the LISA lab to support rapid development of efficient machine learning algorithms. Theano is named after the Greek mathematician, who may have been Pythagoras’ wife. Theano is released under a BSD license (link).
加快处理多维数组计算。Theano is a Python library that lets you to define, optimize, and evaluate mathematical expressions, especially ones with multi-dimensional arrays (numpy.ndarray). Using Theano it is possible to attain speeds rivaling hand-crafted C implementations for problems involving large amounts of data. It can also surpass C on a CPU by many orders of magnitude by taking advantage of recent GPUs.
Theano’s compiler applies many optimizations of varying complexity to these symbolic expressions. These optimizations include, but are not limited to:
- use of GPU for computations
- constant folding
- merging of similar subgraphs, to avoid redundant calculation
- arithmetic simplification (e.g.
x*y/x -> y
,--x -> x
) - inserting efficient BLAS operations (e.g.
GEMM
) in a variety of contexts - using memory aliasing to avoid calculation
- using inplace operations wherever it does not interfere with aliasing
- loop fusion for elementwise sub-expressions
- improvements to numerical stability (e.g.
and
)
- for a complete list, see Optimizations
2. 安装Theano
我用的是Ubuntu,所以戳Easy Installation of an Optimized Theano on Current Ubuntu. (其它系统见Installing Theano)
直接用下面指令就安装完成了
For Ubuntu 11.10 through 14.04:
#sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
#sudo pip install Theano
3. 测试一下logistic function
import theano
import theano.tensor as T
x = T.dmatrix('x')
s = 1 / (1 + T.exp(-x))
logistic = theano.function([x], s)
logistic([[0, 1], [-1, -2]])
如果没有报错就完成了
[Theano] Theano初探的更多相关文章
- 手把手教你搭建深度学习平台——避坑安装theano+CUDA
python有多混乱我就不多说了.这个混论不仅是指整个python市场混乱,更混乱的还有python的各种附加依赖包.为了一劳永逸解决python的各种依赖包对深度学习造成的影响,本文中采用pytho ...
- Theano在windows下的安装及GPU加速
安装环境:wondows 64bit Teano安装测试 1. Anaconda 安装 Anaconda是一个科学计算环境,自带的包管理器conda很强大.之所以选择它是因为它内置了python,以及 ...
- linux install Theano+Tensorflow+Keras
安装过程中,网络状态一定要好,如果安装过程中出现time out的提示信息,今天就可以洗洗睡啦,等明天网络状态好的时候再安装. 安装过程出现不知名的错误的时候,执行第一步,update一下 1.#up ...
- Ubuntu-安装-theano+caffe-超详细教程
一.说明 本文是继<Ubuntu-安装-cuda7.0-单显卡-超详细教程> 之后的续篇.theano和caffe是深度学习库,对运算能力需求很大,最好使用cuda进行加速.所以,请先阅读 ...
- win7+theano with GPU enabled
要做卷积神经网络的一些东西,所以要装theano,网上很多Theano安装教程版本较老,而各安装包更新很快,参考价值有限.走了很多弯路才装好,把这个过程记录下来,希望对大家有帮助~ ~ 我的配置:wi ...
- theano + gpu
Teano安装测试 1. Anaconda 安装 Anaconda是一个科学计算环境,自带的包管理器conda很强大.之所以选择它是因为它内置了python,以及numpy.scipy两个必要库和一些 ...
- Theano在CentOS 6 下的安装及GPU加速
系统版本:Red Hat 4.4.6-4 一. 未联网情况下,选择本地安装. 首先安装theano的依赖库,包括:scipy-0.16.1numpy-1.9.2nose-1.3.7 (optional ...
- 布置theano(Windows10,无cuda)
软件包准备 1.Anaconda 下载地址,包含python.numpy.scipy.nose.pip等包,嗯,很爽. 2.tdm64-gcc 下载地址,windows下的gcc.g++编译器,用来t ...
- 布置theano(Ubuntu14.04 LTS)
引言 由于研究生阶段将会从事自然语言处理方向的研究,目前要用到机器学习和深度学习相关的框架,那应老师的要求,将要使用theano,由于theano官方文档中关于ubuntu下配置的问题并没有给出很好的 ...
随机推荐
- jdbc - 连接数据库的url
MySql: driver:com.mysql.jdbc.Driver url: jdbc:mysql://localhost:3306/database_name SQL Server 2008: ...
- Oracle利用dbms_metadata.get_ddl查看DDL语句
当我们想要查看某个表或者是表空间的DDL的时候,可以利用dbms_metadata.get_ddl这个包来查看. dbms_metadata包中的get_ddl函数详细参数 GET_DDL函数返回创建 ...
- Java-生成验证码图片(自定义内容,尺寸,路径)
1 package cn.gp.tools; import java.awt.*; import java.awt.image.BufferedImage; import java.io.*; imp ...
- MySql数据库3【优化1】表的优化
一.表结构的优化 1.标准化 标准化是在数据库中组织数据的过程.其中包括,根据设计规则创建表并在这些表间建立关系:通过取消冗余度与不一致相关性,该设计规则可以同时保护数据并提高数据的灵活性.通常数据 ...
- js时间戳转为日期格式
转自:http://wyoojune.blog.163.com/blog/static/57093325201131193650725/ 这个在php+mssql(日期类型为datetime)+aja ...
- Notepad++插件之FingerText
FingerText是一个标签触发片段插件记事本.支持多个热点同时编辑,嵌套的热点,动态热点(很多不仅仅是纯文本的,可以通过命令,或触发另一个片段中的片段),热点的文本提示(而不是仅仅是$或#号)和热 ...
- Swift-MJ
1.声明变量 常量 声明变量:var age = 10 声明常量:let age = 10 (不加分号,除非多条语句写在同一行) 二进制前缀:0b(必须小写) 八进制前缀:0o 十六进制前缀:0x 2 ...
- fragment 学习
fragment需要id是必须属性 <fragment android:id="@+id/frg1" android:name="com ...
- An endpoint configuration section for contract "serviceReferenc.service" could not be loaded
场景:有一个WCF应用,添加服务引用后,自动生成一个app.config文件,当调用WCF时,它抛出一个错误: An endpoint configuration section for contra ...
- Egret 双端接入爱贝支付遇到的问题
首先要为 egret 工程引入第三方库: Egret 接第三方库:http://edn.egret.com/cn/index.php?g=&m=article&a=index& ...