Skip to main content

Python package to explore the loss landscape of Machine Learning models

Project description

PyLandscape

Introduction

pylandscape is a pytorch library for Hessian based analysis of neural network models. The library enables computing the following metrics:

NOTE: All the functionalities relative to the computation of the Hessian metrics have been embedded via PyHessian. If your interested in learning more about how these metrics are computed have a look to their Repository.

Usage

Install from Pip

You can install the library from pip (soon available!)

pip install pylandscape

Install from source

You can also compile the library from source

git clone https://github.com/balditommaso/PyLandscape.git
pip install -r requirements.txt
pip install .

Download the HGCAL dataset

You can download the dataset for the ECON-T model

wget -P ./data/ECON/ https://retis.santannapisa.it/~tbaldi/hgcal_dataset/hgcal22data_signal_driven_ttbar_v11.tar.gz 
tar -xvf ./data/ECON/hgcal22data_signal_driven_ttbar_v11.tar.gz -C ./data/ECON
mv ./data/ECON/hgcal22data_signal_driven_ttbar_v11/nElinks_5/*.csv ./data/ECON/

Download the Fusion dataset

Soon available!

Train full precision (FP32) version of the model

. scripts/train.sh \
    --config ./config/econ/baseline.yml \
    --bs 1024 \
    --lr 0.0015625 \
    --device_id 0 \
    --num_test 3 \
    --full_precision

Citation

PyLandscape has been developed as part of the following paper. We appreciate it if you would please cite the following paper if you found the library useful for your work:

  • T. Baldi, J. Campos, O. Weng, C. Geniesse, N. Tran, R. Kastner, A. Biondi. Loss Landscape Analysis for Reliable Quantized ML Models for Scientific Sensing, 2025, PDF.

Project details


Download files

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

Source Distribution

pylandscape-0.0.10.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylandscape-0.0.10-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file pylandscape-0.0.10.tar.gz.

File metadata

  • Download URL: pylandscape-0.0.10.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for pylandscape-0.0.10.tar.gz
Algorithm Hash digest
SHA256 0b60715293c55017f7b1d0e7e034310a808de9e494aa26d8000f2ae355ac2515
MD5 9e05773eb7b1f9fa82293b31cc570455
BLAKE2b-256 6f17594d88436ec7dee57f941b0f580d21e9d9106813f11861c8366098476655

See more details on using hashes here.

File details

Details for the file pylandscape-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: pylandscape-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for pylandscape-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 66d995e8b6ba2deed360ddbc280c707202785cb47a4f1cc1d83ad61bf539cd8c
MD5 57b7327e948f85cdb710bce01e0c5066
BLAKE2b-256 09d53e62f82c359b24c4d60750259626a2108372febb00493516b405c665ef40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page