From efe23ffc2c1e6b414ef2a1631c9ed8f7f7197bd3 Mon Sep 17 00:00:00 2001 From: Jintao Huang Date: Sat, 15 Oct 2022 19:05:20 +0800 Subject: [PATCH] v0.1.4 --- README.md | 2 +- examples/dqn.py | 2 +- mini_lightning/__init__.py | 8 ++++---- mini_lightning/{mini_lightning.py => _mini_lightning.py} | 2 +- mini_lightning/{utils.py => _utils.py} | 0 mini_lightning/{visualize.py => _visualize.py} | 0 mini_lightning/{warmup_lrs.py => _warmup_lrs.py} | 1 - 7 files changed, 7 insertions(+), 8 deletions(-) rename mini_lightning/{mini_lightning.py => _mini_lightning.py} (99%) rename mini_lightning/{utils.py => _utils.py} (100%) rename mini_lightning/{visualize.py => _visualize.py} (100%) rename mini_lightning/{warmup_lrs.py => _warmup_lrs.py} (97%) diff --git a/README.md b/README.md index 9caf58b..3673adc 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ 2. Download the latest version (>=1.12) of Torch(corresponding CUDA version) from the [official website](https://pytorch.org/get-started/locally/) of Torch. It is not recommended to automatically install Torch (CUDA 10.2 default) using the Mini-Lightning dependency, which will cause CUDA version mismatch. 3. Install mini-lightning ```bash -# from pypi (v0.1.3) +# from pypi (v0.1.4) pip install mini-lightning # Or download the files from the repository to local, diff --git a/examples/dqn.py b/examples/dqn.py index 403133f..33e37ea 100644 --- a/examples/dqn.py +++ b/examples/dqn.py @@ -206,7 +206,7 @@ def training_step(self, batch: Any) -> Tensor: "optim_name": "SGD", "dataloader_hparams": {"batch_size": batch_size}, "optim_hparams": {"lr": 1e-2, "weight_decay": 1e-4}, # - "trainer_hparams": {"max_epochs": max_epochs, "gradient_clip_norm": 20}, + "trainer_hparams": {"max_epochs": max_epochs, "gradient_clip_norm": 20, "verbose": False}, # "rand_p": { "eta_max": 1, diff --git a/mini_lightning/__init__.py b/mini_lightning/__init__.py index d2b667b..c39ee47 100644 --- a/mini_lightning/__init__.py +++ b/mini_lightning/__init__.py @@ -1,4 +1,4 @@ -from .mini_lightning import * -from .utils import * -from .warmup_lrs import * -from .visualize import * +from ._mini_lightning import * +from ._utils import * +from ._warmup_lrs import * +from ._visualize import * diff --git a/mini_lightning/mini_lightning.py b/mini_lightning/_mini_lightning.py similarity index 99% rename from mini_lightning/mini_lightning.py rename to mini_lightning/_mini_lightning.py index e7b1755..d71974a 100644 --- a/mini_lightning/mini_lightning.py +++ b/mini_lightning/_mini_lightning.py @@ -873,7 +873,7 @@ def test(self, dataloader: Optional[DataLoader], test_best: bool = False, test_l # if test_last: # just current model if self._best_ckpt_is_last() and test_best is True: - logger.info("Ignore test last: the best ckpt is the last ckpt") + logger.info("Ignore test last: the best ckpt and the last ckpt is the same") else: m = self._test(dataloader, "last") res_mes.update(m) diff --git a/mini_lightning/utils.py b/mini_lightning/_utils.py similarity index 100% rename from mini_lightning/utils.py rename to mini_lightning/_utils.py diff --git a/mini_lightning/visualize.py b/mini_lightning/_visualize.py similarity index 100% rename from mini_lightning/visualize.py rename to mini_lightning/_visualize.py diff --git a/mini_lightning/warmup_lrs.py b/mini_lightning/_warmup_lrs.py similarity index 97% rename from mini_lightning/warmup_lrs.py rename to mini_lightning/_warmup_lrs.py index 74058b4..b70c262 100644 --- a/mini_lightning/warmup_lrs.py +++ b/mini_lightning/_warmup_lrs.py @@ -5,7 +5,6 @@ import math from typing import List, Callable, Union, Dict, Optional # -from torch.optim.lr_scheduler import _LRScheduler as LRScheduler, CosineAnnealingLR from torch.optim import Optimizer __all__ = ["get_T_max", "warmup_decorator", "cosine_annealing_lr"]