Thanks for double confirming @nielsr.



 nielsr:

yes. If you change the number of output neurons, then you’ll get a new linear layer whose weights and bias are randomly initialized.


_num_labels is the 2nd parameter in Bert Config (shown in the model config above), and yes, changing it is optional.