I’m runing two ways to calculate e_biascomponent using the projection formula given in the assignment, first method using np.dot(g,g) for (norm2(g))^2, and second method using np.square(np.linalg.norm(g, ord=2)).

-First method after neutralizing cosine_similarity(e_debiased, g_unit)=8.121032243645225e-17.

-Second method after neutralizing cosine_similarity(e_debiased, g_unit)=3.5723165491646677e-17. (same as the correct value given by the assignment).

My question, wich of those is the correct form? compututionnally i think the first one is more simple.