diff --git a/model.py b/model.py index 0444a62..eeeadcc 100644 --- a/model.py +++ b/model.py @@ -50,16 +50,24 @@ class ColorTransformerModel(L.LightningModule): outputs, ) # alpha = self.hparams.alpha # TODO: decide what to do with this... - loss = p_loss + # loss = p_loss + + # distance = torch.minimum( + # torch.norm(outputs - labels), torch.norm(1 + outputs - labels) + # ).mean() + distance = torch.norm(outputs - labels).mean() + loss = distance + + self.log("train_loss", distance) self.log("hp_metric", loss) self.log("p_loss", p_loss) - return loss + return distance def validation_step(self, batch): inputs, labels = batch # these are true HSV labels - no learning allowed. outputs = self.forward(inputs) distance = torch.minimum( - torch.abs(outputs - labels), torch.abs(1 + outputs - labels) + torch.norm(outputs - labels), torch.norm(1 + outputs - labels) ) mean_loss = torch.mean(distance) max_loss = torch.max(distance) diff --git a/newsearch.py b/newsearch.py index 352109e..19d62c1 100644 --- a/newsearch.py +++ b/newsearch.py @@ -6,7 +6,7 @@ import numpy as np # noqa: F401 from lightning_sdk import Machine, Studio # noqa: F401 # consistency of randomly sampled experiments. -seed(19920921) +seed(202419920921) NUM_JOBS = 100 @@ -23,7 +23,7 @@ NUM_JOBS = 100 # Define the ranges or sets of values for each hyperparameter # alpha_values = list(np.round(np.linspace(2, 4, 21), 4)) # learning_rate_values = list(np.round(np.logspace(-5, -3, 21), 5)) -learning_rate_values = [1e-2] +learning_rate_values = [1e-3] alpha_values = [0] widths = [2**k for k in range(4, 13)] depths = [1, 2, 4, 8, 16] @@ -65,8 +65,8 @@ for idx, params in enumerate(search_params): python newmain.py fit \ --seed_everything {s} \ --data.batch_size {bs} \ ---data.train_size 0 \ ---data.val_size 100000 \ +--data.train_size 10000 \ +--data.val_size 10000 \ --model.alpha {a} \ --model.width {w} \ --model.depth {d} \