Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move Trains logger from PL #86

Merged
merged 6 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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