- TensorFlow Machine Learning Projects
- Ankit Jain Armando Fandango Amita Kapoor
- 128字
- 2021-06-10 19:15:28
Tensors generated from library functions
TensorFlow provides various functions to generate tensors with pre-populated values. The generated values from these functions can be stored in a constant or variable tensor. Such generated values can also be provided to the tensor constructor at the time of initialization.
As an example, let's generate a 1-D tensor that's been pre-populated with 100 zeros:
a=tf.zeros((100,))
print(tfs.run(a))
Some of the TensorFlow library functions that populate these tensors with different values at the time of their definition are listed as follows:
- Populating all of the elements of a tensor with similar values: tf.ones_like(), tf.ones(), tf.fill(), tf.zeros(), andtf.zeros_like()
- Populating tensors with sequences: tf.range(),and tf.lin_space()
- Populating tensors with a probability distribution: tf.random_uniform(), tf.random_normal(), tf.random_gamma(),and tf.truncated_normal()
推薦閱讀
- Associations and Correlations
- 計(jì)算機(jī)系統(tǒng)結(jié)構(gòu)
- Docker High Performance(Second Edition)
- 從零開始學(xué)C++
- 走近大數(shù)據(jù)
- Microsoft System Center Confi guration Manager
- 深度學(xué)習(xí)與目標(biāo)檢測
- 基于神經(jīng)網(wǎng)絡(luò)的監(jiān)督和半監(jiān)督學(xué)習(xí)方法與遙感圖像智能解譯
- Deep Learning Essentials
- Windows 7來了
- 大數(shù)據(jù)時(shí)代的調(diào)查師
- 機(jī)器人手工制作
- 暗戰(zhàn)強(qiáng)人:黑客攻防入門全程圖解
- 軟件需求十步走
- Internet of Things with Raspberry Pi 3