Skip to main content

Questions tagged [keras]

Keras is a popular, open-source deep learning API for Python built on top of TensorFlow and is useful for fast implementation. Topics include efficient low-level tensor operations, computation of arbitrary gradients, scalable computations, export of graphs, etc.

265 votes
10 answers
435k views

How to set class weights for imbalanced classes in Keras?

I know that there is a possibility in Keras with the class_weights parameter dictionary at fitting, but I couldn't find any example. Would somebody so kind to ...
Hendrik's user avatar
  • 8,677
31 votes
2 answers
30k views

How to feed LSTM with different input array sizes?

If I like to write a LSTM network and feed it by different input array sizes, how is it possible? For example I want to get voice messages or text messages in a ...
user3486308's user avatar
  • 1,300
44 votes
6 answers
64k views

What is the relationship between the accuracy and the loss in deep learning?

I have created three different models using deep learning for multi-class classification and each model gave me a different accuracy and loss value. The results of the testing model as the following: ...
N.IT's user avatar
  • 2,005
16 votes
1 answer
20k views

Multi-dimentional and multivariate Time-Series forecast (RNN/LSTM) Keras

I have been trying to understand how to represent and shape data to make a multidimentional and multivariate time series forecast using Keras (or TensorFlow) but I am still very unclear after reading ...
Bastien's user avatar
  • 263
125 votes
2 answers
116k views

Training an RNN with examples of different lengths in Keras

I am trying to get started learning about RNNs and I'm using Keras. I understand the basic premise of vanilla RNN and LSTM layers, but I'm having trouble understanding a certain technical point for ...
Tac-Tics's user avatar
  • 1,370
14 votes
1 answer
15k views

How to Predict the future values of time horizon with Keras?

I just built this LSTM neural network with Keras ...
Nbenz's user avatar
  • 283
59 votes
3 answers
115k views

How to set batch_size, steps_per epoch, and validation steps?

I am starting to learn CNNs using Keras. I am using the theano backend. I don't understand how to set values to: batch_size ...
Ermene's user avatar
  • 693
18 votes
7 answers
15k views

Why does Keras need TensorFlow as backend?

Why does Keras need the TensorFlow engine? I am not getting correct directions on why we need Keras. We can use TensorFlow to build a neural network model, but why do most people use Keras with ...
star's user avatar
  • 1,481
16 votes
3 answers
65k views

Keras Sequential model returns loss 'nan'

I'm implementing a neural network with Keras, but the Sequential model returns nan as loss value. I have sigmoid activation ...
pairon's user avatar
  • 415
10 votes
3 answers
5k views

How to use a dataset with only one category of data

I am performing a classification task, to try to detect an object. A picture of the environment is taken, candidates are generated of this possible object using vision algorithms, and once isolated, ...
Finn Williams's user avatar
64 votes
4 answers
79k views

Does batch_size in Keras have any effects in results' quality?

I am about to train a big LSTM network with 2-3 million articles and am struggling with Memory Errors (I use AWS EC2 g2x2large). I found out that one solution is to reduce the ...
hipoglucido's user avatar
  • 1,170
46 votes
2 answers
75k views

Merging two different models in Keras

I am trying to merge two Keras models into a single model and I am unable to accomplish this. For example in the attached Figure, I would like to fetch the middle layer $A2$ of dimension 8, and use ...
Rkz's user avatar
  • 1,033
39 votes
1 answer
57k views

How does Keras calculate accuracy?

How does Keras calculate accuracy from the classwise probabilities? Say, for example we have 100 samples in the test set which can belong to one of two classes. We also have a list of the classwise ...
pseudomonas's user avatar
  • 1,042
37 votes
1 answer
37k views

RNN's with multiple features

I have a bit of self taught knowledge working with Machine Learning algorithms (the basic Random Forest and Linear Regression type stuff). I decided to branch out and begin learning RNN's with Keras. ...
Rjay155's user avatar
  • 1,225
28 votes
2 answers
18k views

Is there away to change the metric used by the Early Stopping callback in Keras?

When using the early stopping callback in Keras, training stops when some metric (usually validation loss) is not increasing. Is there a way to use another metric (like precision, recall, or f-measure)...
P.Joseph's user avatar
  • 393

15 30 50 per page
1
2 3 4 5
10