Sorry for the confusion.   The diagram is a concept of what I’m trying to do.  The code is the custom data class that returns the transformed image, target label and the policy (which is the ID).  I need to average a feature set when there are more than one image per ID to the ID, then join that with the tabular dataset to predict a binary outcome.
Does that make sense?  Let me know if it doesn’t.  I’m newish to Pytorch.