What's the difference between tf.placeholder and tf.Variable?

前端 未结 14 890
余生分开走
余生分开走 2020-12-07 06:33

I\'m a newbie to TensorFlow. I\'m confused about the difference between tf.placeholder and tf.Variable. In my view, tf.placeholder is

14条回答
  •  独厮守ぢ
    2020-12-07 07:21

    TL;DR

    Variables

    • For parameters to learn
    • Values can be derived from training
    • Initial values are required (often random)

    Placeholders

    • Allocated storage for data (such as for image pixel data during a feed)
    • Initial values are not required (but can be set, see tf.placeholder_with_default)

提交回复
热议问题