def __init__(self): self.dataset = ProcessData(train_ratio=0.8,process_raw_data=False,do_augment=False, image_type='OA', get_scale_center=False, single_sample=True, do_blur=False, do_crop=False, do_deform=False, do_flip=True) self.model = cnn_skipC_OA_model.cnn_skipC_OA_model( criterion=nn.MSELoss(), optimizer= torch.optim.Adam, learning_rate=0.001, weight_decay=0 )
def GenerateModel(dictionary, id): demand = ProcessData.ProcessData(dictionary) Prediction.GenerateModel(dictionary, demand) latestPrediction = Prediction.GetPrediction(dictionary, demand) loadDict[id] = latestPrediction with open("savedPredictions.txt", "a+") as outfile: json.dump({"id": id, "predictions": latestPrediction}, outfile) outfile.write("\n") print("latestPrediction type: ", type(latestPrediction), "\n latestPrediction: ", latestPrediction) return "Model Generation completed."