Skip to main content

BP-MLL loss function for tensorflow

Project description


Efficient (vectorized) implementation of the BP-MLL loss function in TensorFlow (

BP-MLL is a loss function designed for multi-label classification using neural networks. It was introduced by Zhang & Zhou in [1]. Note that in line with [1], every sample needs to have at least one label and no sample may have all labels.


pip3 install bpmll


from bpmll import bp_mll_loss

Then simply use it as a function in your tensorflow or keras models.

Check out for an example of training a simple multilayer perceptron using Keras with BP-MLL.


[1] Zhang, Min-Ling, and Zhi-Hua Zhou. "Multilabel neural networks with applications to functional genomics and text categorization." IEEE transactions on Knowledge and Data Engineering 18.10 (2006): 1338-1351.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bpmll, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size bpmll-1.0.0-py3-none-any.whl (3.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size bpmll-1.0.0.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page