Implementing One Class SVM in PyTorch

You could try to use e.g. nn.MultiLabelMarginLoss, which is the multi-classification hinge loss and create the desired targets for your “One Class SVM”.

1 Like