One aim of the question is related to adding a regressor on-top of a classifier model; and if this is possible, it will help a lot of people who are dealing with such problems.
The problem I presented is one example. For a binary vector of size 512, there are 2^512 different/possible states depending on the binary entries, right?
I will use sigmoid + BCELoss and see how it goes.
@deJQK  using sigmoid, the output will be bounded in the range [0, 1]. A simple rounding, thus, will do.