Are your sequences of fixed size (fixed K)? If so you can do as @ptrblck suggests and use a nn.BCELoss or nn.MultiLabelSoftMarginLoss (will treat the problem as a multi-label problem).
If K is variable then I’d suggest treating the problem as a temporal classification by having an LSTM that returns single value predictions per temporal step and using a standard cross-entropy loss.