Can you elaborate on this?
I am training a CNN regression from arrays of size 1x400, actually using:
md = ImageClassifierData.from_arrays(PATH, (trn,y_trn),
(val, y_val),
bs=64,
continuous=True)
learner = ConvLearner.from_model_data(net, md)
where net is:
net = nn.Sequential(
nn.Conv1d(1, 20, kernel_size=9, stride=2, padding=0),
nn.LeakyReLU(),
nn.BatchNorm1d(20),
nn.Conv1d(20, 40, kernel_size=9, stride=2, padding=0),
nn.LeakyReLU(),
nn.BatchNorm1d(40),
nn.Conv1d(40, 80, kernel_size=9, stride=2, padding=0),
nn.LeakyReLU(),
nn.BatchNorm1d(80),
nn.Conv1d(80, 160, kernel_size=9, stride=2, padding=0),
nn.LeakyReLU(),
nn.AdaptiveMaxPool1d(10),
Flatten(),
nn.Linear(10*160, 1)
).cuda()
I found that learner.summary()
does not work for single channel “images”, I think the problem comes from:
def summary(self):
x = [torch.ones(3, self.data.trn_ds.cats.shape[1]).long(), torch.rand(3, self.data.trn_ds.conts.shape[1])]
return model_summary(self.model, x)
Expects 3 channel images. I don’t know if my approach of using the image data loader is a good idea.
Any insights on how can we deal with 1d vectors, to do regression using fastai?
Sincerely,
Thomas