should be good now
All checks were successful
s444018-evaluation/pipeline/head This commit looks good
s444018-training/pipeline/head This commit looks good

This commit is contained in:
Szymon Parafiński 2022-05-16 02:50:13 +02:00
parent 5a7e92fd4d
commit 9e54b71df2
3 changed files with 8 additions and 6 deletions

View File

@ -14,6 +14,8 @@ RUN pip3 install torch
RUN pip3 install sacred RUN pip3 install sacred
RUN pip3 install pymongo RUN pip3 install pymongo
RUN pip3 install mlflow RUN pip3 install mlflow
RUN pip3 install GitPython
ARG CUTOFF ARG CUTOFF
ARG KAGGLE_USERNAME ARG KAGGLE_USERNAME

View File

@ -21,7 +21,7 @@ pipeline {
} }
stage('Train model with sacred') { stage('Train model with sacred') {
steps { steps {
sh 'python3 ./biblioteka_DL/dllib.py "epochs=$EPOCHS"' sh 'python3 ./biblioteka_DL/dllib.py "$EPOCHS"'
archiveArtifacts artifacts: 'model.pkl, result.csv', followSymlinks: false archiveArtifacts artifacts: 'model.pkl, result.csv', followSymlinks: false
archiveArtifacts artifacts: 'mlruns/**' archiveArtifacts artifacts: 'mlruns/**'
archiveArtifacts artifacts: 'my_model/**' archiveArtifacts artifacts: 'my_model/**'

View File

@ -102,10 +102,10 @@ def my_main(epochs):
X_train = X_train.to_numpy() X_train = X_train.to_numpy()
y_train = pd.DataFrame(data_train["Gross"], dtype=np.float64) y_train = pd.DataFrame(data_train["Gross"], dtype=np.float64)
y_train = y_train.to_numpy() y_train = y_train.to_numpy()
X_train = X_train.reshape(-1, 1) X_train_data = X_train.reshape(-1, 1)
y_train = y_train.reshape(-1, 1) y_train_data = y_train.reshape(-1, 1)
X_train = torch.from_numpy(X_train.astype(np.float32)).view(-1, 1) X_train = torch.from_numpy(X_train_data.astype(np.float32)).view(-1, 1)
y_train = torch.from_numpy(y_train.astype(np.float32)).view(-1, 1) y_train = torch.from_numpy(y_train_data.astype(np.float32)).view(-1, 1)
input_size = 1 input_size = 1
output_size = 1 output_size = 1
model = nn.Linear(input_size, output_size) model = nn.Linear(input_size, output_size)
@ -149,7 +149,7 @@ def my_main(epochs):
torch.save(model, "model.pkl") torch.save(model, "model.pkl")
input_example = gross_test_g input_example = gross_test_g
siganture = infer_signature(gross_test_g, X_train) siganture = infer_signature(X_train_data, y_train_data)
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
# print(tracking_url_type_store) # print(tracking_url_type_store)