Skip to main content
Minor formatting
Source Link
Stephen Rauch
  • 1.8k
  • 11
  • 22
  • 34

I am following an online tutorial to classify images and started off with dense layers as a starting point to classify cifar10 data.

# Create a model and add layers
model = Sequential()
model.add(Dense(512, activation='relu', input_shape=(32, 32, 3)))
model.add(Dense(10, activation='softmax'))

# Print summary
model.summary()

enter image description here

dense_1 output shape (None, 32, 32, 512)dense_1 output shape (None, 32, 32, 512). 'None' represents the batch size, but what does '32,32' represent? Why isn't the shape (None, 512)? Same happens with the dense_2 layer.

Can someone explain it here or point me to a resource that explains this?

Thank you

I am following an online tutorial to classify images and started off with dense layers as a starting point to classify cifar10 data.

# Create a model and add layers
model = Sequential()
model.add(Dense(512, activation='relu', input_shape=(32, 32, 3)))
model.add(Dense(10, activation='softmax'))

# Print summary
model.summary()

enter image description here

dense_1 output shape (None, 32, 32, 512). 'None' represents the batch size, but what does '32,32' represent? Why isn't the shape (None, 512)? Same happens with the dense_2 layer.

Can someone explain it here or point me to a resource that explains this?

Thank you

I am following an online tutorial to classify images and started off with dense layers as a starting point to classify cifar10 data.

# Create a model and add layers
model = Sequential()
model.add(Dense(512, activation='relu', input_shape=(32, 32, 3)))
model.add(Dense(10, activation='softmax'))

# Print summary
model.summary()

enter image description here

dense_1 output shape (None, 32, 32, 512). 'None' represents the batch size, but what does '32,32' represent? Why isn't the shape (None, 512)? Same happens with the dense_2 layer.

Can someone explain it here or point me to a resource that explains this?

I am following fewan online tutorial to classify images and started off with dense layers as a starting point to classify cifar10 data.

# Create a model and add layers
model = Sequential()
model.add(Dense(512, activation='relu', input_shape=(32, 32, 3)))
model.add(Dense(10, activation='softmax'))

# Print summary
model.summary()

enter image description here

dense_1 output shape (None, 32, 32, 512). None'None' represents the bathbatch size, but i had a hard time understand why there is 32what does '32,32 32' represent? Why isn't the shape is (None, 512)? Same happens with the dense_2 layer.

For sure, i am missing some thing and can't figure it out. Can some onesomeone explain it here or point me to thea resource that explains this, would be great.?

Thank you

I am following few online tutorial to classify images and started off with dense layers as a starting point to classify cifar10 data.

# Create a model and add layers
model = Sequential()
model.add(Dense(512, activation='relu', input_shape=(32, 32, 3)))
model.add(Dense(10, activation='softmax'))

# Print summary
model.summary()

enter image description here

dense_1 output shape (None, 32, 32, 512). None represents the bath size but i had a hard time understand why there is 32,32 ? Why isn't the shape is (None, 512)? Same happens with dense_2 layer.

For sure, i am missing some thing and can't figure it out. Can some one explain it here or point me to the resource that explains this, would be great.

Thank you

I am following an online tutorial to classify images and started off with dense layers as a starting point to classify cifar10 data.

# Create a model and add layers
model = Sequential()
model.add(Dense(512, activation='relu', input_shape=(32, 32, 3)))
model.add(Dense(10, activation='softmax'))

# Print summary
model.summary()

enter image description here

dense_1 output shape (None, 32, 32, 512). 'None' represents the batch size, but what does '32,32' represent? Why isn't the shape (None, 512)? Same happens with the dense_2 layer.

Can someone explain it here or point me to a resource that explains this?

Thank you

Bumped by Community user
Source Link
BhanuKiran
  • 293
  • 1
  • 3
  • 7

Can't understand Output shape of a Dense layer - keras

I am following few online tutorial to classify images and started off with dense layers as a starting point to classify cifar10 data.

# Create a model and add layers
model = Sequential()
model.add(Dense(512, activation='relu', input_shape=(32, 32, 3)))
model.add(Dense(10, activation='softmax'))

# Print summary
model.summary()

enter image description here

dense_1 output shape (None, 32, 32, 512). None represents the bath size but i had a hard time understand why there is 32,32 ? Why isn't the shape is (None, 512)? Same happens with dense_2 layer.

For sure, i am missing some thing and can't figure it out. Can some one explain it here or point me to the resource that explains this, would be great.

Thank you