karpathy / nn-zero-to-hero

Neural Networks: Zero to Hero
MIT License
11.63k stars 1.46k forks source link

Normalize probability distribution by dividing each element by the su… #22

Open Aaron-A opened 1 year ago

Aaron-A commented 1 year ago

…m of elements along axis 1

P = (N+1).float() P /= P.sum(1, keepdim=True)