Git Product home page Git Product logo

Comments (4)

mesnilgr avatar mesnilgr commented on June 24, 2024

https://en.wikipedia.org/wiki/Object-oriented_programming

from is13.

lucas0 avatar lucas0 commented on June 24, 2024

Seems like

x = self.emb[idxs].reshape((idxs.shape[0], de*cs))

should be:

x = embeddings[idxs].reshape((idxs.shape[0], de*cs))

Am I right? @mesnilgr

from is13.

Helicqin avatar Helicqin commented on June 24, 2024

@lucas0 i met the same question.i want to run the code:

import theano, numpy
from theano import tensor as T

# nv :: size of our vocabulary
# de :: dimension of the embedding space
# cs :: context window size

nv, de, cs = 1000, 50, 5
emb = theano.shared(0.2 * numpy.random.uniform(-1.0, 1.0, \
(nv+1, de)).astype(theano.config.floatX)) # add one for PADDING at the end
idxs = T.imatrix() # as many columns as words in the context window and as many lines as words in the sentence
x = self.emb[idxs].reshape((idxs.shape[0], de*cs))

but errors happened in emb[idxs].i do not understand why emb[idxs] is correct?i think emb is a matrix,idxs is also a matrix.So why?

I would appreciate it if you could give me some tips.thanks.

from is13.

lucas0 avatar lucas0 commented on June 24, 2024

from is13.

Related Issues (20)

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.