Skip to content
Snippets Groups Projects
Commit a61cece1 authored by xiaozhou_wang's avatar xiaozhou_wang
Browse files

Changes for submission-StrategyA-max10epoch

parent 1bbe1671
No related branches found
Tags submission-new-strategy
No related merge requests found
......@@ -42,7 +42,7 @@ training_dataset = ZEWDPCBaseDataset(
unlabelled_dataset = ZEWDPCProtectedDataset(
images_dir="./data/unlabelled/images",
labels_path="./data/unlabelled/labels.csv",
purchase_budget=500, # Configurable Parameter
purchase_budget=1899, # Configurable Parameter
shuffle_seed=DATASET_SHUFFLE_SEED,
)
# Instantiate Validation Dataset
......@@ -75,8 +75,8 @@ checkpoint_folder_path = tempfile.TemporaryDirectory().name
####################################################################################
time_started = time.time()
PURCHASE_BUDGET = 500
COMPUTE_BUDGET = 900
PURCHASE_BUDGET = 1899
COMPUTE_BUDGET = 3060
# ####################################################################################
####################################################################################
......
......@@ -209,7 +209,7 @@ class ZEWDPCBaseRun:
@staticmethod
def generate_valid_epoch_comb(num_label_list):
pos_epoch = [5, 7, 10, 12, 15]
pos_epoch = [5, 7, 10]
return list(combinations_with_replacement(pos_epoch, len(num_label_list)))[::-1]
def calculate_total_time_given_epochs(self, epochs, num_labels_list):
......@@ -277,9 +277,9 @@ class ZEWDPCBaseRun:
print(f"labels: {num_labels_to_purchase}, epochs: {num_epochs_to_train}")
for e, (num_labels, num_epochs) in enumerate(zip(num_labels_to_purchase, num_epochs_to_train)):
if e == len(num_labels_to_purchase) - 1:
"""this is the last training, maximize number of epochs here!"""
#this is the last training, maximize number of epochs here!
epochs_affordable = int((remaining_time - self.safety_time - self.prediction_time) / (self.train_time_per_image * len(image_lst)))
num_epochs = min(20, max(epochs_affordable, num_epochs))
num_epochs = min(10, max(epochs_affordable, num_epochs))
print(f"last training epoch is {num_epochs} instead!")
"""start training"""
#self.model = load_model()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment