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 hashes)