TensorFlow學(xué)習(xí)筆記1.3: math函數(shù) API r1.7

http://devdocs.io/tensorflow~python/math_ops

Math

Note: Functions taking Tensor arguments can also take anything accepted by tf.convert_to_tensor.
接受Tensor參數(shù)的函數(shù) 也可以接受 tf.convert_to_tensor的任何參數(shù)。
Note: Elementwise binary operations in TensorFlow follow numpy-style broadcasting.
TensorFlow中的Elementwise二進(jìn)制操作遵循numpy-style廣播。

Arithmetic Operators 算術(shù)運(yùn)算

TensorFlow provides several operations that you can use to add basic arithmetic operators to your graph.

容易記住的:tf.add tf.subtract tf.multiply tf.div tf.mod

用到時(shí)候再去查資料的:
tf.scalar_mul
tf.divide tf.truediv tf.floordiv tf.realdiv tf.truncatediv tf.floor_div
tf.truncatemod tf.floormod
tf.cross

Basic Math Functions 基本數(shù)學(xué)函數(shù)

TensorFlow provides several operations that you can use to add basic mathematical functions to your graph.

常用函數(shù):

tf.abs tf.negative tf.sign tf.square tf.round tf.sqrt tf.pow tf.exp tf.log tf.maximum tf.minimum

三角函數(shù):

tf.cos tf.sin tf.tan tf.acos tf.asin tf.atan tf.cosh tf.sinh tf.asinh tf.acosh tf.atanh
用到時(shí)候再去查資料的:
tf.add_n tf.reciprocal tf.rsqrt tf.expm1 tf.log1p tf.ceil tf.floor tf.lbeta
tf.lgamma tf.digamma tf.erf tf.erfc tf.squared_difference tf.igamma
tf.igammac tf.zeta tf.polygamma tf.betainc tf.rint

Matrix Math Functions 矩陣數(shù)學(xué)函數(shù)

TensorFlow provides several operations that you can use to add linear algebra functions on matrices to your graph.

tf.matmul

tf.diag tf.diag_part
tf.trace tf.transpose
tf.eye
tf.matrix_diag tf.matrix_diag_part tf.matrix_band_part tf.matrix_set_diag tf.matrix_transpose
tf.norm
tf.matrix_determinant tf.matrix_inverse
tf.cholesky tf.cholesky_solve
tf.matrix_solve tf.matrix_triangular_solve tf.matrix_solve_ls
tf.qr
tf.self_adjoint_eig tf.self_adjoint_eigvals
tf.svd

Tensor Math Function 張量數(shù)學(xué)函數(shù)

TensorFlow provides operations that you can use to add tensor functions to your graph.

tf.tensordot

Complex Number Functions 復(fù)數(shù)函數(shù)

TensorFlow provides several operations that you can use to perform common math computations that reduce various dimensions of a tensor.
tf.complex
tf.conj
tf.imag
tf.angle
tf.real

Reduction

TensorFlow provides several operations that you can use to perform common math computations that reduce various dimensions of a tensor.

tf.reduce_sum

tf.reduce_prod
tf.reduce_min
tf.reduce_max

tf.reduce_mean

tf.reduce_all
tf.reduce_any
tf.reduce_logsumexp
tf.count_nonzero
tf.accumulate_n
tf.einsum

Scan

TensorFlow provides several operations that you can use to perform scans (running totals) across one axis of a tensor.
tf.cumsum
tf.cumprod

Segmentation

TensorFlow provides several operations that you can use to perform common math computations on tensor segments. Here a segmentation is a partitioning of a tensor along the first dimension, i.e. it defines a mapping from the first dimension onto segment_ids. The segment_ids tensor should be the size of the first dimension, d0, with consecutive IDs in the range 0 to k, where k<d0. In particular, a segmentation of a matrix tensor is a mapping of rows to segments.
For example:

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
tf.segment_sum(c, tf.constant([0, 0, 1]))
  ==>  [[0 0 0 0]
        [5 6 7 8]]

tf.segment_sum
tf.segment_prod
tf.segment_min
tf.segment_max
tf.segment_mean
tf.unsorted_segment_sum
tf.sparse_segment_sum
tf.sparse_segment_mean
tf.sparse_segment_sqrt_n

Sequence Comparison and Indexing

TensorFlow provides several operations that you can use to add sequence comparison and index extraction to your graph. You can use these operations to determine sequence differences and determine the indexes of specific values in a tensor.
tf.argmin
tf.argmax
tf.setdiff1d
tf.where
tf.unique
tf.edit_distance
tf.invert_permutation

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末钻弄,一起剝皮案震驚了整個(gè)濱河市序目,隨后出現(xiàn)的幾起案子递宅,更是在濱河造成了極大的恐慌杏头,老刑警劉巖欲间,帶你破解...
    沈念sama閱讀 219,188評(píng)論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件贮懈,死亡現(xiàn)場(chǎng)離奇詭異匀泊,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)朵你,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,464評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門各聘,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人抡医,你說我怎么就攤上這事躲因。” “怎么了忌傻?”我有些...
    開封第一講書人閱讀 165,562評(píng)論 0 356
  • 文/不壞的土叔 我叫張陵大脉,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我水孩,道長(zhǎng)镰矿,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,893評(píng)論 1 295
  • 正文 為了忘掉前任俘种,我火速辦了婚禮秤标,結(jié)果婚禮上绝淡,老公的妹妹穿的比我還像新娘。我一直安慰自己苍姜,他們只是感情好牢酵,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,917評(píng)論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著衙猪,像睡著了一般馍乙。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上屈嗤,一...
    開封第一講書人閱讀 51,708評(píng)論 1 305
  • 那天潘拨,我揣著相機(jī)與錄音,去河邊找鬼饶号。 笑死铁追,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的茫船。 我是一名探鬼主播琅束,決...
    沈念sama閱讀 40,430評(píng)論 3 420
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼算谈!你這毒婦竟也來了涩禀?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,342評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤然眼,失蹤者是張志新(化名)和其女友劉穎艾船,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體高每,經(jīng)...
    沈念sama閱讀 45,801評(píng)論 1 317
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡屿岂,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,976評(píng)論 3 337
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了鲸匿。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片爷怀。...
    茶點(diǎn)故事閱讀 40,115評(píng)論 1 351
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖带欢,靈堂內(nèi)的尸體忽然破棺而出运授,到底是詐尸還是另有隱情,我是刑警寧澤乔煞,帶...
    沈念sama閱讀 35,804評(píng)論 5 346
  • 正文 年R本政府宣布吁朦,位于F島的核電站,受9級(jí)特大地震影響渡贾,放射性物質(zhì)發(fā)生泄漏喇完。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,458評(píng)論 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望锦溪。 院中可真熱鬧,春花似錦府怯、人聲如沸刻诊。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,008評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)则涯。三九已至,卻和暖如春冲簿,著一層夾襖步出監(jiān)牢的瞬間粟判,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,135評(píng)論 1 272
  • 我被黑心中介騙來泰國(guó)打工峦剔, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留档礁,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,365評(píng)論 3 373
  • 正文 我出身青樓吝沫,卻偏偏與公主長(zhǎng)得像呻澜,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子惨险,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,055評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容

  • TF API數(shù)學(xué)計(jì)算tf...... :math(1)剛開始先給一個(gè)運(yùn)行實(shí)例羹幸。tf是基于圖(Graph)的計(jì)算系統(tǒng)...
    MachineLP閱讀 3,467評(píng)論 0 1
  • 原文鏈接:machinethink.net/blog/tensorflow-on-ios/ Before you ...
    dopami閱讀 1,038評(píng)論 0 1
  • “喂。您好辫愉!我是嘉禾栅受。” 整個(gè)通電話的過程中恭朗,嘉禾都只是“嗯屏镊,嗯”的應(yīng)承著,嘴角帶著笑意冀墨。等她掛了電話以后闸衫,其他三...
    疏影梅花閱讀 558評(píng)論 0 4
  • 有些事情 是隨著人的遺忘蔚出,而真的消失了 這世上,再無“蓉兒” 也許這本該是早已接受的結(jié)局 可能潛意識(shí)害怕這樣的事發(fā)...
    queeny23閱讀 339評(píng)論 0 0
  • 20171116 【幸福三朵玫瑰】 昨日 3朵玫瑰 1.早起 2.閱讀? 3.接當(dāng)當(dāng)? 今日3朵玫瑰 1.早起 2...
    葉青丁當(dāng)媽閱讀 263評(píng)論 0 0