Add missing abstract.py file
This commit is contained in:
parent
fef73e2fbf
commit
ccaa52c408
14
prototorch/models/abstract.py
Normal file
14
prototorch/models/abstract.py
Normal file
@ -0,0 +1,14 @@
|
||||
import pytorch_lightning as pl
|
||||
import torch
|
||||
|
||||
|
||||
class AbstractLightningModel(pl.LightningModule):
|
||||
def configure_optimizers(self):
|
||||
optimizer = torch.optim.Adam(self.parameters(), lr=self.hparams.lr)
|
||||
return optimizer
|
||||
|
||||
|
||||
class AbstractPrototypeModel(AbstractLightningModel):
|
||||
@property
|
||||
def prototypes(self):
|
||||
return self.proto_layer.components.detach().numpy()
|
Loading…
Reference in New Issue
Block a user