Theano学习笔记

上传人:奇异 文档编号:48177062 上传时间:2022-01-01 格式:DOCX 页数:41 大小:138.28KB
收藏 版权申诉 举报 下载
Theano学习笔记_第1页
第1页 / 共41页
Theano学习笔记_第2页
第2页 / 共41页
Theano学习笔记_第3页
第3页 / 共41页
资源描述:

《Theano学习笔记》由会员分享,可在线阅读,更多相关《Theano学习笔记(41页珍藏版)》请在装配图网上搜索。

1、Theano学习笔记Theano学习笔记(一)代数分类:Python 2014-08-28 15:29 2008 人阅读 评论(5)收藏 举报numpypython 深度学习 Theanogpu标量相加I-python view plaincopy1. import theano.tensor as T2. from theano import function3. x = T.dscalar( x)4. y = T.dscalar( y)5. z = x + y6. f = function(x, y, z)输入定义两个符号变量来代替数值,输出是一个0 维的 numpy.ndarray 数组

2、。矩阵相加把输入类型换一下就行了,矩阵如果维数不同,会遵循NumPy的广播规则。python view plaincopy1. import theano.tensor as T2. from theano import function3. x = T.dmatrix( x)4. y = T.dmatrix( y)5. z = x + y6. f = function(x, y, z)定义一个公式如:a * 2 + b * 2 + 2 * a* b 这里每个变量都需要单独申明。python view plaincopy1. import theano2. a = theano.tensor.

3、vector()3. b = theano.tensor.vector()4. out = a * 2 + b * 2 + 2 * a * b5. f = theano.function(a,b,out)6. print f(0, 1,1,2)7. 8. 1.9.支持多输出python view plaincopy1. import theano.tensor as T2. from theano import function3. a, b = T.dmatrices( a , b)4. diff = a - b5. abs_diff = abs(diff)6. diff_squared =

4、 diff*27. f = function(a, b, diff, abs_diff,diff_squared)8. print f(1, 1, 1, 1, 0, 1, 2,3)9. 10. array( 1., 0.,11. -1., -2.), array(1.,0.,12. 1., 2.), array(1.,0.,13. 1., 4.)设置默认参数和标准Python 一样,缺省参数必须在非缺省之 后,也可以定义缺省变量名。 -pythonview plaincopy1. import theano.tensor as T2. from theanoimportfunction3. f

5、rom theanoimportParam4. x, y = T.dscalars( x , y)5. z = x + y6. f = function(x, Param(y, default=1,name=by_name ),z)7.printf(33)8.printf(33, 2)9.printf(33,by_name=3)10.11.34.012.35.013.36.0共享变量为了在GPU上更好的性能,引入共享变量,以累加器为例。I python view plaincopy1. import theano.tensor as T2. from theano import functio

6、n3. from theano import shared4. state = shared(0)5. inc = T.iscalar( inc )6. accumulator = function(inc, state,updates=(state, state+inc)7. print state.get_value()8. accumulator(1)9. print state.get_value()10. accumulator(300)11. print state.get_value()12. state.set_value(-1)13. print accumulator(3)

7、14. print state.get_value()15. 16. 017. 118. 30119. -120. 2state的值在调用函数之后才刷新。而且可以定义多个函数共用同一个共享变量,例如这个减法哭TFITOpython view plaincopy1. decrementor = function(inc, state,updates=(state, state-inc)2. print decrementor(2)3. print state.get_value()4. 5. 26. 0如果在某个函数中,共用了这个共享变量,但是 又不想变动它的值,那么可以使用 given参数替

8、代这个变量。而旧的state不发生变化。python view plaincopy1. fn_of_state = state * 2 + inc2. foo = T.scalar(dtype=state.dtype)3. skip_shared = function(inc, foo,fn_of_state,4. givens=(state,foo)5. print skip_shared(1, 3)6. print state.get_value()7. 8. 79. 0产生随机数和C中的srand()一样,都是伪随机数。python view plaincopy1. from thean

9、o import function2. from theano.tensor.shared_randomstreamsimport RandomStreams3. srng = RandomStreams(seed=234) # 种子4. rv_u = srng.uniform(2,2)#均匀分布5. rv_n = srng.normal(2,2)#正态分布6. f = function(口,rv_u)#每次调用,每次都会更新7. g = function。, rv_n,no_default_updates=True)#如果以后一直用这组随机数,就不再更新8. nearly_zeros = f

10、unction(口,rv_u + rv_u- 2 * rv_u)9. print nearly_zeros()#函数每次执行只获得一个随机数,即使表达式里面有3个随机数种子流:上述2个随机变量,可以全局设定同一 个种子,也可以是分别设定。python view plaincopy1. #分别设置,使用.rng.set_value() 函数2. rng_val =rv_u.rng.get_value(borrow=True)# Get the rng for rv_u3. rng_val.seed(89234) # seeds thegenerator4. rv_u.rng.set_value(

11、rng_val,borrow=True)5. #全局设置,使用.seed()函数6. srng.seed(902340)函数间共享流python view plaincopy1. state_after_v0 =rv_u.rng.get_value().get_state()#保存调用前的 state2. nearly_zeros()# this affects rv_us generator3. v1 = f()#第一个调用,之后 state 会变化4. rng = rv_u.rng.get_value(borrow=True)5. rng.set_state(state_after_v0)

12、#为其 state 还原6. rv_u.rng.set_value(rng, borrow=True)7. v2 = f()# v2 != v1输出更新后state 对应的随机数8. v3 = f()# v3 = v1再次更新又还原成原来的 state 了在2张Theano图间复制状态python view plaincopy1. import theano2. import numpy3. import theano.tensor as T4. from theano.sandbox.rng_mrg importMRG_RandomStreams5. from theano.tensor.s

13、hared_randomstreamsimport RandomStreams6.7. class Graph():8. def _init_(self, seed=123):9. self.rng = RandomStreams(seed)10. self.y = self.rng.uniform(size=(1,)11.12. g1 = Graph(seed=123)13. fl = theano.function(口,gl.y)14.15. g2 = Graph(seed=987)16. f2 = theano.function(口,g2.y)17.18. print By defaul

14、t, the two functionsare out of sync.19. printf1() returns , f1()20. printf2() returns , f2()21. #输出不同的随机值22. def copy_random_state(g1, g2):23. if isinstance(g1.rng, MRG_RandomStreams):24. #类型判断:其第一个参数为对象,第二个为类型名或类型名的一个列表。其返回值为布尔型。25. g2.rng.rstate = g1.rng.rstate26. for (su1, su2) in zip(g1.rng.stat

15、e_updates, g2.rng.state_updates):#打包27. su20.set_value(su10.get_value()# 赋值28.29. print We now copy the state of thetheano random number generators.30. copy_random_state(g1, g2)31. printf1() returns , f1()32. printf2() returns , f2()33. #输出相同的随机值34. 35. By default, the two functions are outof sync.3

16、6. f1() returns 0.7280300937. f2() returns 0.5505676938. We now copy the state of the theanorandom number generators.39. f1() returns 0.5904412340. f2() returns 0.59044123Theano学习笔记(二)一一逻辑回归函数解析分类:Python 2014-08-28 21:46 1215 人阅读 评论(0)收藏 举报 pythonnumpyDeep LearningTheano深度学习有了前面的准备,可以用Theano实现一个逻辑 回

17、归程序,逻辑回归是典型的有监督学习。为了形象,这里我们假设分类任务是区分人与狗 的照片。首先是生成随机数对象python view plaincopy1. importnumpy2. importtheano3. importtheano.tensor as T4. rng= numpy.random数据初始化有400张照片,这些照片不是人的就是狗的。每张照片是28*28=784的维度。D0是训练集,是个400*784的矩阵,每一行都 是一张照片。D1是每张照片对应的标签,用来记录这张照片 是人还是狗。training_steps是迭代上限。python view plaincopy1. N=

18、 4002. feats= 7843. D= (rng.randn(N, feats), rng.randint(size=N, low=0, high=2)4. training_steps= 10000python view plaincopy1. #Declare Theano symbolic variables2. x= T.matrix(x)3. y= T.vector(y)4. w= theano.shared(rng.randn(feats), name=w)5. b= theano.shared(0., name= b)6. print Initial model:7. pr

19、intw.get_value(), b.get_value()x是输入的训练集,是个矩阵,把D0赋值给它。 y是标签,是个列向量,400个样本所以有400 维。把D1赋给它。w是权重列向量,维数为图像的尺寸 784维。b是偏倚项向量,初始值都是0,这里没写成向 量是因为之后要广播形式。python view plaincopy1. #Construct Theano expression graph#Probability that target = 1# Theprediction thresholded# Cross-entropy loss function# The cost to m

20、inimize#Compute the gradient of the cost # (we shall return to this in a #following section of this tutoria2. p_1= 1 / (1 + T.exp(-T.dot(x, w) - b)3. prediction= p_1 0.54. xent= -y * 410g(p_1) - (1-y) * T.log(1-p_1)5. cost= xent.mean() + 0.01 * (w * 2).sum()6. gw,gb = T.grad(cost, w, b)7.8.l)这里是函数的主

21、干部分,涉及到 3个公式1 .判定函数描=.十味仃花2 .代价函数3 .总目标函数 第二项是权重衰减项,减小权重的幅度,用来防 止过拟合的。python view plaincopy1. #Compile2. train= theano.function(3. inputs=x,y,4. outputs=prediction, xent,5. updates=(w, w - 0.1 * gw), (b, b -0.1 * gb)6. predict= theano.function(inputs=x, outputs=prediction)构造预测和训练函数。python view plain

22、copy1. #Train2. fori in range(training_steps):3. pred,err = train(D0, D1)4. print Final model:5. printw.get_value(), b.get_value()6. print target values for D:, D17. print prediction on D:, predict(D0)这里算过之后发现,经过10000次训练,预测结 果与标签已经完全相同了。Theano 学习笔记(三)图结构分类:Python 2014-08-29 10:13 1515 人阅读 评论(0)收藏 举报

23、Theanopython 深度学习 Deep Learning 图结构图结构(Graph Structures )是了解 Theano 内在工作原理的基础。Theano编程的核心是用符号占位符把数学关系 表示出来。图结构的组成部分如图实现了这段代码:python view plaincopy1. importtheano.tensor as T2.x= T.matrix(x)3.y= T.matrix(y)4. z= x + yNone None变量节点(variable nodes)红色表示。变量节点都有 owner,其中x与y的owner 为 none。 z 的 owner 为 apply

24、。操作节点(op nodes)绿色表示。表示各个变量之间的运算(例如 +,-,*, sum(),tanh()等等)。应用节点(apply nodes)蓝色表示。其他节点都连在上面。分析nodes对应属性对于以下代码,分析其节点属性。python view plaincopy1. importtheano.tensor as T2. x= T.dmatrix( x)3. y= x * 2.4. y.owner.op.name5. Elemwisemul,no_inplace #y 的 owner 是 apply 而 apply 的 op 是 Elemwisemul,no_inplace6. le

25、n(y.owner.inputs)7. 2#两个输入8. y.owner.inputs09. x#第一个输入是x矩阵10. y.owner.inputs111. InplaceDimShufflex,x.0#注意这里第二个输入并不是2,而是和x同样大小的矩阵框架,因为等会要广播才能相乘python view plaincopy1. type(y.owner.inputs1)2. 3. type(y.owner.inputs1.owner)4. 5. y.owner.inputs1.owner.op6. #用 DimShuffle把2广播出来7. y.owne匚inputs1.owne匚inpu

26、ts8. 2.0 #矩阵框架的 owner才是2自动优化编译Theano其实是编译了一张图。这张图从输 入变量开始贯穿全图直到输出变量。Theano可 以检测关键子图,来进行替换,防止重复,以达 到优化的目的。比如用x替换xy/y。举个例子python view plaincopy1. import theanoa )# declare symbolic variable#build symbolic expression#compile function#prints、array(021026)、2. a = theano.tensor.vector(3. b = a + a *104. f

27、 = theano.function(a,b)5. print f(0, 1,2)优化前FensorTypef flo at6 4, vector)ElpmwiseC amposite (q,gqr 声 qrjuul) dd1 emox I ype(fIoat64, vector)优化后Theano学习笔记(四)一一导数分类:Python 2014-08-29 18:34 1348 人阅读 评论(0)收藏 举报深度学习 pythonTheano 导数 Deep Learning导数使用T.grad计算。这里使用pp()打印梯度的符号表达式。第3行输出是打印了经过优化器简化的符号梯 度表达式,与

28、第1个输出相比确实简单多了。fill(x* TensorConstant2), TensorConstant1.0)指仓1J建一个x*2大小的矩 阵,并填充1。python view plaincopy1. importtheano.tensor as T2. fromtheanoimportpp3. fromtheanoimportfunction4. x= T.dscalar(x)5. y= x * 26. gy= T.grad(y, x)7. printpp(gy)8. f= function(x, gy)9. printf(4)10. printpp(f.maker.fgraph.ou

29、tputs0)11. 12. (fill(x* TensorConstant2), TensorConstant1.0) * TensorConstant2) * (x *(TensorConstant2 - TensorConstant1)13. 8.014. (TensorConstant2.0* x)T.grad的第1个参数必须是标量例如计算逻辑函数sigmoid的导数: 曲=S(I) I11 S )pythonview plaincopy1. importtheano.tensor asT2. fromtheano importfunction3. x= T.dmatrix( x )4

30、. s= T.sum(1 / (1 + T.exp(-x)5. gs= T.grad(s, x)6. dlogistic= function(x, gs)7. printdlogistic(0, 1, -1,-2)8. 9. 0.250.1966119310. 0.19661193 0.10499359计算雅克比(Jacobian)矩阵 雅克比矩阵是向量的一阶偏导数:用arrange生成从0至0 y.shape0的序歹U。循环计算。scan可以提高创建符号循环效率。lambda是 python 内建的 magicfunction.python view plaincopy1. x= T.dve

31、ctor( x)2. y = x * 23. J, updates = theano.scan(lambdai, y,x : T.grad(yi, x), sequences=T.arange( y.shape0), non_sequences=y,x)4. f = function(x, J,updates=updates)5. f(4, 4)6. 7. 8. 0.8. 0. 8.计算海森(Hessian)矩阵海森矩阵是多元函数的二阶偏导数方阵。只要用T.grad(cost,x)替换雅克比矩阵的一些y 即可。python view plaincopy1. x= T.dvector( x)2.

32、 y = x* 23. cost= y.sum()4. gy =T.grad(cost, x)5. H,updates = theano.scan( lambda i, gy,x : T.grad(gyi, x),sequences=T.arange (gy.shape0), non_sequences=gy, x)6. f =function(x, H, updates=updates)7. f(4,4)8. 9. 2. 0.10. 0. 2.雅克比右乘x可以由向量扩展成矩阵。雅克比右乘使用Rop:python view plaincopy1. W = T.dmatrix(W)2. V =T

33、.dmatrix(V)3. x =T.dvector(x)4. y =T.dot(x, W)5. JV =T.Rop(y, W,V)6. f =theano.function(W, V, x, JV)7. printf(1, 1, 1, 1, 2, 2, 2, 2, 0,1)8. 9. 2. 2.雅克比左乘雅克比左乘使用Lop:python view plaincopy1. import theano2. import theano.tensor as T3.from theanoimport function4.x = T.dvector(x)5.v =T.dvector(v)6.x =T.

34、dvector(x)7. y =T.dot(x, W)8. VJ =T.Lop(y, W, v)9. f =theano.function(v,x, VJ)10. print f(2, 2, 0, 1)11. 12. 0. 0.13. 2. 2.海森矩阵乘以向量可以使用Rop&f(T)鬻-python view plaincopy1. import theano2. import theano.tensor as T3. from theano import function4. x= T.dvector( x)5. v= T.dvector( v)6. y= T.sum(x * 2)7. g

35、y= T.grad(y, x)8. Hv= T.Rop(gy, x, v)9. f= theano.function(x, v, Hv)10. printf(4, 4, 2, 2)11. 12. 4. 4.Theano学习笔记(五)一一配置设置与编译模型分类:Python 2014-09-02 19:33 2494 人阅读 评论(0)收藏 举报Theano 深度学习 python配置config模块包含了各种用于修改 Theano的属 性。在Theano导入时,许多属性都会被检查, 而有些属性是只读模式。一般约定,在用户代码内部config模块的属性不 应当被修改。Theano的这些属性都有默

36、认值,但是你也可以 在你的.theanorc文件里面修改,并且使用 THEANO_FLAGS的环境变量进行修改。优先顺序是:1. theano.config. 的赋值2. THEANO_FLAGS 的赋值3.theanorc (或者在THEANORC文件中表示) 的赋值通过打印theano.cong可以展示当前的配置:python view plaincopy1. python-c import theano; print theano.config| less例如,修改笔记(二)中的逻辑回归函数,设置 精度为float32python view plaincopy1. #!/usr/bin/

37、envpython2. #Theano tutorial3. #Solution to Exercise in section Configuration Settings and Compiling Modes 4.5. importnumpy6. importtheano7. importtheano.tensor as tt8.9. theano.config.floatX= float3210.11. rng= numpy.random12.13. N=40014. feats=78415. D= (rng.randn(N,feats).astype(theano.config.flo

38、atX),16. rng.randint(size=N,low=0, high=2).astype(theano.config.floatX)17. training_steps= 1000018.19. #Declare Theano symbolic variables20. x=tt.matrix( x)21. y=tt.vector( y)22. w=theano.shared(rng.randn(feats).astype(theano.config.floatX),name=w)23. b=theano.shared(numpy.asarray(0.,dtype=theano.co

39、nfig.floatX),name=b)24. x.tag.test_value= D025. y.tag.test_value=D126. #printInitial model:27. #printw.get_value(), b.get_value()28.29. #Construct Theano expression graph30. p_1= 1/(1+ tt.exp(-tt.dot(x, w) - b)#Probability of having a one31. prediction= p_1 0.5# The prediction that isdone: 0 or 132.

40、 xent= -y * tt.log(p_1) -(1-y)* tt.log(1 - p_1)# Cross-entropy33. cost= tt.cast(xent.mean(),float32 ) + 34. 0.01 * (w * 2).sum()# The cost to optimize35. gw,gb = tt.grad(cost, w, b)36.37. #Compile expressions to functions38. train= theano.function(39. inputs=x, y,40. outputs=prediction, xent,41. upd

41、ates=w: w - 0.01 * gw, b: b -0.01 * gb,42. name=train)43. predict= theano.function(inputs=x, outputs=prediction,44. name=predict )45.in Gemv , CGemv , Gemm , CGemm for x iin GpuGemm, GpuGemv for x in46. ifany(x.op._class_._name_ n47. train.maker.fgraph.toposort():48. print Used the cpu49. elifany(x.

42、op._class_._name_50. train.maker.fgraph.toposort():51. print Used the gpu52. else :53. print ERROR, not able to tell if theanoused the cpu or the gpu54. print train.maker.fgraph.toposort()55.56. fori in range(training_steps):57. pred, err = train(D0, D1)58. #printFinal model:59. #printw.get_value(),

43、 b.get_value()60.61. print target values for D62. printD163.64. print prediction on D65. printpredict(D0)用 time python file.py 运行)可得:python view plaincopy1. real 0m15.055s2. user 0m11.527s3. sys 0m0.801sMode每次调用theano.function 时)Theano变量输入 和输出的符号化关系都被优化和编译了。而这些编辑都通过made参数的值来控制。Theano定义以下mode:FAST_CO

44、MPILEpython view plaincopy1. compile.mode.Mode(linker=py ,optimizer= fast_compile )只应用少量的图优化并且只使用 Python实现。FAST_RUN :python view plaincopy1. compile.mode.Mode(linker= cvm ,optimizer= fast_run )使用所有的优化并且在可能的情况下使用C实现。DebugMode :python view plaincopy1. compile.debugmode.DebugMode()检查所有优化的正确性,并且比较 C与Pyt

45、hon 实现。这种模式比别的模式耗时都长, 但是可以 识别出各种问题。ProfileMode (不赞成使用):python view plaincopy1. compile.profilemode.ProfileMode()与FAST_RUN相同的优化,但是打印出一些设 置信息。默认的模式是FAST_RUN,但是通过传递关键 字参数给theano.function)可以控制 config.mode, 从而改变模式。Linkers一个mode由2个部分组成:1个优化器和1个Linker。linkergtlURaise rror bY op OverheadDefinitionCVITIyesye

46、sAs c py, but the runtime algo to execute thtcvm_nagcnoyesAs cvnis but without gcc pylilyesyes“+”Try C code. If none exists for dn op( use Pytc PV.nogcnoyesAs 匚 py, bui without gccnoyesU | BUse only C code (if none available for an op,PYyeiyesuse only Python codec&py31noyes“+*Use Cnd Python codeProf

47、ile ModenonoIt+r(Deprecated) Compute some extra profilingDebugModenoyesVERYMdke many checks on whatTheetno coniputHIGHhttp: /blos* csdiii net/yc1 gc指计算中间过程的碎片收集。否则在Theano函数调用之间,操作所使用的内存空间 将被保存起来。为了不重新分配内存,降低开销 (overhead)使其速度更快。2默认 linker3不推荐使用使用 DebugMode一般你应当使用FAST_RUN或者 FAST_COMPILE 模式,当你定义新的类型的表

48、达式或者优化方法时,先用 DebugMode(mode=DebugMode)运行是很有用的, DebugMode通过运行一些自检和判断程序来帮 助诊断出将会导致错误输出的可能的编程错误。 值得注意的是,DebugMode比FAST_RUN或者 FAST_COMPILE模式要慢得多,所以只在开发 期使用。举个例子: python view plaincopy1. import theano2. importtheano.tensor as T3. x= T.dvector( x)4. f= theano.function(x, 10 * x, mode=DebugMode)5. f(5)6. f

49、(0)7. f(7)运行后,如果有问题,输出会提示异常,如果依 然不能解决,请联系本领域的专家。但是DebugMode也不是万能的,因为有些错误 只在特定的输入条件下才会出现。如果你使用构造器而不是关键词 DebugMode , 就可以通过配构造器变量来配置。而关键词设置 太严格了。ProfileMode不推荐使用检索时间信息图编译好之后,运行就可以了。然后调用 profmode.print_summary(),返回各自时间信 息,例如你的图大多数时间花在什么地方了等 等。还是以逻辑回归为例 生成ProfileMode实例 python view plaincopy1. fromtheano

50、import ProfileMode2. profmode= theano.ProfileMode(optimizer=fast_run , linker=theano.gof.OpWiseCLinker。)在函数末尾声明一下python view plaincopy1. train = theano.function(2. inputs=x,y,3. outputs=prediction,xent,4. updates=w:w - 0.01* gw, b: b - 0.01 * gb,5. name= train ,mode=profmode)6. #如果是Module则这样声明:7. #

51、m = theano.Module()8. # minst = m.make(mode=profmode)取回时间信息 文件末尾添加python view plaincopy1. profmode.print_summary()则运行效果是这样的python view plaincopy1.2.3.4.5.6.7.8.9.10.ProfileMode.print_summary()Timesince import 6.183sTheanocompile time: 0.000s (0.0% sinceOptimization time: 0.000sLinker time: 0.000sThe

52、anofct call 5.452s (88.2% sinceTheano Op time 5.003s 80.9%(sinceTheano function overheadimport )import )import )91.8%(of fct call)in ProfileMode0.449s 7.3%(sinceimport ) 8.2%(offct call)11. 10000Theano fct call, 0.001s per call12. Restof the time sinceimport 0.730s 11.8%13.14. Theanofct summary:15.

53、16. 100.0% 5.452s 5.45e-04s 10000 train17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.SingleOp-wise summary: cumu lative seconds * 87.9% 87.9% 4.400s 4.400s 2.20e-04s * 20000 1 2 10.8% 98.8% 0.542s 4.942s 5.42e-06s * 100000 10 10Vor.elemwise.Elemwise 0.5% 99.3% 0.023s 4.966s 1.17e-06s*20000 1 2 0.4

54、% 99.6% 0.018s 4.984s 6.05e-07s * 30000 2 30.3% 99.9% 0.013s 4.997s 1.25e-06s* 10000 1 1 0.1% 100.0% 0.007s 5.003s 3.35e-07s * 20000 1 2 . (remaining 0 single Op account for0.00%(0.00s) of the runtime)(*)Op is running a c implementation33.34.35.36.37.38.class theano.tensoclass theano.tensclass thean

55、o.tensoclass theano.tensorclass theano.tensoclass piOp-wisesummary: * 87.9% 87.9% 4.400s 4.400s 2.20e-04s * 20000 2CGemvinplace6.3% 94.3% 0.318s 4.718s 3.18e-05s* 10000 1ElemwiseCompositeComp ositeCompositesub(mul(i0,i1), neg(i2)(i0,scalar_softplus(i1), mul(i2,i3)(i0,i1,i2, scalar_softplus(i3)2.1% 9

56、6.3% 0.103s 4.820s 1.03e-05s* 10000 1ElemwiseCompositeComp ositeCompositeCompositemul(i0, add(i1, i2)(i0,neg(i1), true_div(i2,i3)(i0,mul(i1,i2,i3),i4,i5)(i0,i1,i2,exp(i3),i4,i5)(0, 0)1.6% 98.0% 0.082s 4.902s8.16e-06s* 10000 1ElemwiseScalarSigmoido utput_types_preference=transfer_type0(0, 0)0.5% 98.4% 0.023s 4.925s 1.17e-06s*20000 2 Alloc0.3% 98.7% 0.013s 4.938s 1.25e-06s* 10000 1 Sum0.2% 98.9% 0.012s 4.950s 6.11e-07s*20

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!