- 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()
推薦閱讀
- Instant Raspberry Pi Gaming
- Hands-On Neural Networks with Keras
- 最后一個人類
- Docker Quick Start Guide
- 分布式多媒體計算機系統
- 可編程控制器技術應用(西門子S7系列)
- Learning C for Arduino
- Visual Basic.NET程序設計
- 悟透JavaScript
- ASP.NET 2.0 Web開發入門指南
- Mastering Ansible(Second Edition)
- ZigBee無線通信技術應用開發
- Mastering DynamoDB
- 開放自動化系統應用與實戰:基于標準建模語言IEC 61499
- 智能控制技術及其應用