diff --git a/docs/source/callbacks.rst b/docs/source/callbacks.rst index ae8dd25f..cfeaa81d 100644 --- a/docs/source/callbacks.rst +++ b/docs/source/callbacks.rst @@ -2,7 +2,7 @@ :class: hidden-section Callbacks -=========== +========= .. automodule:: pytorch_lightning.callbacks :exclude-members: _del_model, diff --git a/docs/source/conf.py b/docs/source/conf.py index e9cfddcb..54d35d11 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -348,8 +348,10 @@ def linkcode_resolve(domain, info): autodoc_member_order = 'groupwise' autoclass_content = 'both' +# the options are fixed and will be soon in release, +# see https://github.com/sphinx-doc/sphinx/issues/5459 autodoc_default_options = { - 'members': True, + 'members': None, 'special-members': '__call__', 'undoc-members': True, # 'exclude-members': '__weakref__', diff --git a/docs/source/experiment_logging.rst b/docs/source/experiment_logging.rst index e3f5f83b..853f2505 100644 --- a/docs/source/experiment_logging.rst +++ b/docs/source/experiment_logging.rst @@ -2,7 +2,7 @@ Experiment Logging =================== Comet.ml -^^^^^^^^^^ +^^^^^^^^ `Comet.ml `_ is a third-party logger. To use CometLogger as your logger do the following. @@ -63,7 +63,7 @@ The Neptune.ai is available anywhere in your LightningModule self.logger.experiment.add_image('generated_images', some_img, 0) Tensorboard -^^^^^^^^^^^^^ +^^^^^^^^^^^ To use `Tensorboard `_ as your logger do the following. @@ -88,7 +88,7 @@ The TensorBoardLogger is available anywhere in your LightningModule Test Tube -^^^^^^^^^^^^^ +^^^^^^^^^ `Test Tube `_ is a tensorboard logger but with nicer file structure. To use TestTube as your logger do the following. @@ -113,7 +113,7 @@ The TestTubeLogger is available anywhere in your LightningModule self.logger.experiment.add_image('generated_images', some_img, 0) Wandb -^^^^^^^^^^^^^ +^^^^^ `Wandb `_ is a third-party logger. To use Wandb as your logger do the following. diff --git a/docs/source/experiment_reporting.rst b/docs/source/experiment_reporting.rst index ce3a2784..5f61c6b9 100644 --- a/docs/source/experiment_reporting.rst +++ b/docs/source/experiment_reporting.rst @@ -7,7 +7,7 @@ used in each experiment. Control logging frequency -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^ It may slow training down to log every single batch. Trainer has an option to log every k batches instead. @@ -17,7 +17,7 @@ It may slow training down to log every single batch. Trainer has an option to lo Trainer(row_log_interval=10) Control log writing frequency -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Writing to a logger can be expensive. In Lightning you can set the interval at which you want to log using this trainer flag. @@ -30,7 +30,7 @@ want to log using this trainer flag. Trainer(log_save_interval=k) Log metrics -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^ To plot metrics into whatever logger you passed in (tensorboard, comet, neptune, etc...) @@ -90,7 +90,7 @@ For instance, here we log images using tensorboard. return results Modify progress bar -^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^ Each return dict from the training_end, validation_end, testing_end and training_step also has a key called "progress_bar". @@ -108,7 +108,7 @@ Here we show the validation loss in the progress bar return results Snapshot hyperparameters -^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^ When training a model, it's useful to know what hyperparams went into that model. When Lightning creates a checkpoint, it stores a key "hparams" with the hyperparams. @@ -122,7 +122,7 @@ when using the TestTubeLogger or the TensorBoardLogger, all hyperparams will sho in the `hparams tab `_. Snapshot code -^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^ Loggers also allow you to snapshot a copy of the code used in this experiment. For example, TestTubeLogger does this with a flag: diff --git a/docs/source/test_set.rst b/docs/source/test_set.rst index abbf48fd..60a9f9a2 100644 --- a/docs/source/test_set.rst +++ b/docs/source/test_set.rst @@ -17,7 +17,7 @@ To run the test set after training completes, use this method Test pre-trained model ------------------ +---------------------- To run the test set on a pretrained model, use this method. .. code-block:: python diff --git a/docs/source/trainer.rst b/docs/source/trainer.rst index db2657dc..fc4f7ee8 100644 --- a/docs/source/trainer.rst +++ b/docs/source/trainer.rst @@ -2,7 +2,8 @@ :class: hidden-section Trainer -=========== +======= + .. automodule:: pytorch_lightning.trainer :members: fit, test :exclude-members: diff --git a/pytorch_lightning/callbacks/pt_callbacks.py b/pytorch_lightning/callbacks/pt_callbacks.py index ccca95d0..65d06a8f 100644 --- a/pytorch_lightning/callbacks/pt_callbacks.py +++ b/pytorch_lightning/callbacks/pt_callbacks.py @@ -376,7 +376,7 @@ class GradientAccumulationScheduler(Callback): Args: scheduling (dict): scheduling in format {epoch: accumulation_factor} - warning:: Epochs indexing starts from "1" until v0.6.x, but will start from "0" in v0.8.0. + .. warning:: Epochs indexing starts from "1" until v0.6.x, but will start from "0" in v0.8.0. Example:: diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py index a0df8dc1..7419e174 100644 --- a/pytorch_lightning/core/lightning.py +++ b/pytorch_lightning/core/lightning.py @@ -898,14 +898,14 @@ class LightningModule(ABC, GradInformation, ModelIO, ModelHooks): """ @data_loader - def tng_dataloader(self): + def tng_dataloader(self): # todo: remove in v0.8.0 """Implement a PyTorch DataLoader. .. warning:: Deprecated in v0.5.0. use train_dataloader instead. """ output = self.train_dataloader() - warnings.warn("`tng_dataloader` has been renamed to `train_dataloader` since v0.5.0" - " and will be removed in v0.8.0", DeprecationWarning) + warnings.warn("`tng_dataloader` has been renamed to `train_dataloader` since v0.5.0." + " and this method will be removed in v0.8.0", DeprecationWarning) return output @data_loader diff --git a/pytorch_lightning/core/model_saving.py b/pytorch_lightning/core/model_saving.py index d607422c..278e6467 100644 --- a/pytorch_lightning/core/model_saving.py +++ b/pytorch_lightning/core/model_saving.py @@ -1,10 +1,11 @@ """ -.. warning:: `model_saving` module has been renamed to `saving` since v0.6.0 and will be removed in v0.8.0 +.. warning:: `model_saving` module has been renamed to `saving` since v0.6.0. + The deprecated module name will be removed in v0.8.0. """ import warnings -warnings.warn("`model_saving` module has been renamed to `saving` since v0.6.0" - " and will be removed in v0.8.0", DeprecationWarning) +warnings.warn("`model_saving` module has been renamed to `saving` since v0.6.0." + " The deprecated module name will be removed in v0.8.0.", DeprecationWarning) from pytorch_lightning.core.saving import ModelIO # noqa: E402 diff --git a/pytorch_lightning/core/root_module.py b/pytorch_lightning/core/root_module.py index abc97f3c..07f29049 100644 --- a/pytorch_lightning/core/root_module.py +++ b/pytorch_lightning/core/root_module.py @@ -1,8 +1,9 @@ """ -.. warning:: `root_module` module has been renamed to `lightning` since v0.6.0 and will be removed in v0.8.0 +.. warning:: `root_module` module has been renamed to `lightning` since v0.6.0. + The deprecated module name will be removed in v0.8.0. """ import warnings -warnings.warn("`root_module` module has been renamed to `lightning` since v0.6.0" - " and will be removed in v0.8.0", DeprecationWarning) +warnings.warn("`root_module` module has been renamed to `lightning` since v0.6.0." + " The deprecated module name will be removed in v0.8.0.", DeprecationWarning) diff --git a/pytorch_lightning/loggers/comet_logger.py b/pytorch_lightning/loggers/comet_logger.py index a5c5a786..47a524da 100644 --- a/pytorch_lightning/loggers/comet_logger.py +++ b/pytorch_lightning/loggers/comet_logger.py @@ -1,10 +1,11 @@ """ -.. warning:: `comet_logger` module has been renamed to `comet` since v0.6.0 and will be removed in v0.8.0 +.. warning:: `comet_logger` module has been renamed to `comet` since v0.6.0. + The deprecated module name will be removed in v0.8.0. """ import warnings -warnings.warn("`comet_logger` module has been renamed to `comet` since v0.6.0" - " and will be removed in v0.8.0", DeprecationWarning) +warnings.warn("`comet_logger` module has been renamed to `comet` since v0.6.0." + " The deprecated module name will be removed in v0.8.0.", DeprecationWarning) from pytorch_lightning.loggers.comet import CometLogger # noqa: E402 diff --git a/pytorch_lightning/loggers/mlflow_logger.py b/pytorch_lightning/loggers/mlflow_logger.py index 30993374..d8fc6359 100644 --- a/pytorch_lightning/loggers/mlflow_logger.py +++ b/pytorch_lightning/loggers/mlflow_logger.py @@ -1,10 +1,11 @@ """ -.. warning:: `mlflow_logger` module has been renamed to `mlflow` since v0.6.0 and will be removed in v0.8.0 +.. warning:: `mlflow_logger` module has been renamed to `mlflow` since v0.6.0. + The deprecated module name will be removed in v0.8.0. """ import warnings -warnings.warn("`mlflow_logger` module has been renamed to `mlflow` since v0.6.0" - " and will be removed in v0.8.0", DeprecationWarning) +warnings.warn("`mlflow_logger` module has been renamed to `mlflow` since v0.6.0." + " The deprecated module name will be removed in v0.8.0.", DeprecationWarning) from pytorch_lightning.loggers.mlflow import MLFlowLogger # noqa: E402 diff --git a/pytorch_lightning/loggers/test_tube_logger.py b/pytorch_lightning/loggers/test_tube_logger.py index bc531c05..cdd06823 100644 --- a/pytorch_lightning/loggers/test_tube_logger.py +++ b/pytorch_lightning/loggers/test_tube_logger.py @@ -1,10 +1,11 @@ """ -.. warning:: `test_tube_logger` module has been renamed to `test_tube` since v0.6.0 and will be removed in v0.8.0 +.. warning:: `test_tube_logger` module has been renamed to `test_tube` since v0.6.0. + The deprecated module name will be removed in v0.8.0. """ import warnings -warnings.warn("`test_tube_logger` module has been renamed to `test_tube` since v0.6.0" - " and will be removed in v0.8.0", DeprecationWarning) +warnings.warn("`test_tube_logger` module has been renamed to `test_tube` since v0.6.0." + " The deprecated module name will be removed in v0.8.0.", DeprecationWarning) from pytorch_lightning.loggers.test_tube import TestTubeLogger # noqa: E402 diff --git a/pytorch_lightning/logging/__init__.py b/pytorch_lightning/logging/__init__.py index ecd4c3b0..e57c0811 100644 --- a/pytorch_lightning/logging/__init__.py +++ b/pytorch_lightning/logging/__init__.py @@ -1,10 +1,11 @@ """ -.. warning:: `logging` package has been renamed to `loggers` since v0.6.1 and will be removed in v0.8.0 +.. warning:: `logging` package has been renamed to `loggers` since v0.6.1. + The deprecated package name will be removed in v0.8.0. """ import warnings warnings.warn("`logging` package has been renamed to `loggers` since v0.6.1" - " and will be removed in v0.8.0", DeprecationWarning) + " The deprecated package name will be removed in v0.8.0.", DeprecationWarning) from pytorch_lightning.loggers import * # noqa: F403 diff --git a/pytorch_lightning/overrides/override_data_parallel.py b/pytorch_lightning/overrides/override_data_parallel.py index c2631847..7685c4de 100644 --- a/pytorch_lightning/overrides/override_data_parallel.py +++ b/pytorch_lightning/overrides/override_data_parallel.py @@ -1,12 +1,12 @@ """ -.. warning:: `override_data_parallel` module has been renamed to `data_parallel` since v0.6.0 - and will be removed in v0.8.0 +.. warning:: `override_data_parallel` module has been renamed to `data_parallel` since v0.6.0. + The deprecated module name will be removed in v0.8.0. """ import warnings -warnings.warn("`override_data_parallel` module has been renamed to `data_parallel` since v0.6.0" - " and will be removed in v0.8.0", DeprecationWarning) +warnings.warn("`override_data_parallel` module has been renamed to `data_parallel` since v0.6.0." + " The deprecated module name will be removed in v0.8.0.", DeprecationWarning) from pytorch_lightning.overrides.data_parallel import ( # noqa: E402 get_a_var, parallel_apply, LightningDataParallel, LightningDistributedDataParallel) diff --git a/pytorch_lightning/pt_overrides/__init__.py b/pytorch_lightning/pt_overrides/__init__.py index 2f65f1f1..9db26c1e 100644 --- a/pytorch_lightning/pt_overrides/__init__.py +++ b/pytorch_lightning/pt_overrides/__init__.py @@ -1,10 +1,11 @@ """ -.. warning:: `pt_overrides` package has been renamed to `overrides` since v0.6.0 and will be removed in v0.8.0 +.. warning:: `pt_overrides` package has been renamed to `overrides` since v0.6.0. + The deprecated module name will be removed in v0.8.0. """ import warnings -warnings.warn("`pt_overrides` package has been renamed to `overrides` since v0.6.0" - " and will be removed in v0.8.0", DeprecationWarning) +warnings.warn("`pt_overrides` package has been renamed to `overrides` since v0.6.0." + " The deprecated module name will be removed in v0.8.0.", DeprecationWarning) from pytorch_lightning.overrides import override_data_parallel # noqa: E402 diff --git a/pytorch_lightning/root_module/__init__.py b/pytorch_lightning/root_module/__init__.py index 2ab9f1a0..efbc1524 100644 --- a/pytorch_lightning/root_module/__init__.py +++ b/pytorch_lightning/root_module/__init__.py @@ -1,11 +1,12 @@ """ -.. warning:: `root_module` package has been renamed to `core` since v0.6.0 and will be removed in v0.8.0 +.. warning:: `root_module` package has been renamed to `core` since v0.6.0. + The deprecated package name will be removed in v0.8.0. """ import warnings -warnings.warn("`root_module` package has been renamed to `core` since v0.6.0" - " and will be removed in v0.8.0", DeprecationWarning) +warnings.warn("`root_module` package has been renamed to `core` since v0.6.0." + " The deprecated package name will be removed in v0.8.0.", DeprecationWarning) from pytorch_lightning.core import ( # noqa: E402 decorators, grads, hooks, root_module, memory, model_saving diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py index a92c4d4e..fd29ccf6 100644 --- a/pytorch_lightning/trainer/trainer.py +++ b/pytorch_lightning/trainer/trainer.py @@ -499,7 +499,7 @@ class Trainer(TrainerIOMixin, # Backward compatibility if nb_gpu_nodes is not None: warnings.warn("`nb_gpu_nodes` has renamed to `num_nodes` since v0.5.0" - " and will be removed in v0.8.0", DeprecationWarning) + " and this method will be removed in v0.8.0", DeprecationWarning) if not num_nodes: # in case you did not set the proper value num_nodes = nb_gpu_nodes self.num_gpu_nodes = num_nodes @@ -509,7 +509,7 @@ class Trainer(TrainerIOMixin, # Backward compatibility if gradient_clip is not None: warnings.warn("`gradient_clip` has renamed to `gradient_clip_val` since v0.5.0" - " and will be removed in v0.8.0", DeprecationWarning) + " and this method will be removed in v0.8.0", DeprecationWarning) if not gradient_clip_val: # in case you did not set the proper value gradient_clip_val = gradient_clip self.gradient_clip_val = gradient_clip_val @@ -523,7 +523,7 @@ class Trainer(TrainerIOMixin, # Backward compatibility if max_nb_epochs is not None: warnings.warn("`max_nb_epochs` has renamed to `max_epochs` since v0.5.0" - " and will be removed in v0.8.0", DeprecationWarning) + " and this method will be removed in v0.8.0", DeprecationWarning) if not max_epochs: # in case you did not set the proper value max_epochs = max_nb_epochs self.max_epochs = max_epochs @@ -531,7 +531,7 @@ class Trainer(TrainerIOMixin, # Backward compatibility if min_nb_epochs is not None: warnings.warn("`min_nb_epochs` has renamed to `min_epochs` since v0.5.0" - " and will be removed in v0.8.0", DeprecationWarning) + " and this method will be removed in v0.8.0", DeprecationWarning) if not min_epochs: # in case you did not set the proper value min_epochs = min_nb_epochs self.min_epochs = min_epochs @@ -539,7 +539,7 @@ class Trainer(TrainerIOMixin, # Backward compatibility if nb_sanity_val_steps is not None: warnings.warn("`nb_sanity_val_steps` has renamed to `num_sanity_val_steps` since v0.5.0" - " and will be removed in v0.8.0", DeprecationWarning) + " and this method will be removed in v0.8.0", DeprecationWarning) if not num_sanity_val_steps: # in case you did not set the proper value num_sanity_val_steps = nb_sanity_val_steps @@ -642,7 +642,7 @@ class Trainer(TrainerIOMixin, # backward compatibility if add_row_log_interval is not None: warnings.warn("`add_row_log_interval` has renamed to `row_log_interval` since v0.5.0" - " and will be removed in v0.8.0", DeprecationWarning) + " and this method will be removed in v0.8.0", DeprecationWarning) if not row_log_interval: # in case you did not set the proper value row_log_interval = add_row_log_interval self.row_log_interval = row_log_interval @@ -728,7 +728,7 @@ class Trainer(TrainerIOMixin, Use `training_tqdm_dict` instead. Will remove 0.8.0. """ warnings.warn("`tng_tqdm_dic` has renamed to `training_tqdm_dict` since v0.5.0" - " and will be removed in v0.8.0", DeprecationWarning) + " and this method will be removed in v0.8.0", DeprecationWarning) return self.training_tqdm_dict # -----------------------------