Skip to content

Commit c2c85ac

Browse files
Update ames-wo-val-hyperparam-optimization-local.py
Add deletion of artifacts.
1 parent 1f1833b commit c2c85ac

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

ames-wo-val-hyperparam-optimization-local.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
Hyperparameter optimization script for the updated Ames script
44
55
"""
6+
from shutil import rmtree
7+
from ast import literal_eval
8+
from copy import copy
9+
from gc import collect
10+
611

712
import numpy as np
813
import optuna
914
import pendulum
1015
import pandas as pd
1116
import tensorflow as tf
1217

13-
from ast import literal_eval
14-
15-
from copy import copy
16-
from gc import collect
1718

1819
# Define constants
1920
LABEL_COLUMN = 'price'
@@ -118,8 +119,12 @@ def objective(trial):
118119

119120
result = cerebros.run_random_search()
120121

121-
# Make a copy of the result so it isn't lost in garbage collection.
122+
# Delete artifacts so we don't deplete disk space:
122123

124+
rmtree(project_name)
125+
126+
# Make a copy of the result so it isn't lost in garbage collection.
127+
123128
result_0 = copy(result)
124129

125130
# Garbage collection to create a clen state for

0 commit comments

Comments
 (0)