[BUGFIX] examples/glvq_iris.py works again

This commit is contained in:
Jensun Ravichandran
2021-06-14 20:13:25 +02:00
parent 97ec15b76a
commit 68034d56f6
2 changed files with 3 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ class GLVQ(SupervisedPrototypeModel):
def shared_step(self, batch, batch_idx, optimizer_idx=None):
x, y = batch
out = self.compute_distances(x)
plabels = self.proto_layer.component_labels
plabels = self.proto_layer.labels
mu = self.loss(out, y, prototype_labels=plabels)
batch_loss = self.transfer_layer(mu, beta=self.hparams.transfer_beta)
loss = batch_loss.sum(dim=0)