Use LambdaLayer from ProtoTorch

This commit is contained in:
Jensun Ravichandran
2021-05-31 16:53:04 +02:00
parent 8f4d66edf1
commit 27eccf44d4
2 changed files with 18 additions and 22 deletions

View File

@@ -47,17 +47,25 @@ if __name__ == "__main__":
prototype_initializer=pt.components.SMI(train_ds),
)
# Summary
print(model)
# Callbacks
vis = pt.models.VisGLVQ2D(train_ds)
proto_scheduler = PrototypeScheduler(train_ds, 10)
# Setup trainer
trainer = pl.Trainer.from_argparse_args(args,
max_epochs=100,
callbacks=[vis, proto_scheduler],
terminate_on_nan=True,
weights_summary=None,
accelerator='ddp')
trainer = pl.Trainer.from_argparse_args(
args,
max_epochs=100,
callbacks=[
vis,
proto_scheduler,
],
terminate_on_nan=True,
weights_summary=None,
accelerator="ddp",
)
# Training loop
trainer.fit(model, train_loader)