 have a look at the SDK docs .

How do you use it?To log information from a ZenML pipeline step using the Neptune Experiment Tracker component in the active stack, you need to enable an experiment tracker using the @step decorator. Then fetch the Neptune run object and use logging capabilities as you would normally do. For example:

import numpy as np

import tensorflow as tf

from neptune_tensorflow_keras import NeptuneCallback

from zenml.integrations.neptune.experiment_trackers.run_state import (

get_neptune_run,

from zenml import step

@step(experiment_tracker="<NEPTUNE_TRACKER_STACK_COMPONENT_NAME>")

def tf_trainer(

x_train: np.ndarray,

y_train: np.ndarray,

x_val: np.ndarray,

y_val: np.ndarray,

epochs: int = 5,

lr: float = 0.001

) -> tf.keras.Model:

...

neptune_run = get_neptune_run()

model.fit(

x_train,

y_train,

epochs=epochs,

validation_data=(x_val, y_val),

callbacks=[

NeptuneCallback(run=neptune_run),

],

metric = ...

neptune_run["<METRIC_NAME>"] = metric

Instead of hardcoding an experiment tracker name, you can also use the Client to dynamically use the experiment tracker of your active stack:

from zenml.client import Client

experiment_tracker = Client().active_stack.experiment_tracker

@step(experiment_tracker=experiment_tracker.name)

def tf_trainer(...):

...

Additional configuration

You can pass a set of tags to the Neptune run by using the NeptuneExperimentTrackerSettings class, like in the example below:

import numpy as np

import tensorflow as tf

from zenml import step

from zenml.integrations.neptune.experiment_trackers.run_state import (

get_neptune_run,

from zenml.integrations.neptune.flavors import NeptuneExperimentTrackerSettings

neptune_settings = NeptuneExperimentTrackerSettings(tags={"keras", "mnist"})

@step(

experiment_tracker="<NEPTUNE_TRACKER_STACK_COMPONENT_NAME>",

settings={

"experiment_tracker.neptune": neptune_settings

def my_step(

x_test: np.ndarray,

y_test: np.ndarray,

model: tf.keras.Model,

) -> float:

"""Log metadata to Neptune run"""