American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

7 PM – AI/ML – Darin

June 3 @ 7:00 pm - 8:00 pm

Today’s Activities:

  1. Finished the Single Digit Classifier project.

Homework:

Choosing what you want to classify — Can be anything in real life, the only thing is you have to make sure the data exists on Kaggle.

The project has to be able to classify at least 5 different categories.

What we did last week:

  1. Set up the labelling function
  2. Verify Dataloader works with .show_batch() (reference old code for how to do this, it will depend on how you extract labels, whether its via path or filename)
  3. Run training with a vision_learner.
  4. Use the proper imports (fast ai 2.7.19)
  5. Use lr.find() to get the proper learning rate, then run finetuning with the discovered value (you must only call fine_tune once!)Add the following into the vision learner to ensure lr_find works!:
    path=Path(“/kaggle/working”),
    model_dir=”models”,
  6. Export the file as a .pkl file onto your computer!

What you have to do next week:

  1. Make sure training used the proper installs and library versions!
  2. Rerun exporting the .pt file and save it from the outputs on the right of the kaggle page
  3. Use your exported .pt file on streamlit and deploy on the website https://streamlit.io/

    Details are as follows below:


Details on how to deploy on streamlit:

Set up a github account.

❌ means skip unless you lost it, ✅ means do

  1. Create an account at https://github.com/ if you haven’t already. ❌
  2. Go to the top right on your avatar icon, and click on repositories. ✅
  3. Click new at the top right. ✅
  4. Create a new repository called AYCLOGIC_WED7PM_AI_ML_FINAL_PROJECT. Leave all other settings at default, but make sure the visibility is set to public. ✅
  5. Then go to the avatar icon once more, and this time click on settings. 
  6. Inside settings, scroll to the very bottom and on the menu bar you should select “Developer Settings“. ❌
  7. Once in Developer Settings, click on Personal Access Tokens (Tokens Classic). ❌
  8. Then click on “Generate New Token (classic)”. ❌
  9. Set expiration to 90 days, and tick “admin:org” and “write:packages“.
  10. Save the newly generated token but don’t share it! ❌
  11. Then go back to your pycharm and go to the terminal and follow these instructions: ✅
    git init
    
    git add .
    
    git commit -m "Initial Commit"
    
    git remote add origin https://github.com/<your username>/AYCLOGIC_WED7PM_AI_ML_FINAL_PROJECT.git
    
    git branch -M main
    
    git push -u origin main
    
    #######################################################
    
    Note that for the above, you plug in the github username you created before.
    
    Upon executing the commands, you will be asked to login:
    1. For username, you can type in your github username
    2. For password, copy and paste in your personal access token.
    
    Note: When typing in the username and password, you won't see any characters typed out which is actually a security feature, but it is there
    
    Extra note: If you get an error saying git is unavailable, you will need to install it. Email me if this is the case

    Finally after all this you should be able to go to streamlit.io -> top right -> free -> login with github -> choosing your own github repository -> modifying the settings to do python 3.12 -> deploy

Notes:

You can reach me at ddjapri@ayclogic.com.

All class notes can be found here.

Details

Date:
June 3
Time:
7:00 pm - 8:00 pm
Event Categories:
,