MCPcopy Create free account
hub / github.com/MarcCoru/locationencoder / __init__

Method __init__

locationencoder/imageencoder.py:8–22  ·  view source on GitHub ↗
(self, num_classes, lr=0.0045, momentum=0.9, weight_decay=1e-4)

Source from the content-addressed store, hash-verified

6
7class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected