Thanks for your excellent advice, which I will heed!
I have found a paper with a (potentially) good criterion function for blockmodeling.  I will try to create a custom loss function from it in PyTorch.  However, I won’t forget to test some of the standard functions already available too.
Thanks again.