Code Monkey home page Code Monkey logo

blog_code's People

Contributors

dependabot[bot] avatar zjost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

blog_code's Issues

Why is there no bias in the output of GCN layer and why there is linear layer before softmax implementation?

Hi,

  1. I was reading the Thomas N. Kipf pytorch implementation of GCN [https://github.com/tkipf/pygcn/blob/master/pygcn/layers.py]. If I understand correctly, he adds bias to every GCN layer output [line 35].
    Why is it so? Is it required to be done in Numpy implementation, too?
  2. Also, there is no linear layer before the softmax layer. Why does the numpy implementation have a linear layer before the softmax implementation in the softmax_layer function?

Please help
Thank you

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,) )

Difficulty in understanding xent function

Hi,
Thank you so much for the detailed code.
I would highly appreciate your explaining the xent function with np.arange and np.argmax. What is it actually doing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.