StarChart is a tool to manage Google Cloud Machine Learning training programs and model versions.
- Manage your training programs.
.
├── MODEL_NAME
│ ├── setup.py
│ └── trainer
│ ├── __init__.py
│ └── task.py
└── MODEL_NAME
└── ...
- Train your training programs.
$ starchart train ...
StarChart uploads your training program to cloud storage and submit train job. You may not have to worry about job id, and cloud storage training paths.
- Expose your model.
$ starchart expose ...
StarChart create model and version from your successful jobs. And it dumps a model file which define model and version information.
-
Change default version.
$ starchart apply ...
StarChart set default version followed by the model file
isDefault
parameter.
# Train
$ starchart train \
-m=MODEL_NAME \
-M=MODULE_NAME \
-- \
--your_train_param=FOO
# State
$ starchart state -m=MODEL_NAME
# Expose
$ starchart expose -m=MODEL_NAME
# Apply
$ starchart apply -m=MODEL_NAME
You can use TRAIN_PATH
in your train parameters string. It's replaced real training path when submitting job.
e.g.: starchart train ... -- --model_dir=TRAIN_PATH/model --train_dir=TRAIN_PATH/train
.
You can use the following environment variables.
- GCP_PROJECT_ID
- Project ID that is instead of --project-id option.
- GCP_REGION
- Region that is instead of --region option.
- GOOGLE_APPLICATION_CREDENTIALS
- A file path defining the GCP credentials.
After you expose model by starchart, you get a model file like the following. It define model and version information.
MODEL_NAME.json
{
"model": "MODEL_NAME",
"versions": [
{
"version": {
"name": "projects/PROJECT_ID/models/MODEL_NAME/versions/v20170111170842",
"deploymentUri": "gs://PROJECT_ID-ml/MODEL_NAME/20170111170842/model",
"createTime": "2017-01-11T09:12:54Z",
"job": {
"jobId": "MODEL_NAME_20170111170842",
"trainingInput": {
"packageUris": [
"gs://PROJECT_ID-ml/MODEL_NAME/20170111170842/packages/trainer-0.0.0.tar.gz"
],
"pythonModule": "trainer.task",
"args": [
"--model_dir=gs://PROJECT_ID-ml/MODEL_NAME/20170111170842/model",
"--train_dir=gs://PROJECT_ID-ml/MODEL_NAME/20170111170842/train",
],
"region": "us-central1"
},
"createTime": "2017-01-11T08:08:49Z",
"startTime": "2017-01-11T08:13:55Z",
"endTime": "2017-01-11T08:40:55Z",
"state": "SUCCEEDED",
"trainingOutput": {
"consumedMLUnits": 0.45
}
},
"isDefault": true
}
}
]
}
You can choose default version in this file (isDefault
).
- Add test option which test API input and output.
$ pip install git+https://github.com/monochromegane/starchart.git
Bug reports and pull requests are welcome on GitHub at https://github.com/monochromegane/starchart.
StarChart is licensed under the MIT.