theano 编程细节(二)
来源:互联网 发布:计算机编程培训班 编辑:程序博客网 时间:2024/06/05 11:23
type/dtype
dtype:data type
>> x = T.matrix()>> x.typeTensorType(float64, matrix)>> x.dtype'float64'
numpy 下的多维数组到 theano.shared
Place the data into shared variables. This allows theano to copy the data to the GPU, if one is available.
def load_data_shared(filename='./data/mnist.pkl.gz'): with gzip.open(filename) as fp: training_data, valid_data, test_data = pickle.load(fp) def shared_data(data): shared_x = theano.shared( np.asarray(data[0], dtype=theano.config.floatX), borrow=True) shared_y = theano.shared( np.asarray(data[1], dtype=theano.config.floatX), borrow=True) return shared_x, share_y return shared_data(training_data), shared_data(valid_data), shared_data(test_data)
theano.function 的参数
def function(inputs, outputs=None, mode=None, updates=None, givens=None, no_default_updates=False, accept_inplace=False, name=None, rebuild_strict=True, allow_input_downcast=None, profile=None, on_unused_input=None): # 常用的一般为 inputs,outputs,updates,givens
theano.tensor.var.TensorVariable
>> import theano.tensor as T>> inpt = T.tensor4(name='inpt')>> type(inpt)theano.tensor.var.TensorVariable>> inpt.ndim4>> inpt.dtype'float64'
所谓 theano.config.floatX
>> type(theano.config.floatX)str>> theano.config.floatX'float64'
0 0
- theano 编程细节(二)
- Theano编程细节(一)
- Python编程细节(二)
- theano 程序(二)
- Theano基础(二)
- C++基础::shared_ptr 编程细节(二)
- linux复习杂记(二) linux网络编程中的细节
- theano 训练样本制作(二)
- 深度学习(二)theano环境搭建
- 深度学习(二)theano环境搭建
- 深度学习(二)theano环境搭建
- Theano Tutorial文档翻译(二):代数
- 深度学习(二)theano环境搭建
- 深度学习(二)theano入门学习
- 深度学习(二)theano环境搭建
- Theano学习二----numpy
- theano tutotial(二)
- Theano快速突击(二)
- 浅析:做优质外链的一些方法
- 从零和到竞合 亚马逊为何联姻国美?
- spyder anaconda 使用方法
- HTML5 历史管理
- 当UITextField有内容时,button才能被点击
- theano 编程细节(二)
- mybatis批量和更新(mysql)
- 三、程序的控制结构
- webpack中 publicPath 跟 path 的区别
- lambda表达式
- Android AssetManager <1>
- SQLServer常见查询问题
- Android 平台电容式触摸屏的驱动基本原理
- (2.1.25)关于时间,日期,星期,月份的算法(Java中Calendar的使用方法)