AIWintermuteAI / Speech-to-Intent-Micro

An open-source, easily accessible package for training and deploying Speech-to-Intent models on microcontrollers and SBCs
Apache License 2.0
36 stars 7 forks source link

Early Stopping Problem for first training model (Basic feature extractor (Vanilla Conv2D)) #5

Closed Tabrez-dev closed 7 months ago

Tabrez-dev commented 7 months ago

Im using ubuntu OS and i have used a virtual env to install all requirements and have used speech_to_intent_tf_keras_edited.ipynb jupyter notebook to run the cells.

Screenshot from 2024-03-07 09-12-30 This is the cell i am getting early stopping error.

Screenshot from 2024-03-07 09-12-16

The early stopping error occurs at epoch 11 but if you look closely from epoch 2 val_loss value does not improve at all. Is there any way to fix this?

I believe all previous cells have run successfully. Here are the screen shots of previous outputs cells before training. Screenshot from 2024-03-07 09-29-44

Screenshot from 2024-03-07 09-30-03

Screenshot from 2024-03-07 09-30-11

Screenshot from 2024-03-07 09-30-26

Screenshot from 2024-03-07 09-30-35

Screenshot from 2024-03-07 09-31-17

AIWintermuteAI commented 7 months ago

Hello! Yes, something looks strange with validation loss not decreasing at all, while training loss does decrease. I'll try reproducing it within this week.

AIWintermuteAI commented 7 months ago

Hello, @Tabrez-dev ! I identified the problem:

generate_data = True #change that to True the first time you are running the code

this line was set to False, which led to using old invalidated slots and intents for validation / test data. It does say #change that to True the first time you are running the code there, but I am guilty myself of running the code without looking at the comments at times...

I changed the value to True and made a couple of other tweaks. It should work now.


Did you know caffeine powers both code and coders? If my tweaks saved your day, consider fueling my next breakthrough with a coffee on BuyMeACoffee. Thanks a latte! ☕

https://www.buymeacoffee.com/hardwareai

Tabrez-dev commented 7 months ago

Hi, @AIWintermuteAI i have seen the jupyter notebook. Thanks so much for helping out. What are some other tweaks did u do?

I have few questions can you please answer them in detail:

  1. I am trying to implement this project on syntiant NDP120. If you have any idea on using the SDK and uploading the model on this kind of board.

If you haven't used the above mentioned board before can you list out general steps to upload the model generated into the hardware?

  1. What is the point of other models after basic vanilla conv 2? Will they enhance the model created by basic vanilla conv 2 or produce their own model and at the end we select the best one out of all? I.e highest accuracy one?

  2. Im thinking of running the model for 75 epochs for the basic conv 2d. What other parameters i can change to get better performance from the model? Thanks!

AIWintermuteAI commented 7 months ago

Just bug fixes, related to package API updates, you can check the diffs. Plus I made it easier to run on colab. Nothing that would change the performance.

  1. Have not used that board personally. If it has ML accelerator, you need to convert the resulting .tflite model with their tooling.
  2. The notebook is meant to be as series of experiments - as you see there is a cell after all the training is done, which calculates the accuracy and prints the best model.
  3. You can play around with learning schedule, optimizer and possibly the number of kernels in layers.

I'll close the issue as the original problem was solved.


Ever heard of the coder's fuel? Yep, it's coffee! If my tweaks saved your day, why not share a cup with me on BuyMeACoffee? Your support keeps the code flowing smoothly. Cheers! ☕

https://www.buymeacoffee.com/hardwareai