Deep Learning for NLP

Deep Learning for NLP

Lecture 2:Introduction to Teano

enter link description here

Neural Networks can be expressed as one long function of vector and matrix operations.

(神经网络可以表示为一个向量和矩阵运算的长函数。)

Common Frameworks(常用框架)

  • C/C++

    if you need maximum performance,start from scratch(如果你需要最高性能,那么就从头开始编程吧:)
  • Matlab
  • Caffe

    Ported Matlab’s implementation nets to C.(Caffe是纯粹的C++/CUDA架构,支持命令行、Python和MATLAB接口)

    Mainly used for machine-vision(主要用于机器视觉。)
  • Torch:

    Based on Lua,(基于Lua,)

    Used by a lot of companies(Google Deep Mind,Facebook,IBM)(被很多公司所使用,包括google深度大脑,facebook,IBM等等)
  • Theano

    Python based framework(python基本的框架)

    Main framework used in the research community(主要框架被用于研究团队)

    For comparison: http://fastml.com/torch-vs-theano/

Introduction to Theano

Advantage(优点)

  • Python library with tight integration of Numpy(python库Numpy的紧密集成)

    Easy syntax for matrix operations(简单的矩阵运算语法)
  • Transparent use of GPU(speed-up of up to 140x)(透明的GPU使用(加速140x))
  • Efficient symbolic differentiation(Theano computes the gradient)(有效的符号微分(Theano计算梯度))
  • Speed and stability optimizations(速度和稳定性优化)
  • Calculations are dynamically mapped to C code(计算动态映射到C代码)

    We do our computations as fast as we would have written it in C (我们有跟我们用C代码写出来的程序一样快的运算速度)

    Great performance(>10 faster than Java in my experiments)(伟大的性能(比在我的实验中用Java还要快10倍))

Disadvantages(缺点)

  • Debugging is really hard(调试很困难)

Some note on the installation of Theano(Theano安装的一些注意事项)

  • Theano utilizes BLAS (Basic Linear Algebra Subprograms)(Theano利用BLAS(基本线性代数的子程序))

    Building blocks for fast vector and matrix operations(速度向量和矩阵运算的构建块)

    Often written in Fortran, sometimes in Assembler(经常用Fortran编写,但有时候用Assembler)
  • For performance optimization install a BLAS package(为优化性能安装一个BLAS包)
  • Benchmark different BLAS packages(不同BLAS包的基准不同)
  • I use a manually compiled OpenBlas implementation(我使用一个手动编译OpenBlas来实现)

    Installation notes: http://deeplearning.net/software/theano/install_ubuntu.html

Theano – Flow(Theano流程图)

The execution of a Theano script is a bit different(Theano脚本的执行略有不同)

Theano-Computation Graph(Theano计算图)

import theano
import theano.tensor as T

a=T.fvector()
b=T.fvector()
c=T.fmatrix()

res1=a+b
res2=T.dot(res1,c)

Deep Learning for NLP学习翻译笔记(2)的更多相关文章

  1. (Stanford CS224d) Deep Learning and NLP课程笔记(一):Deep NLP

    Stanford大学在2015年开设了一门Deep Learning for Natural Language Processing的课程,广受好评.并在2016年春季再次开课.我将开始这门课程的学习 ...

  2. 【转】Deep Learning(深度学习)学习笔记整理系列之(一)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0  2013-0 ...

  3. Deep Learning(深度学习)学习笔记整理系列之(五)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  4. Deep Learning(深度学习)学习笔记整理系列之(八)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  5. Deep Learning(深度学习)学习笔记整理系列之(七)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  6. Deep Learning(深度学习)学习笔记整理系列之(六)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  7. Deep Learning(深度学习)学习笔记整理系列之(四)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  8. Deep Learning(深度学习)学习笔记整理系列之(三)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  9. Deep Learning(深度学习)学习笔记整理系列之(二)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

随机推荐

  1. C#的Split用法

    1.用字符串分隔: using System.Text.RegularExpressions;string str="aaajsbbbjsccc";string[] sArray= ...

  2. sqlserver数据库差异比较

    相信这个功能会对好多网友有帮助,不得不说vs的功能很强大,废话不多说,切入正题 我们可以使用 vs自带的工具比较两个数据库的架构差异和数据差异,这篇文章只是写了架构的差异,我相信看完以后, 如何进行数 ...

  3. 8种排序算法的C#实现

    排序是将一个数据元素(或记录)的任意序列,重新排列成一个按关键字有序的序列.排序根据涉及的存储器的不同分为内部排序和外部排序:内部排序是指待排序记录存放在内存进行的排序过程:外部排序是指待排序记录的数 ...

  4. EC读书笔记系列之12:条款22、23、24

    条款22 将成员变量声明为private 记住: ★切记将成员变量声明为private.这可赋予客户访问数据的一致性.可细微划分访问控制.允诺约束条件获得保证,并提供class作者以充分的实现弹性. ...

  5. 什么是JSON对象

    1.什么是json? JSON全称是JavaScript Object Notation,是一种轻量级的数据交换格式.JSON 与XML具有相同的特性,是一种数据存储格式,但是JSON相比XML 更易 ...

  6. Python核心编程笔记--随机数

    #第一步引入模块 import random #第二步生成随机数 print random.randint(1,3);#[1,2,3]注意这里是闭区间.

  7. rownum的使用-分页

    rownum的使用-分页 oracle分页显示方法 一.使用rownum分页显示方式 方式1:SELECT *  FROM (SELECT ROWNUM r, a.* FROM b$i_exch_in ...

  8. J2SE知识点摘记(二十二)

    Map 1.4.1        概述 数学中的映射关系在Java中就是通过Map来实现的.它表示,里面存储的元素是一个对(pair),我们通过一个对象,可以在这个映射关系中找到另外一个和这个对象相关 ...

  9. WPF中的触发器简单总结

    原文 http://blog.sina.com.cn/s/blog_5f2ed5cb0100p3ab.html 触发器,从某种意义上来说它也是一种Style,因为它包含有一个Setter集合,并根据一 ...

  10. Android系统Recovery工作原理之使用update.zip升级过程---updater-script脚本语法简介以及执行流程(转)

    目前update-script脚本格式是edify,其与amend有何区别,暂不讨论,我们只分析其中主要的语法,以及脚本的流程控制. 一.update-script脚本语法简介: 我们顺着所生成的脚本 ...