ssl
BYOL(config, checkpoint_path=None, run_test=False, **kwargs)
¶
Bases: SSL
BYOL model as a pytorch_lightning.LightningModule.
Parameters:
-
config(DictConfig) –the main config
-
checkpoint_path(str | None, default:None) –if a checkpoint is specified, then it will return a trained model, with weights loaded from the checkpoint path specified. Defaults to None.
-
run_test(bool, default:False) –Whether to run final test
-
**kwargs(Any, default:{}) –Keyword arguments
Source code in quadra/tasks/ssl.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
learnable_parameters()
¶
Get the learnable parameters.
Source code in quadra/tasks/ssl.py
316 317 318 319 320 321 322 | |
prepare()
¶
Prepare the experiment.
Source code in quadra/tasks/ssl.py
324 325 326 327 328 329 330 331 332 333 334 | |
Barlow(config, checkpoint_path=None, run_test=False)
¶
Bases: SimCLR
Barlow model as a pytorch_lightning.LightningModule.
Parameters:
-
config(DictConfig) –the main config
-
checkpoint_path(str | None, default:None) –if a checkpoint is specified, then it will return a trained model, with weights loaded from the checkpoint path specified. Defaults to None.
-
run_test(bool, default:False) –Whether to run final test
Source code in quadra/tasks/ssl.py
259 260 261 262 263 264 265 | |
prepare()
¶
Prepare the experiment.
Source code in quadra/tasks/ssl.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
DINO(config, checkpoint_path=None, run_test=False)
¶
Bases: SSL
DINO model as a pytorch_lightning.LightningModule.
Parameters:
-
config(DictConfig) –the main config
-
checkpoint_path(str | None, default:None) –if a checkpoint is specified, then it will return a trained model, with weights loaded from the checkpoint path specified. Defaults to None.
-
run_test(bool, default:False) –Whether to run final test
Source code in quadra/tasks/ssl.py
379 380 381 382 383 384 385 386 387 388 389 | |
learnable_parameters()
¶
Get the learnable parameters.
Source code in quadra/tasks/ssl.py
391 392 393 394 395 | |
prepare()
¶
Prepare the experiment.
Source code in quadra/tasks/ssl.py
397 398 399 400 401 402 403 404 405 406 | |
EmbeddingVisualization(config, model_path, report_folder='embeddings', embedding_image_size=None)
¶
Bases: Task
Visualization task for learned embeddings.
Parameters:
-
config(DictConfig) –The loaded experiment config
-
model_path(str) –The path to a deployment model
-
report_folder(str, default:'embeddings') –Where to save the embeddings
-
embedding_image_size(int | None, default:None) –If not None rescale the images associated with the embeddings, tensorboard will save on disk a large sprite containing all the images in a matrix fashion, if the dimension of this sprite is too big it's not possible to load it in the browser. Rescaling the output image from the model input size to something smaller can solve this issue. The field is an int to always rescale to a squared image.
Source code in quadra/tasks/ssl.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | |
deployment_model
property
writable
¶
Get the deployment model.
prepare()
¶
Prepare the evaluation.
Source code in quadra/tasks/ssl.py
506 507 508 509 | |
test()
¶
Run embeddings extraction.
Source code in quadra/tasks/ssl.py
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | |
SSL(config, run_test=False, report=False, checkpoint_path=None)
¶
Bases: LightningTask
SSL Task.
Parameters:
-
config(DictConfig) –The experiment configuration
-
checkpoint_path(str | None, default:None) –The path to the checkpoint to load the model from Defaults to None
-
report(bool, default:False) –Whether to create the report
-
run_test(bool, default:False) –Whether to run final test
Source code in quadra/tasks/ssl.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
optimizer
property
writable
¶
Get the optimizer.
scheduler
property
writable
¶
Get the scheduler.
export()
¶
Deploy a model ready for production.
Source code in quadra/tasks/ssl.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
learnable_parameters()
¶
Get the learnable parameters.
Source code in quadra/tasks/ssl.py
54 55 56 | |
test()
¶
Test the model.
Source code in quadra/tasks/ssl.py
89 90 91 92 93 94 | |
SimCLR(config, checkpoint_path=None, run_test=False)
¶
Bases: SSL
SimCLR model as a pytorch_lightning.LightningModule.
Parameters:
-
config(DictConfig) –the main config
-
checkpoint_path(str | None, default:None) –if a checkpoint is specified, then it will return a trained model, with weights loaded from the checkpoint path specified. Defaults to None.
-
run_test(bool, default:False) –Whether to run final test
Source code in quadra/tasks/ssl.py
198 199 200 201 202 203 204 205 206 | |
learnable_parameters()
¶
Get the learnable parameters.
Source code in quadra/tasks/ssl.py
208 209 210 | |
prepare()
¶
Prepare the experiment.
Source code in quadra/tasks/ssl.py
212 213 214 215 216 217 218 219 | |
Simsiam(config, checkpoint_path=None, run_test=False)
¶
Bases: SSL
Simsiam model as a pytorch_lightning.LightningModule.
Parameters:
-
config(DictConfig) –the main config
-
checkpoint_path(str | None, default:None) –if a checkpoint is specified, then it will return a trained model, with weights loaded from the checkpoint path specified. Defaults to None.
-
run_test(bool, default:False) –Whether to run final test
Source code in quadra/tasks/ssl.py
129 130 131 132 133 134 135 136 137 138 | |
module
property
writable
¶
Get the module of the model.
learnable_parameters()
¶
Get the learnable parameters.
Source code in quadra/tasks/ssl.py
140 141 142 143 144 145 146 | |
prepare()
¶
Prepare the experiment.
Source code in quadra/tasks/ssl.py
148 149 150 151 152 153 154 155 156 | |