I have tried submitting the C3W4 assignment quite a few times but despite varying hyper-parameters I can’t seem to get an average structural similarity index much above 60%. (85% is required to pass.) Am I missing something here? I think that the design choices I have made are suitable and can’t see any obvious bugs. (I have used cv2 to change channel order.)
I have not shuffled the data, only batched it. I am using categorical cross-entropy with a softmax. Is this perhaps the error? I think that I may need to use a binary solution, perhaps with a sigmoid.
Mark
in creating preprocessing function, where you def augment images(image, label),
while you normalize the pixel values, you used true division // but you are suppose to /
Next in the same grader cell you need to define function to take label as well using tf.one_hot, also remember instead of using num_classes use the value of num_classes
Create a function to generate the saliency map
def do_salience(image, model, label, prefix):
img_file=image (THIS CODE IS NOT REQUIRED)
in def do_salience
Define the expected output array by one-hot encoding the label
The length of the array is equal to the number of classes
This code is incorrect, you need to use image call function where you add an additional dimension for the batch, i.e. img_new_dim.shape[0] to the label. Also using here num_classes is correct. Also this would be called expected_output rather than label_one_hot. Please replace the same in the loss recall function for expected_output.
generate the saliency maps for the 5 test images
using label as label[0] is incorrect, you are only suppose to use 0 or 1 based on instruction Cats will have the label 0 while dogs will have the label 1 .
Configure the model for training,
incorrect loss loss=‘sparse_categorical_crossentropy’,
“categorical” will be 2D one-hot encoded labels, “binary” will be 1D binary labels, “sparse” will be 1D integer labels, so guess which loss would be correct one? Extra hint in instructions: normalize the pixel values to [0, 1]
incorrect optimizer=tf.keras.optimizers.experimental.RMSprop, kindly use tf.keras.optimizers.RMSprop
I have a similar problem with C3W4 assigment (can’t get a high enough average structural similarity index), although I followed all your instructions. May I ask you to look at my notebook as well?
Thanks a lot in advance,
K