theo- / sentiment-analysis-keras-conv Goto Github PK
View Code? Open in Web Editor NEWUsing Convolutional Neural Net for Sentiment Analysis
Using Convolutional Neural Net for Sentiment Analysis
Hi! First of all, thanks for sharing this keras nn!
I was trying to run this code as is and I got this error right after running the model.compile()
. Would you know what is it?
TypeError: sigmoid_cross_entropy_with_logits() got an unexpected keyword argument 'labels'_
Full Error Transcription:
TypeError Traceback (most recent call last)
in ()
----> 1 model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
//anaconda/lib/python2.7/site-packages/keras/models.pyc in compile(self, optimizer, loss, metrics, sample_weight_mode, **kwargs)
764 metrics=metrics,
765 sample_weight_mode=sample_weight_mode,
--> 766 **kwargs)
767 self.optimizer = self.model.optimizer
768 self.loss = self.model.loss
//anaconda/lib/python2.7/site-packages/keras/engine/training.pyc in compile(self, optimizer, loss, metrics, loss_weights, sample_weight_mode, **kwargs)
897 loss_weight = loss_weights_list[i]
898 output_loss = weighted_loss(y_true, y_pred,
--> 899 sample_weight, mask)
900 if len(self.outputs) > 1:
901 self.metrics_tensors.append(output_loss)
//anaconda/lib/python2.7/site-packages/keras/engine/training.pyc in weighted(y_true, y_pred, weights, mask)
428 """
429 # score_array has ndim >= 2
--> 430 score_array = fn(y_true, y_pred)
431 if mask is not None:
432 # Cast the mask to floatX to avoid float64 upcasting in theano
//anaconda/lib/python2.7/site-packages/keras/losses.pyc in binary_crossentropy(y_true, y_pred)
43
44 def binary_crossentropy(y_true, y_pred):
---> 45 return K.mean(K.binary_crossentropy(y_pred, y_true), axis=-1)
46
47
//anaconda/lib/python2.7/site-packages/keras/backend/tensorflow_backend.pyc in binary_crossentropy(output, target, from_logits)
2615
2616 return tf.nn.sigmoid_cross_entropy_with_logits(labels=target,
-> 2617 logits=output)
2618
2619
TypeError: sigmoid_cross_entropy_with_logits() got an unexpected keyword argument 'labels'
`
hi, thank you for the code and the blog post.
how can I use this code for multi_class classification?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.