See the Quick Start Guide on how to install and configure the profiler.

To profile Keras training and inference, use a callback. Only some of the batches will be profiled; the profiler decides which batches to profile for optimal statistics and low overhead.

Profile training:

from graphsignal.profilers.keras import GraphsignalCallback, callbacks=[GraphsignalCallback()])

Profile prediction:

from graphsignal.profilers.keras import GraphsignalCallback

model.predict(..., callbacks=[GraphsignalCallback()])


The Keras MNIST example illustrates how to add the profiler callback.