Week # must be added in the tags option of the post.
Link to the classroom item you are referring to: C3W2_Assignment.ipynb
Int the final C3W2 assignment, I got a model passing all the tests, but when I ran fit, the training accuracy gets to 0.99 but val_accuracy stays around 0.2. I tried many variations of the parameters in the model and different optimizers (‘adam’, ‘rmsprop’), but the results do not change much. Anyone has any suggestions? Or seen similar results?
I’m confused why I can’t use
vectorized_text = text_vectorizer(text_only)
where text_only is splitted out from the data passed in preprocess_dataset(), instead I have to use
vectorized_text = text_only.map(text_vectorizer)
This first gives me an error, but I suspect the 2nd does not do what I need to do. Am I missing something here?
[quote=“Deepti_Prasad, post:5, topic:770525”]
I’m using sparse categorical crossentropy.
I was talking about within preprocess_dataset(), a dataset, a text_vectorizer and a label_encoder is passed in. First I extract text_only and label_only by using map(). Then I’m supposed to use the text_vectorizer in text_only and label_encoder on the label_only.
in the preprocess step you are suppose to only process that step once but the next step is for adding the number of batches and not for the text and labels.
go through link comment I shared. see if that helps, otherwise send me screenshot of the codes by personal DM.
in the train val dataset the first step was to create train_size using the TRAINING SPLIT, and then you were suppose to split the text and labels, and further dividing them into training text, training labels, validation text and validation labels.
then creating the training dataset and validation dataset from the respective text and labels.
in the preprocess too you have added your own codes. this cell only had two code lines mentioning dataset for both step where one focused on the creating the dataset and the next dataset created the batches.
please get a fresh copy, redo your assignment. make sure only write codes as per instructions already given.
in create model, just below the header grade function, you seem to have import tf.keras.regularizer.
please do not add, delete or edit anything outside the markers ### START AND END CODE HERE###, or you will end up submission failure even if your codes are correct.
Thanks. I got it working with a fresh copy. Thank you for your help, but I’m not exactly sure what the key point that made my original code not working.