diff --git a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/MLmodel b/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/MLmodel deleted file mode 100644 index 485433f..0000000 --- a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 2382b7a39c064e7b9b1465cfd84140a3 -run_id: 24469fc083d6470a9cad7f17a6eeeea0 -utc_time_created: '2023-02-21 05:57:41.973454' diff --git a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/conda.yaml b/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/data/model.pth b/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/data/model.pth deleted file mode 100644 index 6fd0894..0000000 Binary files a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/data/pickle_module_info.txt b/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/python_env.yaml b/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/requirements.txt b/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/0/24469fc083d6470a9cad7f17a6eeeea0/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/MLmodel b/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/MLmodel deleted file mode 100644 index d6e755a..0000000 --- a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: cls_model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: e40643f3e1b9481896e1ae6ed30e8654 -run_id: 2820b379bfc945358bfd516e5577846c -utc_time_created: '2023-02-21 05:33:10.779919' diff --git a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/conda.yaml b/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/conda.yaml deleted file mode 100644 index 5b6a717..0000000 --- a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/conda.yaml +++ /dev/null @@ -1,10 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 -name: mlflow-env diff --git a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/data/model.pth b/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/data/model.pth deleted file mode 100644 index ba660cc..0000000 Binary files a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/data/model.pth and /dev/null differ diff --git a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/data/pickle_module_info.txt b/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/python_env.yaml b/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/requirements.txt b/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/requirements.txt deleted file mode 100644 index 4bb0870..0000000 --- a/artifacts/0/2820b379bfc945358bfd516e5577846c/artifacts/cls_model/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 \ No newline at end of file diff --git a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/MLmodel b/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/MLmodel deleted file mode 100644 index 31f8a1d..0000000 --- a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: models -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: faf1bec9ecb64581b22a0b8e09a9cca8 -run_id: 3ef01a1e3e3d4ba2be705da789bbb8e1 -utc_time_created: '2023-02-21 05:07:17.344052' diff --git a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/conda.yaml b/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/conda.yaml deleted file mode 100644 index 5b6a717..0000000 --- a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/conda.yaml +++ /dev/null @@ -1,10 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 -name: mlflow-env diff --git a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/data/model.pth b/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/data/model.pth deleted file mode 100644 index ca60ca2..0000000 Binary files a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/data/model.pth and /dev/null differ diff --git a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/data/pickle_module_info.txt b/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/python_env.yaml b/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/requirements.txt b/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/requirements.txt deleted file mode 100644 index 4bb0870..0000000 --- a/artifacts/0/3ef01a1e3e3d4ba2be705da789bbb8e1/artifacts/models/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 \ No newline at end of file diff --git a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/code/train.py b/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/code/train.py deleted file mode 100644 index bab8b6b..0000000 --- a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/code/train.py +++ /dev/null @@ -1,82 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - - # start the MLflow run - with mlflow.start_run(): - - # train the model and log the loss - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/MLmodel b/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/MLmodel deleted file mode 100644 index 59094e8..0000000 --- a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 18b69aa38c064c579c9b465d7a826081 -run_id: 410d85525e5f4cfe9839a432d35f9ad2 -utc_time_created: '2023-02-22 00:42:48.668457' diff --git a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/conda.yaml b/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/data/model.pth b/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/data/model.pth deleted file mode 100644 index 40c18c5..0000000 Binary files a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/data/pickle_module_info.txt b/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/python_env.yaml b/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/requirements.txt b/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/0/410d85525e5f4cfe9839a432d35f9ad2/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/MLmodel b/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/MLmodel deleted file mode 100644 index 906ebf2..0000000 --- a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: cls_model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: a0ecc970cadb47a9b839283e9514732d -run_id: 63c7363339e042f4848d9041ba8deb82 -utc_time_created: '2023-02-21 05:37:55.904472' diff --git a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/conda.yaml b/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/conda.yaml deleted file mode 100644 index 5b6a717..0000000 --- a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/conda.yaml +++ /dev/null @@ -1,10 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 -name: mlflow-env diff --git a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/data/model.pth b/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/data/model.pth deleted file mode 100644 index f9d21af..0000000 Binary files a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/data/model.pth and /dev/null differ diff --git a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/data/pickle_module_info.txt b/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/python_env.yaml b/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/requirements.txt b/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/requirements.txt deleted file mode 100644 index 4bb0870..0000000 --- a/artifacts/0/63c7363339e042f4848d9041ba8deb82/artifacts/cls_model/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 \ No newline at end of file diff --git a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/MLmodel b/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/MLmodel deleted file mode 100644 index 136582e..0000000 --- a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: models -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 4ebe94bd0249452a90b3497d3b00a1c3 -run_id: 6845ef0d54024cb3bdb32050f6a46fea -utc_time_created: '2023-02-21 05:25:14.020335' diff --git a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/conda.yaml b/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/conda.yaml deleted file mode 100644 index 5b6a717..0000000 --- a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/conda.yaml +++ /dev/null @@ -1,10 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 -name: mlflow-env diff --git a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/data/model.pth b/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/data/model.pth deleted file mode 100644 index 2973f37..0000000 Binary files a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/data/model.pth and /dev/null differ diff --git a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/data/pickle_module_info.txt b/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/python_env.yaml b/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/requirements.txt b/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/requirements.txt deleted file mode 100644 index 4bb0870..0000000 --- a/artifacts/0/6845ef0d54024cb3bdb32050f6a46fea/artifacts/models/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 \ No newline at end of file diff --git a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/MLmodel b/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/MLmodel deleted file mode 100644 index 6c70342..0000000 --- a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: models -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 8cd1e70114e548ea8d9bfb1bf468e285 -run_id: 68e8a3cbbafa46538ebb8a60d80f185d -utc_time_created: '2023-02-21 05:05:46.624814' diff --git a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/conda.yaml b/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/conda.yaml deleted file mode 100644 index 5b6a717..0000000 --- a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/conda.yaml +++ /dev/null @@ -1,10 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 -name: mlflow-env diff --git a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/data/model.pth b/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/data/model.pth deleted file mode 100644 index 9980703..0000000 Binary files a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/data/model.pth and /dev/null differ diff --git a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/data/pickle_module_info.txt b/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/python_env.yaml b/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/requirements.txt b/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/requirements.txt deleted file mode 100644 index 4bb0870..0000000 --- a/artifacts/0/68e8a3cbbafa46538ebb8a60d80f185d/artifacts/models/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 \ No newline at end of file diff --git a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/MLmodel b/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/MLmodel deleted file mode 100644 index 2870be5..0000000 --- a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: models -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: dd1b1e3a6b5f4274a5690a8843751ff3 -run_id: 8ba27f225a7442be8816977c2077c510 -utc_time_created: '2023-02-21 05:05:04.660670' diff --git a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/conda.yaml b/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/conda.yaml deleted file mode 100644 index 5b6a717..0000000 --- a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/conda.yaml +++ /dev/null @@ -1,10 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 -name: mlflow-env diff --git a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/data/model.pth b/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/data/model.pth deleted file mode 100644 index c77aaa4..0000000 Binary files a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/data/model.pth and /dev/null differ diff --git a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/data/pickle_module_info.txt b/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/python_env.yaml b/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/requirements.txt b/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/requirements.txt deleted file mode 100644 index 4bb0870..0000000 --- a/artifacts/0/8ba27f225a7442be8816977c2077c510/artifacts/models/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 \ No newline at end of file diff --git a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/MLmodel b/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/MLmodel deleted file mode 100644 index 9224ce7..0000000 --- a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 957e2f6e4fd048c99aee3150c73c4078 -run_id: c4fd84a025e1474d87cdc2919874b88c -utc_time_created: '2023-02-22 00:41:33.282088' diff --git a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/conda.yaml b/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/data/model.pth b/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/data/model.pth deleted file mode 100644 index 4356bc1..0000000 Binary files a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/data/pickle_module_info.txt b/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/python_env.yaml b/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/requirements.txt b/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/train.py b/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/train.py deleted file mode 100644 index 9cfa859..0000000 --- a/artifacts/0/c4fd84a025e1474d87cdc2919874b88c/artifacts/train.py +++ /dev/null @@ -1,82 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - - # start the MLflow run - with mlflow.start_run(): - - # train the model and log the loss - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/MLmodel b/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/MLmodel deleted file mode 100644 index 8f35ba0..0000000 --- a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: cls_model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: aaa800b217da4dd0b8f17e8dbfdc5c45 -run_id: f1320882f24c4f489cbf85159627eaf8 -utc_time_created: '2023-02-21 05:34:08.242864' diff --git a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/conda.yaml b/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/conda.yaml deleted file mode 100644 index 5b6a717..0000000 --- a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/conda.yaml +++ /dev/null @@ -1,10 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 -name: mlflow-env diff --git a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/data/model.pth b/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/data/model.pth deleted file mode 100644 index b93925f..0000000 Binary files a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/data/model.pth and /dev/null differ diff --git a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/data/pickle_module_info.txt b/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/python_env.yaml b/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/requirements.txt b/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/requirements.txt deleted file mode 100644 index 4bb0870..0000000 --- a/artifacts/0/f1320882f24c4f489cbf85159627eaf8/artifacts/cls_model/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 \ No newline at end of file diff --git a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/code/train.py b/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/code/train.py deleted file mode 100644 index cbc05f2..0000000 --- a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/code/train.py +++ /dev/null @@ -1,83 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('/mlflow_testing') - - # start the MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/MLmodel b/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/MLmodel deleted file mode 100644 index 0062f23..0000000 --- a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: ff8b845d6a174ffabfc49a18673c6c04 -run_id: c248a4299f97423987a9496a2241ab1a -utc_time_created: '2023-02-22 01:10:55.971443' diff --git a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/conda.yaml b/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/data/model.pth b/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/data/model.pth deleted file mode 100644 index 544e005..0000000 Binary files a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/data/pickle_module_info.txt b/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/python_env.yaml b/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/requirements.txt b/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/1/c248a4299f97423987a9496a2241ab1a/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/code/train.py b/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/code/train.py deleted file mode 100644 index d13857d..0000000 --- a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/code/train.py +++ /dev/null @@ -1,83 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('mlflow_testing') - - # start the MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/MLmodel b/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/MLmodel deleted file mode 100644 index 7bff427..0000000 --- a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 27a96ad04f5a4578a3e1302500ad9a11 -run_id: b7d7395b6b53404497f7656b07b71bf8 -utc_time_created: '2023-02-22 01:11:36.809812' diff --git a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/conda.yaml b/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/data/model.pth b/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/data/model.pth deleted file mode 100644 index ce4d1ff..0000000 Binary files a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/data/pickle_module_info.txt b/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/python_env.yaml b/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/requirements.txt b/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/2/b7d7395b6b53404497f7656b07b71bf8/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/code/train.py b/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/code/train.py deleted file mode 100644 index d13857d..0000000 --- a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/code/train.py +++ /dev/null @@ -1,83 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('mlflow_testing') - - # start the MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/MLmodel b/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/MLmodel deleted file mode 100644 index 1843ee7..0000000 --- a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 2625ea164ff248c194686ed5afb9a510 -run_id: c293e8294f4f46adacd21465be08c608 -utc_time_created: '2023-02-22 01:11:28.646127' diff --git a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/conda.yaml b/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/data/model.pth b/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/data/model.pth deleted file mode 100644 index 3d8e55d..0000000 Binary files a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/data/pickle_module_info.txt b/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/python_env.yaml b/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/requirements.txt b/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/2/c293e8294f4f46adacd21465be08c608/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/code/train.py b/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/code/train.py deleted file mode 100644 index d13857d..0000000 --- a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/code/train.py +++ /dev/null @@ -1,83 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('mlflow_testing') - - # start the MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/MLmodel b/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/MLmodel deleted file mode 100644 index e841ea5..0000000 --- a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 2ee49fdb3ec647a58b1235498b186722 -run_id: d548729629634031a93a46d6dab8b7da -utc_time_created: '2023-02-22 01:11:33.149151' diff --git a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/conda.yaml b/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/data/model.pth b/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/data/model.pth deleted file mode 100644 index e265aa4..0000000 Binary files a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/data/pickle_module_info.txt b/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/python_env.yaml b/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/requirements.txt b/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/2/d548729629634031a93a46d6dab8b7da/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/code/train.py b/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/code/train.py deleted file mode 100644 index fb07727..0000000 --- a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/code/train.py +++ /dev/null @@ -1,83 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start the MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/MLmodel b/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/MLmodel deleted file mode 100644 index a203d98..0000000 --- a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 75aa23c5bb33452c978feeeffcdcb393 -run_id: 0be79b1f3f7d480a9c7f497312887a37 -utc_time_created: '2023-02-22 01:12:26.682417' diff --git a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/conda.yaml b/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/data/model.pth b/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/data/model.pth deleted file mode 100644 index f632efe..0000000 Binary files a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/data/pickle_module_info.txt b/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/python_env.yaml b/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/requirements.txt b/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/0be79b1f3f7d480a9c7f497312887a37/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/code/train.py b/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/code/train.py deleted file mode 100644 index b7f91d2..0000000 --- a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/code/train.py +++ /dev/null @@ -1,98 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for batch, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=epoch) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - batch_size = 10 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=batch_size) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - mlflow.log_param('batch_size', batch_size) - - # create a signature to record model input and output info - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/MLmodel b/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/MLmodel deleted file mode 100644 index dcbbfa2..0000000 --- a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 1e929c95d90347419e3e0a49d5d783fd -run_id: 128f833fc0a2426db86e5073db557a3e -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-23 01:38:39.421914' diff --git a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/conda.yaml b/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/data/model.pth b/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/data/model.pth deleted file mode 100644 index f72fedd..0000000 Binary files a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/data/pickle_module_info.txt b/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/python_env.yaml b/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/requirements.txt b/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/128f833fc0a2426db86e5073db557a3e/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/code/train.py b/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/code/train.py deleted file mode 100644 index fb07727..0000000 --- a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/code/train.py +++ /dev/null @@ -1,83 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start the MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/MLmodel b/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/MLmodel deleted file mode 100644 index ebb3022..0000000 --- a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 20196b21b65b400eac57135de7cb2bac -run_id: 2af28d45b569431ab10056469d63cf44 -utc_time_created: '2023-02-22 01:12:30.183766' diff --git a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/conda.yaml b/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/data/model.pth b/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/data/model.pth deleted file mode 100644 index 3b653c0..0000000 Binary files a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/data/pickle_module_info.txt b/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/python_env.yaml b/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/requirements.txt b/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/2af28d45b569431ab10056469d63cf44/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/code/train.py b/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/code/train.py deleted file mode 100644 index 1538383..0000000 --- a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/code/train.py +++ /dev/null @@ -1,98 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=epoch) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - batch_size = 10 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=batch_size) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - mlflow.log_param('batch_size', batch_size) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/MLmodel b/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/MLmodel deleted file mode 100644 index 6b7d705..0000000 --- a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 4dc69e8ee0404f70b0c17f8119986704 -run_id: 581cf34366f74ee7b90b18f0a606ddf8 -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:46:27.876394' diff --git a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/conda.yaml b/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/data/model.pth b/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/data/model.pth deleted file mode 100644 index 17390b5..0000000 Binary files a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/data/pickle_module_info.txt b/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/python_env.yaml b/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/requirements.txt b/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/581cf34366f74ee7b90b18f0a606ddf8/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/code/train.py b/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/code/train.py deleted file mode 100644 index 1538383..0000000 --- a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/code/train.py +++ /dev/null @@ -1,98 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=epoch) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - batch_size = 10 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=batch_size) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - mlflow.log_param('batch_size', batch_size) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/MLmodel b/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/MLmodel deleted file mode 100644 index 88edd89..0000000 --- a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 1334c03425a6454fafce1db8fa3a2428 -run_id: 5c8b249efc724568aca1b8a4d8750b43 -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:46:24.939018' diff --git a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/conda.yaml b/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/data/model.pth b/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/data/model.pth deleted file mode 100644 index 6d3534f..0000000 Binary files a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/data/pickle_module_info.txt b/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/python_env.yaml b/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/requirements.txt b/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/5c8b249efc724568aca1b8a4d8750b43/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/code/train.py b/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/code/train.py deleted file mode 100644 index 5e1ed6e..0000000 --- a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/code/train.py +++ /dev/null @@ -1,96 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=epoch) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/MLmodel b/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/MLmodel deleted file mode 100644 index 620ce39..0000000 --- a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 3f51fe9a1b40461d8c445f37695d72e2 -run_id: 7f0b13a30b10483589f7ca922050e721 -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:43:39.269378' diff --git a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/conda.yaml b/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/data/model.pth b/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/data/model.pth deleted file mode 100644 index 83522b1..0000000 Binary files a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/data/pickle_module_info.txt b/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/python_env.yaml b/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/requirements.txt b/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/7f0b13a30b10483589f7ca922050e721/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/code/train.py b/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/code/train.py deleted file mode 100644 index fb07727..0000000 --- a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/code/train.py +++ /dev/null @@ -1,83 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -from tqdm import tqdm -import mlflow - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(10, 5) - self.fc2 = nn.Linear(5, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(10), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start the MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # log trained model - mlflow.pytorch.log_model(model, 'model') - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/MLmodel b/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/MLmodel deleted file mode 100644 index 3a8d130..0000000 --- a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/MLmodel +++ /dev/null @@ -1,16 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: a94b93c2d2674c97a5db43fda608ec76 -run_id: 80447ac20c814d10a470208e303ea0ec -utc_time_created: '2023-02-22 01:12:22.906728' diff --git a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/conda.yaml b/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/data/model.pth b/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/data/model.pth deleted file mode 100644 index 640ed55..0000000 Binary files a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/data/pickle_module_info.txt b/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/python_env.yaml b/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/requirements.txt b/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/80447ac20c814d10a470208e303ea0ec/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/code/train.py b/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/code/train.py deleted file mode 100644 index 1db27ba..0000000 --- a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/code/train.py +++ /dev/null @@ -1,96 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=epoch) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-4 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/MLmodel b/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/MLmodel deleted file mode 100644 index e013104..0000000 --- a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 461190610cac47f5970e3386972070da -run_id: 936ba15a1bf74591a10e1711133f4be4 -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:42:59.306161' diff --git a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/conda.yaml b/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/data/model.pth b/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/data/model.pth deleted file mode 100644 index f463021..0000000 Binary files a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/data/pickle_module_info.txt b/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/python_env.yaml b/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/requirements.txt b/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/936ba15a1bf74591a10e1711133f4be4/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/code/train.py b/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/code/train.py deleted file mode 100644 index 6848e44..0000000 --- a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/code/train.py +++ /dev/null @@ -1,96 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/MLmodel b/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/MLmodel deleted file mode 100644 index 5eaec8b..0000000 --- a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: eb6ac492a8a5426d815dce50de4d2545 -run_id: 9ea595f0043a477bb635754b7f77fa48 -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:26:27.043234' diff --git a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/conda.yaml b/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/data/model.pth b/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/data/model.pth deleted file mode 100644 index 97c3aff..0000000 Binary files a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/data/pickle_module_info.txt b/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/python_env.yaml b/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/requirements.txt b/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/9ea595f0043a477bb635754b7f77fa48/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/code/train.py b/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/code/train.py deleted file mode 100644 index 6848e44..0000000 --- a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/code/train.py +++ /dev/null @@ -1,96 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/MLmodel b/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/MLmodel deleted file mode 100644 index 85b1864..0000000 --- a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: d240fe9348c24d1f871506e8d1155f56 -run_id: ab28ca803756454881d83e7e85945df0 -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:26:30.657849' diff --git a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/conda.yaml b/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/data/model.pth b/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/data/model.pth deleted file mode 100644 index 017488d..0000000 Binary files a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/data/pickle_module_info.txt b/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/python_env.yaml b/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/requirements.txt b/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/ab28ca803756454881d83e7e85945df0/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/code/train.py b/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/code/train.py deleted file mode 100644 index 23336bc..0000000 --- a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/code/train.py +++ /dev/null @@ -1,96 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=epoch) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-3 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/MLmodel b/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/MLmodel deleted file mode 100644 index 0086e38..0000000 --- a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 2d856775bf3840668e99c8a230c6c663 -run_id: ac13f624d0114ca494441db540b6629c -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:43:17.551796' diff --git a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/conda.yaml b/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/data/model.pth b/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/data/model.pth deleted file mode 100644 index 601cc68..0000000 Binary files a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/data/pickle_module_info.txt b/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/python_env.yaml b/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/requirements.txt b/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/ac13f624d0114ca494441db540b6629c/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/code/train.py b/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/code/train.py deleted file mode 100644 index 1538383..0000000 --- a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/code/train.py +++ /dev/null @@ -1,98 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=epoch) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - batch_size = 10 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=batch_size) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - mlflow.log_param('batch_size', batch_size) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/MLmodel b/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/MLmodel deleted file mode 100644 index e71b91f..0000000 --- a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 1b7647843b35448d915254eda4751ed8 -run_id: b2961f1b13a84398b7d7ee5be03ab0da -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:46:21.578911' diff --git a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/conda.yaml b/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/data/model.pth b/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/data/model.pth deleted file mode 100644 index 688a91d..0000000 Binary files a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/data/pickle_module_info.txt b/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/python_env.yaml b/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/requirements.txt b/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/b2961f1b13a84398b7d7ee5be03ab0da/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/code/train.py b/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/code/train.py deleted file mode 100644 index 5e1ed6e..0000000 --- a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/code/train.py +++ /dev/null @@ -1,96 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=epoch) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/MLmodel b/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/MLmodel deleted file mode 100644 index 6b5411d..0000000 --- a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 74c6ba14fd8043cda903f9b6dfb93bae -run_id: c362618cffca44f69a4afabcd45defd7 -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:42:16.398211' diff --git a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/conda.yaml b/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/data/model.pth b/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/data/model.pth deleted file mode 100644 index dec4b44..0000000 Binary files a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/data/pickle_module_info.txt b/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/python_env.yaml b/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/requirements.txt b/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/c362618cffca44f69a4afabcd45defd7/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/code/train.py b/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/code/train.py deleted file mode 100644 index 6848e44..0000000 --- a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/code/train.py +++ /dev/null @@ -1,96 +0,0 @@ -# train.py -# -# author: deng -# date : 20230221 - -import torch -import torch.nn as nn -from torch.optim import SGD -import mlflow -from mlflow.models.signature import ModelSignature -from mlflow.types.schema import Schema, ColSpec -from tqdm import tqdm - - -class Net(nn.Module): - """ define a simple neural network model """ - def __init__(self): - super(Net, self).__init__() - self.fc1 = nn.Linear(5, 3) - self.fc2 = nn.Linear(3, 1) - - def forward(self, x): - x = self.fc1(x) - x = torch.relu(x) - x = self.fc2(x) - return x - - -def train(model, dataloader, criterion, optimizer, epochs): - """ define the training function """ - for epoch in tqdm(range(epochs), 'Epochs'): - - for i, (inputs, labels) in enumerate(dataloader): - - # forwarding - outputs = model(inputs) - loss = criterion(outputs, labels) - - # update gradient - optimizer.zero_grad() - loss.backward() - optimizer.step() - - # log loss - mlflow.log_metric('train_loss', loss.item(), step=i) - - return loss - - -if __name__ == '__main__': - - # set hyper parameters - learning_rate = 1e-2 - epochs = 20 - - # create a dataloader with fake data - dataloader = [(torch.randn(5), torch.randn(1)) for _ in range(100)] - dataloader = torch.utils.data.DataLoader(dataloader, batch_size=10) - - # create the model, criterion, and optimizer - model = Net() - criterion = nn.MSELoss() - optimizer = SGD(model.parameters(), lr=learning_rate) - - # set the tracking URI to the model registry - mlflow.set_tracking_uri('http://127.0.0.1:5000') - mlflow.set_experiment('train_fortune_predict_model') - - # start a new MLflow run - with mlflow.start_run(): - - # train the model - loss = train(model, dataloader, criterion, optimizer, epochs) - - # log some additional metrics - mlflow.log_metric('final_loss', loss.item()) - mlflow.log_param('learning_rate', learning_rate) - - # create a signature to record model input and output - input_schema = Schema([ - ColSpec('float', 'age'), - ColSpec('float', 'mood level'), - ColSpec('float', 'health level'), - ColSpec('float', 'hungry level'), - ColSpec('float', 'sexy level') - ]) - output_schema = Schema([ColSpec('float', 'fortune')]) - signature = ModelSignature(inputs=input_schema, outputs=output_schema) - - # log trained model - mlflow.pytorch.log_model(model, 'model', signature=signature) - - # log training code - mlflow.log_artifact('./train.py', 'code') - - print('Completed.') \ No newline at end of file diff --git a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/MLmodel b/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/MLmodel deleted file mode 100644 index f81e874..0000000 --- a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/MLmodel +++ /dev/null @@ -1,21 +0,0 @@ -artifact_path: model -flavors: - python_function: - data: data - env: conda.yaml - loader_module: mlflow.pytorch - pickle_module_name: mlflow.pytorch.pickle_module - python_version: 3.10.9 - pytorch: - code: null - model_data: data - pytorch_version: 1.13.1 -mlflow_version: 1.30.0 -model_uuid: 25e2ad2c703b4e79b56de97a6a6902d8 -run_id: e8b7a070f5ff48c69c5b945d1fe2f392 -signature: - inputs: '[{"name": "age", "type": "float"}, {"name": "mood level", "type": "float"}, - {"name": "health level", "type": "float"}, {"name": "hungry level", "type": "float"}, - {"name": "sexy level", "type": "float"}]' - outputs: '[{"name": "fortune", "type": "float"}]' -utc_time_created: '2023-02-22 02:24:12.697856' diff --git a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/conda.yaml b/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/conda.yaml deleted file mode 100644 index 758a169..0000000 --- a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/conda.yaml +++ /dev/null @@ -1,11 +0,0 @@ -channels: -- conda-forge -dependencies: -- python=3.10.9 -- pip<=23.0.1 -- pip: - - mlflow - - cloudpickle==2.2.1 - - torch==1.13.1 - - tqdm==4.64.1 -name: mlflow-env diff --git a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/data/model.pth b/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/data/model.pth deleted file mode 100644 index dffebe7..0000000 Binary files a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/data/model.pth and /dev/null differ diff --git a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/data/pickle_module_info.txt b/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/data/pickle_module_info.txt deleted file mode 100644 index 31b9e7e..0000000 --- a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/data/pickle_module_info.txt +++ /dev/null @@ -1 +0,0 @@ -mlflow.pytorch.pickle_module \ No newline at end of file diff --git a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/python_env.yaml b/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/python_env.yaml deleted file mode 100644 index 8080c14..0000000 --- a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/python_env.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: 3.10.9 -build_dependencies: -- pip==23.0.1 -- setuptools==67.3.2 -- wheel==0.38.4 -dependencies: -- -r requirements.txt diff --git a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/requirements.txt b/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/requirements.txt deleted file mode 100644 index f5c794c..0000000 --- a/artifacts/3/e8b7a070f5ff48c69c5b945d1fe2f392/artifacts/model/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -mlflow -cloudpickle==2.2.1 -torch==1.13.1 -tqdm==4.64.1 \ No newline at end of file diff --git a/mlflow.db b/mlflow.db deleted file mode 100644 index 89104ce..0000000 Binary files a/mlflow.db and /dev/null differ diff --git a/service/backend.db b/service/backend.db new file mode 100644 index 0000000..1c803d3 Binary files /dev/null and b/service/backend.db differ diff --git a/service/registry.db b/service/registry.db new file mode 100644 index 0000000..cbed633 Binary files /dev/null and b/service/registry.db differ diff --git a/start_mlflow_server.sh b/start_mlflow_server.sh index 138101f..564b436 100755 --- a/start_mlflow_server.sh +++ b/start_mlflow_server.sh @@ -4,4 +4,4 @@ # author: deng # date : 20230221 -mlflow server --backend-store-uri sqlite:///mlflow.db --default-artifact-root ./artifacts --port 5000 \ No newline at end of file +mlflow server --backend-store-uri sqlite:///service/backend.db --registry-store-uri sqlite:///service/registry.db --default-artifact-root ./service/artifacts --host 127.0.0.1 --port 5000 --serve-artifacts \ No newline at end of file