数据定义
常量
c_1 = tf.constant(4)
c_2 = tf.constant([4,3,2])
变量
v_1 = tf.Variable( rand_t )
张量
t_1 = tf.random_normal( [2,3] , mean =2.0, stddev=4 , seed =12 )
t_2 = tf.truncated_normal([1,5] , stddev=2 )
t_3 = tf.random_uniform([2,3] , maxval=4 , seed=12 )
tf.random_crop( t_random,[2,5] , seed=12)
tf.random_shuffle( t_random )
tf.set_random_seed(54)
其他
c_3 = tf.zeros([2,3] , tf.int32 )
c_4 = tf.ones([2,3] , tf.int32)
c_5 = tf.linspace( 2.0 , 5.0 , 5 )
c_6 = tf.range(10)
本文详细介绍了使用TensorFlow进行数据定义、操作与随机生成的方法,包括常量、变量、张量的创建,以及随机裁剪、洗牌和设置随机种子等高级功能。还探讨了特殊矩阵如全零矩阵、全一矩阵、线性空间矩阵和范围矩阵的生成。
577

被折叠的 条评论
为什么被折叠?



