mlpack-testing

Logo

mlpack features I am working on.

View the Project on GitHub iamshnoo/mlpack-testing

Soft Margin Loss

Contains work done on the Soft Margin Loss function.

#2494

Blog post

What’s in this folder

  1. Soft_Margin_Loss.ipynb - comparison between PyTorch/numpy and mlpack/armadillo implementations of the layer.
  2. test.cpp - Armadillo implementation of the loss function’s functionality.

How to run

To run the .cpp files, you need to have armadillo installed in your system.

g++ test.cpp -o test -larmadillo && ./test

To run Soft_Margin_Loss.ipynb, you would need pytorch, numpy and armadillo. To avoid issues with linking the libraries correctly, it is better to run the notebook in Google Colab.

Soft Margin Loss