Im trying to train the multi output model. Im loading the images in batches as follows,
def get_batch_features(self, idx):
return np.array([load_image(im) for im in self.im_list[idx * self.bsz: (1 + idx) * self.bsz]])
Following is my load_image function where im normalizing the images to range between 0 and 255 as follows
def load_image(im):
return img_to_array(load_img(im, target_size=(224, 224))) / 255.
Im loading the labels which are the target coordinates of 4 xy coordinates.
def get_batch_labels(self, idx):
return self.labels[idx * self.bsz: (idx + 1) * self.bsz,:]
How do I normalize the target coordinates by scaling it to [-1, 1]? since im not scaling it, im getting a huge validation loss as the model is overfitting. Is there by any means that i can scale the target coordinates between [-1,1]?