- 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()
推薦閱讀
- 大數(shù)據(jù)技術與應用基礎
- 嵌入式系統(tǒng)及其開發(fā)應用
- Mastering Hadoop 3
- 數(shù)據(jù)挖掘?qū)嵱冒咐治?/a>
- AWS Administration Cookbook
- Windows內(nèi)核原理與實現(xiàn)
- MCGS嵌入版組態(tài)軟件應用教程
- 教育機器人的風口:全球發(fā)展現(xiàn)狀及趨勢
- FANUC工業(yè)機器人配置與編程技術
- 漢字錄入技能訓練
- C#編程兵書
- 7天精通Photoshop CS5平面視覺設計
- 我的IT世界
- BeagleBone Home Automation
- 數(shù)字孿生技術與工程實踐:模型+數(shù)據(jù)驅(qū)動的智能系統(tǒng)