-
Notifications
You must be signed in to change notification settings - Fork 75
Issues: zjost/blog_code
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Author
Label
Projects
Milestones
Assignee
Sort
Issues list
i have an error in 'Jp = xent(predp, labels).mean() + wd_term'. (IndexError Traceback (most recent call last) Cell In[52], line 1 ----> 1 dW_approx = get_grads((gcn1_out,), sm1, "W", labels, eps=1e-4, wd=opt.wd) 2 db_approx = get_grads((gcn1_out,), sm1, "b", labels, eps=1e-4, wd=opt.wd) Cell In[50], line 16 14 wd_term = wd/2*(cp_flat**2).sum() / labels.shape[0] 15 #print(wd_term) ---> 16 Jp = xent(predp, labels).mean() + wd_term 18 # J(theta - eps) 19 cp_flat[i] = theta - eps Cell In[47], line 8 7 def xent(pred, labels): #fonction de perte d'entropie croisée ----> 8 return -np.log(pred)[np.arange(pred.shape[0]), np.argmax(labels, axis=1)] IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (34,) (5,) )
#13
opened Feb 27, 2024 by
yassir156
ProTip!
Add no:assignee to see everything that’s not assigned.