How to expand a Tensorflow Variable

后端 未结 3 1904
暗喜
暗喜 2020-12-10 06:08

Is there any way to make a Tensorflow Variable larger? Like, let\'s say I wanted to add a neuron to a layer of a neural network in the middle of training. How would I go a

3条回答
  •  长情又很酷
    2020-12-10 06:23

    Simply using tf.concat for expand a Tensorflow Variable,you can see the api_docs for detail.

        v1 = tf.Variable(tf.zeros([5,3]),dtype=tf.float32)
        v2 = tf.Variable(tf.zeros([1,3]),dtype=tf.float32)
        v3 = tf.concat(0,[v1, v2])
    

提交回复
热议问题