0
$\begingroup$

I'm using MobileNetV2 for classification, and I want to add dense layers(i remove the last layer of the MobileNetV2 model). How do I choose the number of units for the dense layer after obtaining the feature vector (1280)? Is there a formula to determine the units for each dense layer I add?

$\endgroup$

2 Answers 2

2
$\begingroup$

Not only the units but also the number of layers... you can reason over something like "how complex is your task", but usually we resort to grid search over some educated guesses (like 2/3 layer of 128/256 neurons, but depends)

$\endgroup$
1
$\begingroup$

In adition to @Alberto answer, Start by the same number of layer and units you removed from original model. If the problem is the same, this will be probably the best solution. After that, if the results is good enough, try reducing until results start fading, if result is not good, build up progressively. Rule of the thumb, More layer for more complicated task, more units for bigger number of inputs task.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .