A library to calculate sharpness value of loss-landscapes
Project description
landscapelaser
Implementation of the landscapelaser PyPi package.
Calculates sharpness of the loss landscape of a model.
Use
To use the package, do:
from landscapelaser import LandscapeLaser
ll = LandscapeLaser()
import numpy as np
arr = np.random.random((20,20))
sharpness, mean_loss = ll.calculate(values=arr)
print(
f'The sharpness measure of the loss landscape is `{sharpness}`'
f' with mean loss over the landscape equal to `{mean_loss}`'
)
Here, arr is a 2d numpy array containing the loss values in the landscape. To calculate this, refer to loss-landscapes package.
Installation
The package is available on PyPI. Install using:
pip install landscapelaser
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
landscapelaser-0.1.1.tar.gz
(4.0 kB
view details)
File details
Details for the file landscapelaser-0.1.1.tar.gz
.
File metadata
- Download URL: landscapelaser-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a53a88f37cc570aca19a8b3a5cbba39e61d307fdcb897df928f38a4bca4c076f |
|
MD5 | 4052a9e60f363b21356c212af739a920 |
|
BLAKE2b-256 | abb81b2af57dadabe5fe41cabf0b126df13d888b7b02df5e43f55f849f0a518d |