Integration with PyCaffe (Using Step)
This topic shows you how to integrate the MissingLink SDK with a PyCaffe LeNet network that is trained on the MNIST dataset.
The following steps are covered:
- Define a project callback with your credentials.
- Create a new experiment.
- Give the experiment a name and description.
- Use MissingLink's PyCaffeCallback to create a wrapped SGDSolver.
You can also consider trying thefor integrating the MissingLink SDK with an existing PyCaffe example.
You must have Caffe installed in the same working environment that MissingLink SDK is installed. The SDK doesn't enforce Caffe as one of its dependencies.
You must have created a new project. If not, follow the instructions in Creating a project.
Ensure that you can successfully run the basictraining script. In the steps that follow below, the basic script is integrated with the MissingLink SDK to enable remote monitoring of the training,validation, and testing process.
Compare thewith the .
Import the SDK and define your credentials at the beginning of the file (before any function definition).
PyCaffeCallbackinstance with your credentials. This helps to monitor the experiment in real time. Add the following statement before creating a solver:
missinglink_callback = missinglink.PyCaffeCallback()
(Optional) Give the experiment a name and description by adding the following statement right after creating the MissingLink's PyCaffeCallback.
missinglink_callback.set_properties( display_name='MNIST', description='LeNet network')
Next, instead of creating an original caffe solver, use the callback to create a wrapped solver. Modify the original solver creation statement with this statement:
solver = missinglink_callback.create_wrapped_solver( caffe.SGDSolver, 'mnist/lenet_auto_solver.prototxt')
You can find the full, updated script.
Use the created solver to step through the required number of iterations.
solver = missinglink_callback.create_wrapped_solver( caffe.SGDSolver, 'mnist/lenet_auto_solver.prototxt') ITERATIONS = 1000 for i in range(ITERATIONS): solver.step(1)
The SDK automatically collects the validation metrics on each test interval.
To track validation metrics, use the test_interval configuration.
You should have integrated MissingLink's SDK successfully.
- Inspect the resulting .
- Run the new script and see how the MissingLink.ai dashboard helps with monitoring the experiment. A description follows.
Web dashboard monitoring
You can monitor your experiment on your MissingLink dashboard.
Click on the experiment to view your metric graphs.
Learn more about integrating with PyCaffe to enable the following MissingLink features: