zoukankan      html  css  js  c++  java
  • theano 入门教程1.3

    theano 入门教程1.3
    1. 给一个参数设置默认值

      # -*- coding: utf-8 -*-

      """

      Created on Wed Jun  4 23:22:17 2014


      @author: wencc

      """


      import theano.tensor as T

      from theano import function

      from theano import Param

      from theano import pp


      if __name__ == "__main__":

      x, y , w= T.dscalars('x', 'y', 'w')

      z = x + y + w

      f = function([x, Param(y, default=1), Param(w, default=2, name='w_by_name')], z)

      print f(33, 2, w_by_name=4)

      print pp(z)

    这里用Param给一个变量设置默认参数。






  • 相关阅读:
    嵌入式驱动视频2019.03.24
    wps如何输入连续的长破折号
    python绘图问题
    2.13
    2.12
    2.10
    2.9
    2.8
    2.7
    2.5
  • 原文地址:https://www.cnblogs.com/fireae/p/3772482.html
Copyright © 2011-2022 走看看