Skip to content

Commit 7e06969

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cbf6d45 commit 7e06969

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

torch_points3d/core/instantiator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def instantiate(self, *args, **kwargs):
3939
class HydraInstantiator(Instantiator):
4040
def litmodel(self, cfg: DictConfig, data_module: pl.LightningDataModule) -> "PointCloudBaseModel":
4141
return self.instantiate(cfg, instantiator=self, data_module=data_module)
42-
42+
4343
def backbone(self, cfg: DictConfig, feature_dimension: int):
4444
return self.instantiate(cfg, input_nc=feature_dimension)
4545

torch_points3d/models/base_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(
1818
optimizer: OptimizerConfig,
1919
instantiator: Instantiator,
2020
data_module: pl.LightningDataModule,
21-
scheduler: SchedulerConfig = None, # scheduler shouldn't be required
21+
scheduler: SchedulerConfig = None, # scheduler shouldn't be required
2222
):
2323
super().__init__()
2424
# some optimizers/schedulers need parameters only known dynamically
@@ -52,7 +52,7 @@ def set_input(self, data):
5252
self.labels = data.y
5353
else:
5454
self.labels = None
55-
55+
5656
def forward(self):
5757
features = self.backbone(self.input).x
5858
logits = self.head(features)
@@ -61,7 +61,7 @@ def forward(self):
6161
# only compute loss if loss is defined and the dset has labels
6262
if self.labels is not None and self.criterion is not None:
6363
return self.criterion(self.output, self.labels)
64-
64+
6565
def configure_optimizers(self) -> Dict:
6666
"""Prepare optimizer and scheduler"""
6767
optims = {}

torch_points3d/models/segmentation/base_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
# Overrides PointCloudBaseModel to create segmentation-specific models
66
class SegmentationBaseModel(PointCloudBaseModel):
7-
7+
88
# Most segmentation models will share the same head and criterion
99
# Note that we don't even have to create a sparseconv3d subclass of PointCloudBaseModel
1010
# because the actual training logic is contained all within this and PointCloudBaseModel
1111
# so all we need to do is define a `backend` (in this case sparseconv3d)
1212
def _build_model(self, backbone_cfg):
1313
super()._build_model(backbone_cfg)
14-
14+
1515
self.head = nn.Sequential(nn.Linear(self.backbone.output_nc, self.num_classes))
16-
self.criterion = F.nll_loss
16+
self.criterion = F.nll_loss

torch_points3d/trainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ def __init__(
3030
"The instantiator did not return a DataModule instance." " Hydra hint: is `dataset._target_` defined?`"
3131
)
3232
self.data_module.setup("fit")
33-
33+
3434
self.litmodel: PointCloudBaseModel = instantiator.litmodel(model, self.data_module)
3535
print(self.litmodel)
3636
self.trainer = instantiator.trainer(
3737
trainer,
38-
logger=None, # eventually add logger config back in
38+
logger=None, # eventually add logger config back in
3939
)
4040

4141
def train(self):

0 commit comments

Comments
 (0)