GitML helps you manage and move around between iterations during model building.
We provide a git like command line tool for you to take a snapshot of your current state with all necessary information and dependent files.
pip install gitml
It will also initialize a new git repository, if one doesn't exist already.
gitml init
Continue with your model building. Say you are starting with model.py
. Add gitml package to your code, like below.
# model.py
import gitml
## your code goes here ##
## Add the below lines.
with gitml.state() as state:
state.set( model=MODEL_OBJECT, params = { "PARAM_KEY_1" : "PARAM_VALUE_1" }, metrics = { "METRICS_KEY_1" : "METRICS_KEY_2" },
remarks = "REMARKS" )
Note : Now run you can run model.py as usual with python model.py
.
python model.py save
This takes a snapshot of all your files and along with other information. It will save the iteration with a unique id (Iteration Id).
# You will be seeing this line when you run `python model.py save`.
[GitML] iteration id : <ITERATION_ID>
gitml ls
This will add a permenant commit to your git. For the iteration id, try gitml ls
.
gitml commit <ITERATION_ID>
gitml commit ls
gitml reuse <COMMITED_ITERATION_ID>
Note : COMMITED_ITERATION_ID
is the iteration id from gitml commit ls
.
gitml stash
gitml restore
import gitml
## For saved iterations `gitml ls` and commited iterations `gitml commit ls`.
model = gitml.load("<ITERATION_ID>")
## Your code.
- Fork the repo.
- Make changes and install using
./tasks/clean_install.sh
.