{"id":23673,"library":"entmax","title":"entmax","description":"A family of sparse alternatives to softmax, including entmax, sparsemax, normmax, and budget, with corresponding loss functions. Current version: 1.3. Release cadence is irregular, with updates as needed for bug fixes and new activations.","status":"active","version":"1.3","language":"python","source_language":"en","source_url":"https://github.com/deep-spin/entmax","tags":["entmax","sparsemax","sparse-activation","deep-learning","pytorch"],"install":[{"cmd":"pip install entmax","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"Official import path for the entmax loss function.","symbol":"entmax_loss","correct":"from entmax import entmax_loss"},{"note":"Official import path for the Sparsemax activation layer.","symbol":"Sparsemax","correct":"from entmax import Sparsemax"}],"quickstart":{"code":"import torch\nfrom entmax import entmax15, entmax_bisect\n\nx = torch.randn(2, 5)\ny = entmax15(x, dim=-1)\nprint(y)\nz = entmax_bisect(x, alpha=1.5, dim=-1)\nprint(z)","lang":"python","description":"Apply entmax-1.5 activation and the generic bisection-based entmax function."},"warnings":[{"fix":"Install PyTorch first: pip install torch. Then proceed with pip install entmax.","message":"entmax 1.x requires PyTorch to be installed before installation. Attempting to install entmax without torch will fail. Use conda or pip to install PyTorch first.","severity":"gotcha","affected_versions":"<=1.3"},{"fix":"Use entmax15 or Sparsemax for standard alphas; use bisection only for custom alphas.","message":"The bisection-based functions (entmax_bisect, etc.) are slower than the closed-form variants. They are intended for non-standard alpha values (not 1.5 or 2).","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Migrate to entmax15 (alpha=1.5) or Sparsemax (alpha=2).","message":"The 'alpha' parameter in some older functions is deprecated; use the specific entmax15 or Sparsemax functions instead.","severity":"deprecated","affected_versions":"<=1.2"}],"env_vars":null,"search_vec":"'1.3':21 'activ':35,40 'altern':6 'budget':14 'bug':31 'cadenc':23 'correspond':16 'current':19 'deep':42 'deep-learn':41 'entmax':1,10,36 'famili':3 'fix':32 'function':18 'includ':9 'irregular':25 'learn':43 'loss':17 'need':29 'new':34 'normmax':12 'pytorch':44 'releas':22 'softmax':8 'spars':5,39 'sparse-activ':38 'sparsemax':11,37 'updat':27 'version':20","created_at":"2026-05-01T08:09:00.761800+00:00","updated_at":"2026-05-01T08:09:00.761800+00:00","problems":{"verify_error":"/tmp/tmpehgftby3/venv/lib/python3.12/site-packages/torch/_subclasses/functional_tensor.py:362: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n  cpu = _conversion_method_template(device=torch.device(\"cpu\"))\nTra"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/deep-spin/entmax","docs":null,"changelog":null,"pypi":"https://pypi.org/project/entmax/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-09","install_tag":null}}