Update example scripts

This commit is contained in:
Jensun Ravichandran
2021-06-04 22:21:28 +02:00
parent 016fcb4060
commit 5d2a8226ce
7 changed files with 123 additions and 42 deletions

View File

@@ -30,7 +30,7 @@ if __name__ == "__main__":
prototypes_per_class = num_clusters * 5
hparams = dict(
distribution=(num_classes, prototypes_per_class),
lr=0.1,
lr=0.2,
)
# Initialize the model
@@ -39,6 +39,12 @@ if __name__ == "__main__":
prototype_initializer=pt.components.Ones(2, scale=3),
)
# Compute intermediate input and output sizes
model.example_input_array = torch.zeros(4, 2)
# Summary
print(model)
# Callbacks
vis = pt.models.VisGLVQ2D(train_ds)
pruning = pt.models.PruneLoserPrototypes(
@@ -67,7 +73,7 @@ if __name__ == "__main__":
],
progress_bar_refresh_rate=0,
terminate_on_nan=True,
weights_summary=None,
weights_summary="full",
accelerator="ddp",
)