Keras

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

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

Profile prediction:

from graphsignal.profilers.keras import GraphsignalCallback

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

Examples

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