Skip to content

Commit

Permalink
move Trains logger from PL (#86)
Browse files Browse the repository at this point in the history
* add Trains logger

* req

* import

* import

* docs

* docs
  • Loading branch information
Borda authored Jul 2, 2020
1 parent 1fdbac7 commit 27c1e08
Show file tree
Hide file tree
Showing 8 changed files with 511 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ def find_source():
import os
import torch
import pytorch_lightning as pl
from pytorch_lightning import Trainer, LightningModule
from pytorch_lightning.utilities import NATIVE_AMP_AVALAIBLE
APEX_AVAILABLE = importlib.util.find_spec("apex") is not None
XLA_AVAILABLE = importlib.util.find_spec("torch_xla") is not None
Expand Down
41 changes: 41 additions & 0 deletions docs/source/loggers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,47 @@ These loggers may be more unstable, in development, or not fully tested yet.

---------

allegro.ai TRAINS
^^^^^^^^^^^^^^^^^

`allegro.ai <https://github.com/allegroai/trains/>`_ is a third-party logger.
To use :class:`~pl_bolts.loggers.TrainsLogger` as your logger do the following.
First, install the package:

.. code-block:: bash
pip install trains
Then configure the logger and pass it to the :class:`~pl_bolts.trainer.trainer.Trainer`:

.. testcode::

from pl_bolts.loggers import TrainsLogger
trains_logger = TrainsLogger(
project_name='examples',
task_name='pytorch lightning test',
)
trainer = Trainer(logger=trains_logger)

.. testoutput::
:options: +ELLIPSIS, +NORMALIZE_WHITESPACE
:hide:

TRAINS Task: ...
TRAINS results page: ...

.. testcode::

class MyModule(LightningModule):
def __init__(self):
some_img = fake_image()
self.logger.experiment.log_image('debug', 'generated_image_0', some_img, 0)

.. seealso::
:class:`~pl_bolts.loggers.TrainsLogger` docs.

---------

Your Logger
-----------
Add your loggers here!
9 changes: 9 additions & 0 deletions pl_bolts/loggers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""
Collection of PyTorchLightning loggers
"""

__all__ = []

try:
from pl_bolts.loggers.trains import TrainsLogger
except ImportError: # pragma: no-cover
pass # pragma: no-cover
else:
__all__.append('TrainsLogger')
Loading

0 comments on commit 27c1e08

Please sign in to comment.