Catalyst integration API reference

API reference for the Neptune-Catalyst integration.

You can use the CatalystNeptuneLoggerclass to capture model training metadata.

NeptuneLogger

Neptune logger for parameters, metrics, images and artifacts (such as videos, audio, and model checkpoints).

Parameters

Name Type Default Description
base_namespace str, optional experiment Namespace under which all metadata logged by the Neptune logger will be stored.
api_token str, optional None User's API token. If None, the value of theNEPTUNE_API_TOKENenvironment variable is used.To keep your token secure, avoid placing it in the source code. Instead,save it as an environment variable.
project str, optional None Name of a project in the formworkspace-name/project-name. If None, the value of theNEPTUNE_PROJECTenvironment variable is used.
run Run, optional None An existing run reference, as returned byneptune.init_run().
log_batch_metrics boolean, optional SETTINGS.log_batch_metricsorFalse Boolean flag to log batch metrics.
log_epoch_metrics boolean, optional SETTINGS.log_epoch_metricsorTrue Boolean flag to log epoch metrics.
**neptune_run_kwargs str, optional - Additional keyword arguments to be passed directly to theinit_run()function, such asdescriptionandtags. If therunparameter is set toNone,NeptuneLoggerwill create aRunobject for you.

To keep your token secure, avoid placing it in the source code. Instead,save it as an environment variable.

Examples

Add NeptuneLogger through thetrain()function:

from catalyst import dl
runner = dl.SupervisedRunner()
runner.train(
 ...
 loggers={
 "neptune": dl.NeptuneLogger(
 project="workspace-name/project-name", # (1)!
 tags=["pretraining", "retina"], # kwargs for neptune.init_run()
 )
 }
)
  1. The full project name. For example,"ml-team/classification".
  2. You can copy the name from the project details ( → Details & privacy )
  3. You can also find a pre-filled project string in Experiments → Create a new run .

The full project name. For example,"ml-team/classification".

Add NeptuneLogger from within custom runner implementation:

from catalyst import dl
class CustomRunner(dl.IRunner):
 # ...
 def get_loggers(self):
 return {
 "console": dl.ConsoleLogger(),
 "neptune": dl.NeptuneLogger(project="workspace-name/project-name"),
 }
 # ...
runner = CustomRunner().run()

You can also add the Neptune logger through Config API and Hydra API:

# Config API
loggers:
 neptune:
 _target_: NeptuneLogger
 project: workspace-name/project-name
...
# Hydra API
loggers:
 neptune:
 _target_: catalyst.dl.NeptuneLogger
 project: workspace-name/project-name
 base_namespace: catalyst
...

See also

  • NeptuneLogger reference in the Catalyst API docs

This page is originally sourced from the legacy docs.