1. 程式人生 > >(print除去省略號)tensorflow學習筆記(北京大學) tf4_1_0.py 完全解析 列印完整資料

(print除去省略號)tensorflow學習筆記(北京大學) tf4_1_0.py 完全解析 列印完整資料

# -*- coding: utf-8 -*-
"""
Created on Thu Nov  1 12:24:34 2018
#tensorflow學習筆記(北京大學) tf3_7_0.py 完全解析 列印完整資料
#QQ群:476842922(歡迎加群討論學習
"""
import tensorflow as tf
import numpy as np
np.set_printoptions(threshold=np.inf) #全部輸出 
SEED = 23455

rdm = np.random.RandomState(SEED)#基於seed產生隨機數
#隨機數返回32行2列的矩陣 表示32組 
X = rdm.rand(32,2) with tf.Session() as sess:#計算 init_op = tf.global_variables_initializer()#初始化 sess.run(init_op)#初始化 print(rdm)#列印 print(X)#列印

<mtrand.RandomState object at 0x000002928ADE3438>
[[0.83494319 0.11482951]
[0.66899751 0.46594987]
[0.60181666 0.58838408]
[0.31836656 0.20502072]
[0.87043944 0.02679395]
[0.41539811 0.43938369]
[0.68635684 0.24833404]
[0.97315228 0.68541849]
[0.03081617 0.89479913]
[0.24665715 0.28584862]
[0.31375667 0.47718349]
[0.56689254 0.77079148]
[0.7321604 0.35828963]
[0.15724842 0.94294584]
[0.34933722 0.84634483]
[0.50304053 0.81299619]
[0.23869886 0.9895604 ]
[0.4636501 0.32531094]
[0.36510487 0.97365522]
[0.73350238 0.83833013]
[0.61810158 0.12580353]
[0.59274817 0.18779828]
[0.87150299 0.34679501]
[0.25883219 0.50002932]
[0.75690948 0.83429824]
[0.29316649 0.05646578]
[0.10409134 0.88235166]
[0.06727785 0.57784761]
[0.38492705 0.48384792]
[0.69234428 0.19687348]
[0.42783492 0.73416985]
[0.09696069 0.04883936]]