Skip to content

Commit

Permalink
add Trains logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Jul 2, 2020
1 parent 1fdbac7 commit 9b6db48
Show file tree
Hide file tree
Showing 5 changed files with 500 additions and 1 deletion.
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 pytorch_lightning.loggers.trains import TrainsLogger
except ImportError: # pragma: no-cover
pass # pragma: no-cover
else:
__all__.append('TrainsLogger')
Loading

0 comments on commit 9b6db48

Please sign in to comment.