Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [keras]

Open source high-level neural network library for Python and R. Is capable of using TensorFlow or Theano as backend.

0
votes
0answers
10 views

How can I visualize weights of various Keras model layers?

Mostly just for funsies I want to visualize various layers of a Keras model as it's training. So, let's say I make a wee model: ...
1
vote
0answers
528 views

Pearson Correlation for batches of labels and predictions (Keras)

I want to implement a custom metric (pearson correlation) as defined here in Keras. I get a batch (32) of predictions and labels. I use a neural network to predict 10 values. So my input is 32x10 ...
0
votes
0answers
9 views

BiLSTMs with Attention model for Multi-Label Multi-Class Classification

I am trying the modify the BiLSTM with Attention model he used in Course 5 Neural Machine Translation for predicting grades (ranging from O,A+,A,B+,B,C,D,E,F) for multiple subject (approx 9 subjects ) ...
0
votes
1answer
29 views

How to handle timeseries extremes (sigma > 20) in deep learning?

I'm using 16-channel, 400-Hz, standardized EEG data to train CNN-LSTM for seizure classification. The data contains $O(3)$ sigma > 20 points, rarely thousands in a ...
0
votes
1answer
207 views

Parameters Grid Search for Keras LSTM on Time Series

How do you do grid search for Keras LSTM on time series? I have seen various possible solutions, some recommend to do it manually with for loops, some say to use scikit-learn GridSearchCV. Feedback ...
0
votes
1answer
27 views

How to make a sequence element-wise clustering with a RNN (preferable in Keras)

Non-Keras contributions are also welcome since the question is very concrete already. Imagine I have a sequence $S_i = s_0, s_1, ..., s_n$, where $s_k$ is the k-th element that represents an element ...
0
votes
1answer
189 views

why the accuracy of my CNN decreasing after some epochs?

at high accuracy, after some epochs the accuracy as well as validation accuracy is decreasing and got stuck after few more epochs. i dont understand why this happened. does more epochs at some point ...
1
vote
0answers
11 views

Why is my keras resnet50 model overfitting? [duplicate]

I have applied Keras ResNet-50 on a small x-ray image dataset. I tried making layers both trainable and non-trainable, but my model validation accuracy doesn't improve above 50%. I don't understand ...
1
vote
1answer
304 views

How to frame a Time Series forecasting problem for LSTM Neural Networks?

I have a dataset of points along a wave whose cycles slowly grow in period over time. I have ~47 cycles worth of data. My goal is to forecast at least one whole cycle into the future (around 50 data ...
0
votes
0answers
13 views

How can Keras Conv1D towers be concatenated in an inception module?

Word up. I have data of 18 features and 2 classes. I've got a working convolutional network for this data and it works just fine. It's like this: ...
1
vote
1answer
64 views

Is the Keras Embedding layer dependent on the target label?

I learned how to 'use' the Keras Embedding layer, but I am not able to find any more specific information about the actual behavior and training process of this layer. For now, I understand that the ...
0
votes
0answers
7 views

Maximize ELBO in Keras

When we train a Variational Autoencoder we say that we want to maximize the ELBO. However, from the Keras documentation, it seems that we are actually minimizing the ELBO: ...
0
votes
1answer
24 views

What are the effects of a high learning rate?

I have trained a lot of simple convolutional neural networks for some classification task where I varied the hyper-parameters. As an optimizer i used SGD and I trained the models using different ...
1
vote
1answer
216 views

Data Augmentation in Keras: How many training observations do I end up with?

I'm reading through Francois Chollet's "Deep Learning with Python" and was recently introduced to a concept I had never encountered before in my statistics studies. Namely, data augmentation. I have a ...
3
votes
1answer
520 views

Keras: val_loss decreases while loss increases

I set up a model in keras (in python 2.7) to predict the next stock price in a particular sequence. The model I used is shown below (edited to fit this page): ...
0
votes
0answers
44 views

How exactly keras LSTM layer works?

I try to create a sentiment analysis that have 7 classification. Let's say, I have 100.000 unique word (already converted into 100.000 integer) which have the longest input is 41. I created 3 layer ...
0
votes
1answer
349 views

Why CNN doesn't give higher accuracy over simple MLP network? [From Keras examples]

I'm still new to machine learning and just came across powerful deep learning library, Keras. I've read Keras document and tried few Keras examples on Github here. I've also studied some basic ...
2
votes
1answer
183 views

How to use convolutional neural nets on 'cylindrical images'

Suppose I have a data-set of images that 'live on a cylinder' (for example, if my images were taken by panorama shots that wrap around onto themselves). How would I modify a convolutional neural ...
1
vote
2answers
4k views

How to train a LSTM model for a next basket recommendation problem?

I try to use a LSTM model for a problem of next basket recommendation. I would like to apply the same approach as this article in Python using Keras : A Dynamic Recurrent Model for Next Basket ...
0
votes
1answer
43 views

Am I reading my dataset right?

Since I'm new in deep learning I have some questions. I made some tests with keras and mnist dataset and everything was OK. Then I decided to try with some of my datests. You could find the dataset ...
4
votes
1answer
383 views

More Loss in Training than Testing using multi-layer LSTM Neural Networkin Keras/TF

Unsure why I'm consistently seeing a higher training loss than test loss in my model: ...
3
votes
2answers
4k views

Convolutionalizing fully connected layers to form an FCN in Keras

I trained a simple classifier to detect whether or not an image contains a lane line. ...
158
votes
4answers
224k views

What is batch size in neural network?

I'm using Python Keras package for neural network. This is the link. Is batch_size equals to number of test samples? From ...
1
vote
1answer
24 views

training a nn with f1 as loss on keras doesn't work?

I have no problem to train my neural network with categorical_crossentropy as loss but when I do the same with f1, it just doesn't progress : Epoch 1/9 1029/1029 [==============================] - ...
0
votes
0answers
12 views

What type of accuracy should I reported in research paper?

I have read some research papers on the classification task of deep learning, and now I am doing my own. After investigating some research paper which also provided the source code for reproducing ...
0
votes
0answers
17 views

High accuracy on both training and validation but very low on test set

My CNN model has about 96~97% accuracy on both training and validation sets. But when submitting the test set it got only 24% accuracy. Here's my model: ...
0
votes
0answers
31 views
1
vote
3answers
493 views

Class Weight doesn't solve imbalanced dataset problem

I'm training convolutional neural network on imbalanced dataset, which has 9 classes. Number of classes in order is, 3000-500-500- ..... goes like this. Of course I'm not waiting %100 accuracy, but ...
19
votes
3answers
20k views

Understanding input_shape parameter in LSTM with Keras

I'm trying to use the example described in the Keras documentation named "Stacked LSTM for sequence classification" (see code below) and can't figure out the ...
0
votes
1answer
32 views

How to implement thresholded softmax in Keras?

I would like to implement a threshold after the final softmax layer in a Keras-built classification problem so that class assignments with probability below some threshold alpha are disregarded (i.e. ...
1
vote
1answer
28 views

Reproducible numbers in Keras/TensorFlow

Every time I run a Keras/TensorFlow code gives different results. Can someone suggest how to get reproducible numbers?
0
votes
1answer
1k views

Validation accuracy reach to 1.000 in very first epoch

I am using below small 3D CNN to predict whether 32*32*32 image cube in a CT scan is malignant or not. ...
0
votes
0answers
13 views

Using variable dropout in Keras

I need to implement a system with variable dropout factor in Keras with TensorFlow as backend. The dropout factor should change for each batch so that the the dropout factor varies from 0.0 to 0.20 at ...
0
votes
1answer
22 views

Back propagation is done with each batch in a convolutional net, but is it also done with the validation set?

It's my understanding that the weights are updated in a convolutional neural network with each evaluation of a batch. But when the training data has been processed and it comes to predicting ...
0
votes
0answers
13 views

How do I implement masking in TensorFlow eager?

I am training a stateful RNN on variable length sequences (optional: see my previous question for more details). I padded the sequences to a fixed length with the value -1. The when batches are ...
0
votes
0answers
6 views

what is the difference between sklearn's train_test_split and keras load_data()?

im experimenting on autokeras, while doing so i came across something like (x_train, y_train), (x_test, y_test) = mnist.load_data(), is this different from sklearn.model_selection....
0
votes
1answer
212 views

What are the ways to calculate the error rate of a deep Convolutional Neural Network, when the network produces different results using the same data?

I am new to the object recognition community. Here I am asking about the broadly accepted ways to calculate the error rate of a deep CNN when the network produces different results using the same data....
1
vote
1answer
421 views

Convolutional neural network: why would training accuacy and well as validation accuracy fluctuate wildly?

I am training a convnet on a binary classification problem using medical images. I;m doing a preliminary evaluation of various shallow nets to get a sense of what the best hyperparameters are likely ...
0
votes
0answers
18 views

Meaning of kernel size 1 for 1-D convolution in Keras

The kernel size is the window size for 1D convolution. Can anyone explain what is meant by kernel size $1$ in Keras/TensorFlow?
0
votes
1answer
53 views

Should I Choose the best model based on test error or validation error?

I divided my dataset to training, validation and test sets. Then trained multiple forecasting models on the training dataset. now I have 3 errors for each model: Training error Validation error Test ...
0
votes
0answers
12 views

Difference between retraining on different portions of data and training initially on larger data set

I have a large data set that doesn't fit in memory and would have to use something like Keras's model.fit_generator if I would like to train the model on all of the ...
1
vote
1answer
517 views

MobileNets object keypoints localization with Keras

I'm trying to use MobileNets to localize a rectangular object in an image. I want to construct a model that inputs an image, and outputs the keypoints/coordinates (8 total points) of each corner of ...
0
votes
1answer
22 views

1-D convolution neural network in Keras

I am exploring 1-D CNN with Keras. My data is $\mathit{k}\times\mathit{N}$ where $\mathit{k}$ is the number of time stamps and $\mathit{N}$ is the number of features. I want to apply CNN with 1-D ...
0
votes
0answers
14 views

Scaling label values of a Tensorflow dataset

I used Keras to build a model. The summary looks like this: ...
0
votes
0answers
29 views

Neural Network Accuracy Bouncing Around and Never Going Over 50% Accuracy [Not Duplicate] [duplicate]

My NN accuracy is bouncing between .29 and .37. Sometimes it starts at .5, but then decreases as it continues. The loss also bounces around, decreasing, increasing, and generally staying around 1. The ...
1
vote
1answer
231 views

Neural networks to predict a nonlinear curve

I want to model a complex nonlinear function using neural networks (keras). Training data: input - 8500 x 176 matrix of features, output - 8500 x 8 matrix, each row corresponds to 8 points which ...
-3
votes
1answer
35 views

why the neural network gives me null results? [closed]

I trying to predict some fluid parameters, you will find the data I use in the drive link (24 input and 3 output to predict): DATA. first of all I replaced the null values ​​in the data with the ...
0
votes
0answers
20 views

Holdout loss much worse than training & testing data

I am creating a simple MLP which is to predict a single output based and 9 inputs. The data is scaled between 0 and 1, and the data is shuffled before training. The resulting model leads to very low ...
1
vote
1answer
35 views

Why is using keras ImageDataGenerator for data augmentation relevent?

I have used keras ImageDataGenerator to generate more data in my neural networks as I have had really small datasets and it has proven itself. As far as I ...
0
votes
0answers
36 views

Custom TF 2.0 training loop performing considerably worse than keras fit_generator - can't understand why

In trying to better understand tensorflow 2.0, I am trying to write a custom training loop to replicate the work of the keras fit_generator function. In my head, I have replicated the steps ...