我爱编程

Chapter 3 2018-03-16

2018-03-16  本文已影响0人  心弦上痴情的景致


几个重要的概念:

1.Graph

    系统自动维护一个默认的计算图(一般一个图)

    tf.get_default_graph()#获取默认计算图

    g = tf.Graph()

    with g.as_default():#设置默认图

    with g.device('/gpu:0'):   #指定计算运行设备

2.tensor

    属性 name, shape, type

3.Session

    sess = tf.Session(0

    sess.run()

    sess.close()

    或者

    with tf.Sessioon() as sess:

            sess.run()

前向传播算法

tensorflow游乐场

tf.Variable()

tf.matmul(,)

tf.initialize_all_variables() 变成了 tf.global_variables_initializer()


上一篇 下一篇

猜你喜欢

热点阅读