karpathy/nn-zero-to-hero

Error in makemore_part1_bigrams.ipynb

mksamelson opened this issue · 1 comments

P.shape


NameError Traceback (most recent call last)
in <cell line: 1>()
----> 1 P.shape

NameError: name 'P' is not defined

P is just a normalization version of N for probability.

You can easily fix it by

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