snipsco / ntm-lasagne

Neural Turing Machines library in Theano with Lasagne
https://medium.com/snips-ai/ntm-lasagne-a-library-for-neural-turing-machines-in-lasagne-2cdce6837315#.63t84s5r5
MIT License
300 stars 51 forks source link

The cosine similarities #21

Closed ypxie closed 8 years ago

ypxie commented 8 years ago

z, _ = theano.map(step, sequences=[x, y]). Should x be in the non_sequence?

tristandeleu commented 8 years ago

The map operates over the examples in the mini batch, so x in cosine_similarity is effectively a matrix, and y is a tensor3 (there's a mistake in the documentation, thank you for pointing that out!). This is clearly not the best way to loop over the different batches, but I didn't find a cleaner way to directly work on the matrix/tensor3 version unfortunately.