Browse Source

partial unsupervision

new-sep-loss
Michael Pilosov 10 months ago
parent
commit
697030b7df
  1. 3
      model.py
  2. 2
      newsearch.py

3
model.py

@ -68,11 +68,12 @@ class ColorTransformerModel(L.LightningModule):
loss = (1 - alpha) * p_loss + alpha * distance
# p_loss is unsupervised (preserve relative distances - either in-batch or to-target)
# distance is supervised.
self.log("hp_metric", loss)
self.log("hp_metric", distance)
# Log all losses individually
self.log("train_pres", p_loss)
self.log("train_mse", distance)
self.log("train_loss", loss)
return loss
def validation_step(self, batch):

2
newsearch.py

@ -27,7 +27,7 @@ learning_rate_values = [1e-3]
# learning_rate_values = [5e-4]
# alpha_values = [0, .25, 0.5, 0.75, 1] # alpha = 0 is unsupervised. alpha = 1 is supervised.
alpha_values = [1.0]
alpha_values = [0.99]
# widths = [2**k for k in range(4, 13)]
# depths = [1, 2, 4, 8, 16]
widths, depths = [512], [1, 2, 4]

Loading…
Cancel
Save