theano学习——基本api
来源:互联网 发布:nginx http referer 编辑:程序博客网 时间:2024/06/15 13:48
theano 中数据类型与numpy 中的数据类型相互转化
(1)numpy ==> theano
x = theano.shared(np.ones(3))
(2)theano ==> numpy(numpy.ndarray,多维数组)
y = x.get_value()
theano.shared(borrow 参数)
考察其中的borrow参数(np.array vs np.asarray),涉及深拷贝和浅拷贝的区别:
import theano, numpynp_array = numpy.ones(2, dtype='float32')s_default = thenao.shared(np_array)s_false = theano.shared(np_array, borrow=False)s_true = theano.shared(np_array, borrow=True)
np_array += 1print(s_default.get_value())print(s_false.get_value())print(s_true.get_value())
[1. 1.][1. 1.][2. 2.]
theano.tensor.flatten(x, outdim=1)
详细文档见 flatten
x.shape == (2, 3, 4, 5)y = flatten(x, outdim=2)y.shape == (2, 3*4*5=60)
0 0
- theano学习——基本api
- theano学习——数据类型
- 【theano-windows】学习笔记一——theano中的变量
- 【theano-windows】学习笔记三——theano中的导数
- theano学习——内置数据类型
- theano学习笔记(1)—代数
- 【theano-windows】学习笔记二——theano中的函数和共享参数
- 【theano-windows】学习笔记四——theano中的条件语句
- 【theano-windows】学习笔记五——theano中张量部分函数
- 【theano-windows】学习笔记六——theano中的循环函数scan
- 【theano-windows】学习笔记十一——theano中与神经网络相关函数
- Theano——shared
- 7.API学习——基本数据类型包装类
- Theano学习笔记(一)——代数
- Theano学习笔记(三)——图结构
- Theano学习笔记(四)——导数
- 利用Theano理解深度学习——Logistic Regression
- 利用Theano理解深度学习——Multilayer Perceptron
- 如何设计一个 iOS 控件?(iOS 控件完全解析)
- armeabi-v7a armeabi arm64-v8a
- Maven的初步详解
- Spring Security通过URL模式匹配的声明式权限控制
- C++11 JNI开发中RAII的应用(二)--JNI函数封装
- theano学习——基本api
- 各种语言的介绍
- sql server 2008无人值守安装
- Editext特效跟随输入文字展现动画
- winsock错误-头文件包含顺序
- http://blog.csdn.net/ryantang03/article/details/9317499/
- linux安装 并卸载jdk
- ViewPager与其中的子View滑动冲突
- iOS导航栏使用