Pass Run object between files

Pass Run object around to log from multiple Python files

When you create a run object:

run = neptune.init(project='my_workspace/my_project')

You can pass it around and use it to populate functions’ parameters and perform logging from multiple Python files.

Let’s create a recipe for that:

# Import from file shown below
from utils import log_images_epoch
# Create run in project
run = neptune.init(project='my_workspace/my_project')
# Log metrics in the same file
run['train/acc'] = 0.95
run['train/f1'] = 0.65
# Log by using imported function, pass 'run'

# 'run' is Neptune run
def log_images_epoch(run):
image1 = ...
image2 = ...

In this way you can work with larger codebase and use logging from multiple Python files.