neural-tensor-network's People
Forkers
snazz2001 dmoliveira mapleyustat fanfannothing nickyongzhang 5idaidai sywu vinodhsubramanian1193 kalyanp xiongshufeng josecardonafigueroa spallavolu emoreno619 jtianwen peratham zbxzc35 codeaudit smartinsightsfromdata zuacubd nooralahzadeh ycyoon zxlzr diegofalcao zhaochaocs zshwuhan nmuralid1 apogre yasutaka ryh95 kshankar14 liuning123 duxiangkun xiaoliang008 sherlock42 zhoulipeng7 patriciaxiao rahulsinghpatelneural-tensor-network's Issues
An error at line 270 of NeuralTensorNetwork.py
Hi Guys!
I don't understand why the following line of NeuralTensorNetwork.py works well.
wrong_filter = (score_pos + 1 > score_neg)[0]
I think you should subtract 1 from ``score_pos''.
wrong_filter = (score_pos - 1 > score_neg)[0]
word_vectors
,
what is wordIndices.p file
What is 'wordIndices.p' file and how is it created ?
Activation function for calculating the score of a tripple is missing
Hello,
I think the acitviation function for calculating the score of a tripple after the training is missing.
https://github.com/siddharth-agrawal/Neural-Tensor-Network/blob/master/neuralTensorNetwork.py#L428-L434 and also in getPredictions().
dev_scores[i, 0] += U[rel][k, 0] * (np.dot(entity_vector_e1.T, np.dot(W[rel][:, :, k], entity_vector_e2)) +
np.dot(V[rel][:, k].T, entity_stack) + b[rel][0, k])
I think it should be like this:
test_score += U[rel][k, 0] * self.activationFunction((np.dot(entity_vector_e1.T, np.dot(W[rel][:, :, k], entity_vector_e2)) +
np.dot(V[rel][:, k].T, entity_stack) + b[rel][0, k]))
What do you think?
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdf in position 0: ordinal not in range(128)
Hi,
When I run the neuralTensorNetwork.py file, I have encountered this problem:
I use Python 3.6.
Traceback (most recent call last):
File "neuralTensorNetwork.py", line 764, in
neuralTensorNetwork()
File "neuralTensorNetwork.py", line 710, in neuralTensorNetwork
word_indices, num_words = getWordIndices('wordIndices.p')
File "neuralTensorNetwork.py", line 591, in getWordIndices
word_dictionary = pickle.load(open(file_name, 'rb'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdf in position 0: ordinal not in range(128)
Does anyone know how to solve it?
Thanks.
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
I am getting below error when trying to run python neuralTensorNetwork.py
File "neuralTensorNetwork.py", line 753, in <module>
neuralTensorNetwork()
File "neuralTensorNetwork.py", line 733, in neuralTensorNetwork
args = (data, 1,), method = 'L-BFGS-B', jac = True, options = {'maxiter': batch_iterations})
File "/Users/khurram/anaconda3/envs/tf2/lib/python2.7/site-packages/scipy/optimize/_minimize.py", line 487, in minimize
callback=callback, **options)
File "/Users/khurram/anaconda3/envs/tf2/lib/python2.7/site-packages/scipy/optimize/lbfgsb.py", line 335, in _minimize_lbfgsb
f, g = func_and_grad(x)
File "/Users/khurram/anaconda3/envs/tf2/lib/python2.7/site-packages/scipy/optimize/lbfgsb.py", line 285, in func_and_grad
f = fun(x, *args)
File "/Users/khurram/anaconda3/envs/tf2/lib/python2.7/site-packages/scipy/optimize/optimize.py", line 292, in function_wrapper
return function(*(wrapper_args + args))
File "/Users/khurram/anaconda3/envs/tf2/lib/python2.7/site-packages/scipy/optimize/optimize.py", line 63, in __call__
fg = self.fun(x, *args)
File "neuralTensorNetwork.py", line 219, in neuralTensorNetworkCost
entity_vectors_e1 = entity_vectors[:, e1.tolist()]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
Get entity vectors for examples of 'i'th relation
File "neuralTensorNetwork.py", line 219, in neuralTensorNetworkCost
entity_vectors_e1 = entity_vectors[:, e1.tolist()]
IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
Why do you roll all the models' parameters together?
You have this function, StackToParams where you seem to take all the models' parameters and roll them into one parameter, which seems moderately expensive. The only place it seems like you us this representation of your parameters is that allows you to say this, which is clean, I admit. But this seems like a lot of overhead to keep the code a little cleaner. And for this cleanliness, I feel like you've lost some readability. Am I missing something? Is there some other reason you chose to wrap all those parameters together?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.