TripletLossFn Suggestion: Programming editor, Test with Lab Example, Break into smaller functions

Found it much easier to work on TripletLossFn in a local programming editor (VS Code, PyCharm, …) than in the the Jupyter notebook.
The example code in C3_W4_lecture_nb_2_Modified_Triplet_Loss can be used to generate test output at each step to compare with your new code in TripletLossFn.
Also, the Test vectors from the assignment can be fed into the lab code to have small test data at each step.
With known correct output at each step, you can even split your local code into 2-4 functions to avoid any confusion about which step is not producing the correct result.

Note: You can just use numpy locally to get everything working with the small test data, then switch to fastnp in the Assignment notebook.

Hope this helps.

Hi Gregory314159,

Thanks for your post. It’s a great exercise to implement the code from assignments in a local environment and, indeed, it can have interesting benefits!