1

I'm using python2 with keras, tensorflow.

x = Input((32,), name="input1")

I think x's shape is (32,) but print(x) 's result is that 'shape(?,32)'. What is means of 'shape(?,32)'? And '?' means what and 32 means what..?

Cleared
  • 2,490
  • 18
  • 35
김정화
  • 31
  • 1
  • 1
  • 8

1 Answers1

1

When you define tour input with Input((32,), name="input1") you are telling Keras that each input will be 1-dimensional with size 32. However you might send more than one input during training/predicting. For example if you send in 10 samples, each with length 32, you will actually send in a tensor with shape (10, 32).

Since the topology of the network is not dependent on the number of samples you send in, the shape may vary and is presented as (?,32) where ? is the number of samples.

Cleared
  • 2,490
  • 18
  • 35
  • So..(?,32,128) means 2-dimensional with size (32,128) , ? is the number of samples, right?? Do I rightly understand?? – 김정화 Nov 21 '18 at 06:54
  • Yes, that is correct. For example if your input is images with size 480x360, your input shape will be `(?,480,360)` since you might send in more than one image each time. – Cleared Nov 21 '18 at 06:55
  • If you have more questions, that is not strictly releated to this question, please create a completely new question instead of taking it here in the comments. That way the question, and the answer to that question, will be much easier to search for and find. – Cleared Nov 21 '18 at 06:59
  • Thank you so much. – 김정화 Nov 21 '18 at 07:04