(self, num_classes, lr=0.0045, momentum=0.9, weight_decay=1e-4)
| 6 | |
| 7 | class ImageEncoder(pl.LightningModule): |
| 8 | def __init__(self, num_classes, lr=0.0045, momentum=0.9, weight_decay=1e-4): |
| 9 | super().__init__() |
| 10 | |
| 11 | self.model = models.inception_v3(pretrained=True) |
| 12 | self.model.fc = nn.Linear(2048, num_classes) |
| 13 | self.model.aux_logits = False |
| 14 | |
| 15 | self.lr = lr |
| 16 | self.momentum = momentum |
| 17 | self.weight_decay = weight_decay |
| 18 | |
| 19 | self.criterion = nn.CrossEntropyLoss() |
| 20 | |
| 21 | # this enables SpatialEncoder.load_from_checkpoint(path) |
| 22 | self.save_hyperparameters() |
| 23 | |
| 24 | def common_step(self, batch, batch_idx): |
| 25 | images, _, labels, _ = batch |
nothing calls this directly
no outgoing calls
no test coverage detected