SaashaJoshi / piQture

piQture: A quantum machine learning library for image processing.
https://saashajoshi.github.io/piQture/
Apache License 2.0
15 stars 7 forks source link

Configure MLflow workflows #53

Closed SaashaJoshi closed 2 months ago

SaashaJoshi commented 5 months ago

Configure MLflow workflows for training, model and parameter logging, and model registry for deployment purposes.

Things to add:

Also, refer to this multi-step workflow example here.

SaashaJoshi commented 5 months ago

The QML model, in the form of a NeuralNetworkClassifier, does not conform to the mlflow.pyfunc.PythonModel instance and cannot be saved through mlflow.pyfunc.save_model class method.

One possible solution is to build a wrapper around the EstimatorQNN primitive and the NeuralNetworkClassifier so that it represents a PythonModel that evaluates inputs and produces API-compatible outputs when called after training.

Refer Issue #58

SaashaJoshi commented 5 months ago

Models perhaps need to be made Serializable to support saving and loading. Refer here.

SaashaJoshi commented 3 months ago

Also, add configuration for registering the trained model in a Model Registry. For example,


- name: Log with MLflow and Register Model
        run: |
          mlflow run . --experiment-name=${{ secrets.MLFLOW_EXPERIMENT_NAME }} --no-conda
          mlflow models register -m "runs:/${{ github.sha }}/model" -n "your_model_name" -r "your_model_version" --experiment-name="${{ secrets.MLFLOW_EXPERIMENT_NAME }}" --no-conda
        env:
          MLFLOW_TRACKING_URI: ${{ secrets.MLFLOW_TRACKING_URI }}  
          MLFLOW_REGISTRY_URI: ${{ secrets.MLFLOW_REGISTRY_URI }}  
          MLFLOW_EXPERIMENT_NAME: ${{ secrets.MLFLOW_EXPERIMENT_NAME }} 
SaashaJoshi commented 2 months ago

This PR is transferred to another GitHub repo. Refer here.