diff --git a/README.md b/README.md index 0fd1ba7..e8a2386 100644 --- a/README.md +++ b/README.md @@ -61,5 +61,19 @@ for epoch in range(num_epochs): For a complete example, see the [MNIST Early Stopping Example Notebook](MNIST_Early_Stopping_example.ipynb). +## Citation + +If you find this package useful in your research, please consider citing it as: + +```bibtex +@misc{early_stopping_pytorch, + author = {Bjarte Sunde}, + title = {early-stopping-pytorch: A PyTorch utility package for Early Stopping}, + year = {2024}, + url = {https://github.com/Bjarten/early-stopping-pytorch}, + note = {Version 1.0.7} +} +``` + ## References The ```EarlyStopping``` class in ```early_stopping_pytorch/early_stopping.py``` is inspired by the [ignite EarlyStopping class](https://github.com/pytorch/ignite/blob/master/ignite/handlers/early_stopping.py). diff --git a/pyproject.toml b/pyproject.toml index d73b325..4ef16a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,18 @@ dependencies = [ "torch>=1.9.0" ] +[project.urls] +Repository = "https://github.com/Bjarten/early-stopping-pytorch" + [tool.semantic_release] -version_variables = ["early_stopping_pytorch/__init__.py:__version__"] +version_variables = [ + "early_stopping_pytorch/__init__.py:__version__", + "README.md:version_note" +] +version_pattern = ''' + (?P__version__\s*=\s*['"](?P[^'"]+)['"]) | + (?Pnote\s*=\s*\{Version\s(?P[^}]+)\}) +''' tag_format = "v{version}" version_toml = ["pyproject.toml:project.version"] branch = "main"