February 2018
Intermediate to advanced
262 pages
6h 59m
English
We will not be able to use the FeaturesDataset class as it is, since it was developed to pick from the output of only one model. So, the following implementation contains minor changes to the FeaturesDataset class to accommodate all the three different generated features:
class FeaturesDataset(Dataset): def __init__(self,featlst1,featlst2,featlst3,labellst): self.featlst1 = featlst1 self.featlst2 = featlst2 self.featlst3 = featlst3 self.labellst = labellst def __getitem__(self,index): return (self.featlst1[index],self.featlst2[index],self.featlst3[index],self.labellst[index]) def __len__(self): return len(self.labellst)trn_feat_dset = FeaturesDataset(trn_resnet_features,trn_inception_features.features,trn_densenet_features,trn_labels) ...
Read now
Unlock full access