VAE Debugged and Running

This commit is contained in:
Si11ium
2020-03-25 09:39:59 +01:00
parent defa232bf2
commit 934dadb558
5 changed files with 171 additions and 193 deletions
+4 -5
View File
@@ -6,8 +6,6 @@ from torch import nn
from torch import functional as F
from torch.utils.data import DataLoader
from lib.objects.map import MapStorage
import pytorch_lightning as pl
@@ -27,10 +25,11 @@ class Flatten(nn.Module):
print(e)
return -1
def __init__(self, in_shape, to=(-1, )):
def __init__(self, in_shape, to=-1):
assert isinstance(to, int) or isinstance(to, tuple)
super(Flatten, self).__init__()
self.in_shape = in_shape
self.to = to
self.to = (to,) if isinstance(to, int) else to
def forward(self, x):
return x.view(x.size(0), *self.to)
@@ -107,7 +106,7 @@ class LightningBaseModule(pl.LightningModule, ABC):
# Data loading
# =============================================================================
# Map Object
self.map_storage = MapStorage(self.hparams.data_param.map_root)
# self.map_storage = MapStorage(self.hparams.data_param.map_root)
def size(self):
return self.shape