Reputation: 1658
So I am creating a tensorflow model but it uses an existing model whose output has a shape of [1, 512] or something like that. I want to add a couple of layers to it at the end but it needs to end up with the same output shape as the number of classes which is something much smaller
[1, 5] for example.
What is the best way to reduce the output so it matches without losing too much data?
I tried pooling but I don't think I understand it enough.
Upvotes: 0
Views: 66
Reputation: 17201
You can connect the output to a dense layer like: logits = tf.layers.dense(outputs, units=5)
to reduce from 512
to 5
output units.
Upvotes: 1