Questions tagged [keras]

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

164 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
77 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
0answers
22 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
24 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
118 views

Keras GridSearchCV: Train and Validation Accuracy high but low test accuracy? (SOLVED, BUT WITH A NEW DOUBT IN CV) )

CODE SNIPPET Binary classification problem where train_data : N X H X W X F train_labels: N X 1 ...
0
votes
0answers
24 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
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
9 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
0answers
50 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
0answers
13 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 ...
0
votes
0answers
17 views

Scaling label values of a Tensorflow dataset

I used Keras to build a model. The summary looks like this: ...
0
votes
0answers
31 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 ...
0
votes
0answers
238 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 ...
0
votes
0answers
43 views

Full-parametric Weibull accelerated failure time model using deep-learning library Keras

I wonder if it is possible to fit a full parametric AFT model with the deep-learning library keras. My AFT model assumes that survival function is influenced by some covariate specific acceleration ...
0
votes
0answers
105 views

Dealing with images of variable resolution in CNN autoencoders

Let's suppose would like to build a CNN autoencoder that would be able to turn greyscale images into coloured ones. The final model should be able to accept images of any resolution. Also, note that ...
0
votes
0answers
69 views

Understanding epoch, batch size, accuracy ,performance gain in lstm forecasting model

I am new to machine learning and lstm. I am referring this link LSTM for multistep forecasting for Encoder-Decoder LSTM Model With Multivariate Input section. Here ...
0
votes
0answers
8 views

Finding correlations between multiple labels in neural networks

I am just posting with reference to another thread I read and would appreciate if anybody could offer some help. I am training a multi-label, multi class classifier in keras where my data has multiple ...
0
votes
0answers
76 views

Why do cross_val_score() and fit() return the last value, and not the best?

When you fit() a model, in let's say Keras, over a large number of epochs, chances are overfitting will occur. When supplied with a validation-set, you can easily find the point where the validation ...
0
votes
1answer
171 views

How Do I get 0 and 1 For multiclass multilabel problem in Keras prediction?

Let's say I have 3 classes, and each sample can belong to any of those classes. [ [1 0 0] [0 1 0] [0 0 1] [1 1 0] [1 0 1] [0 1 1] [1 1 1] ] I set my output ...
0
votes
0answers
20 views

Different metrics for GridSearch and Keras: which one is actually returned

During GridSearchCV/RandomizedSearchCV we have different options to use for scoring, 'accuracy' being the most popular. However, in the case of unbalanced classes, such metrics as "f1_macro" are more ...
0
votes
0answers
33 views

Autoencoder - reconstructed image not matching the input image

I have trained a convolutional autoencoder on cifar10 dataset. The reconstruction loss on the test data is quite less (around 0.0225). However, the reconstructed training images do not look like ...
0
votes
0answers
10 views

Handle loss while converting high dimensional image to specific size in VGG 16

I am training a VGG16 net using transfer learning. I have removed the fully connected layers and used fine tuning to classify objects into few categories but I have faced below problems: 1.I have ...
0
votes
0answers
11 views

does feature normalization with Keras solves the color balance and illumination imbalance problem?

Keras ImageDataGenerator allows feature normalization as below: ImageDataGenerator(featurewise_center= True,featurewise_std_normalization=True) I am working with ...
0
votes
1answer
33 views

How could I go about implementing k-fold cross validation giving my circumstance?

The way I understand k-fold cross validation is that a given dataset or a training subset of the dataset is divided into k equal sets called folds. Then the training should be performed iteratively ...
0
votes
0answers
20 views

Incorporating multiple categories to understand relationships between them in a sequential model

I have successfully built a a sequential model to stratify different organs of some genomic data that I have, and this works really well and with a high accuracy too. However, this is also time series ...
0
votes
1answer
42 views

Why does the DCGAN output degrade with an increase in the kernel size?

Thank you for the explanation on the kernel size. I have been experimenting with the sample Generative Adversarial Network (GAN) code from the book on Deep learning with Python by François Chollet, ...
0
votes
0answers
32 views

Machine Learning: Model doesn´t recognize letters but has 80% accuracy

I have build a model to classify numbers and characters on Images. I trained it on the Chars74K dataset and in training it has 80% validation accuracy. I just use the number and uppercase characters ...
0
votes
0answers
40 views

NER with GRUs neural network with imbalance dataset

this is my first time asking question on CrossValidated, so if there is any mistake on my part, i apologize. I will try not to make those mistakes again. I'm trying to do a NER task. The problem is ...
0
votes
0answers
17 views

Dropdown in Validation Loss in the first epochs

I've built a classical backpropagation ANN using Keras for a regression problem, which has two hidden layers with a low amount of neurons (max. 8 per layer). The amount of samples for training and ...
0
votes
1answer
150 views

Feed Forward Neural Network Time Series Regression

I'm trying to use the Tensorflow regression tutorial (with Keras) to do some regression on a time series with a couple of inputs. I will provide code if asked so. My inputs are: [Day, Hour, Minute, ...
0
votes
0answers
367 views

Weighted binary crossentropy in U-Net has no effect on accuracy (dice coefficient)

I am currently working on implementing a weighted binary crossentropy loss function as described in the U-Net paper ...
0
votes
1answer
25 views

How to predict similarity of unseen data to the training set?

I have a time series of human pose data which are recorded from real humans. I want to train the model with unsupervised learning on the training data. Let's call this the "real" training data. The ...
0
votes
0answers
52 views

my CNN predict all 0 or all 1 in multi label classification problem

I am trying to build a CNN for classifying multiple objects in images. I'm on keras and I use the COCO dataset. my net takes in input a 256x256 image and outputs the vector of the predictions of each ...
0
votes
0answers
238 views

Why would one use gradient boosting over neural networks?

I'm referring to a specific Kaggle set: https://www.kaggle.com/c/petfinder-adoption-prediction There are a lot of columns, and I'm (for now) ignoring the images / videos. I'm training a standard ...
0
votes
0answers
161 views

Time-series classification of Kinect data using Keras

For my PhD project I recorded using Kinect and Myo 11 people performing Cardiopulmonary Resuscitation (CPR), repeatedly doing chest compressions to a manikin (one person per time). I collected in ...
0
votes
0answers
96 views

GridSearchCV with one-hot y: prediction yields 1-dim array

I run a classification by means of a neural network, thus my y-values are converted to a one-hot matrix: ...
0
votes
0answers
31 views

how to consider some miss classifications “half correct” in categorical_crossentropy - for a trading system

I have a trading system where the model receives 9 time-series and predict : A - strong down B - week down C - neutral D - week up E - strong up (these classes ...
0
votes
0answers
274 views

loss='categorical_crossentropy' VS loss=K.categorical_crossentropy

Why I have very different loss values in training using these two lines code to define the loss function? ...
0
votes
0answers
234 views

Autoencoder as an optimization (search) problem

We all know that machine learning problems can be modeled as an optimization problem where we are searching for the best set of parameter values in the parameter space that optimizes our objective ...
0
votes
0answers
62 views

How to get the same output on each training iteration of neural network?

I'm a neural network noob and am trying to use LSTM(Keras,Tensorflow backend) for predicting time series data. Every time I train the network, I get a very different set of output values even though ...
0
votes
0answers
46 views

Prepare data for stateful/stateless/return_sequences RNN

I'm trying this Tensorflow example that using GRU to predict and generate text. Suppose there is the text "Hello World yes", and the sequence length is 5. Then we prepare the training data to be (...
0
votes
0answers
100 views

Neural Network Parallel Architecture

I am a beginner to Machine Learning. While working on a personal project with VAEs, I had an idea. I will first give some background. Sometimes I have seen that it is common practice, when creating ...
0
votes
1answer
308 views

How to get consistency in neural network and eliminate possibility of NaN values?

I'm using a neural network(Keras,LSTM) for time series regression. Whenever I run the network, I get different outputs for the prediction. This is presumably due to the randomised weight ...
0
votes
0answers
60 views

Keras L2 regularized LogReg with Dense Layer yields too small bias

I just started using Tensorflow and Keras. To start with I thought it might be a good idea to implement a logistic regression for practise and testing. Having done that I am facing the problem, that ...
0
votes
0answers
19 views

How to obtain embedded representation of single test instance after training

The first layer of my RNN is embedded layer as follows. ...
0
votes
0answers
443 views

Auxiliary loss function keras

I'm trying to write the custom loss function called ( Auxiliary loss function) which are two softmax loss functions put together that controls both the Context path and Spatial path of the network. ...
0
votes
0answers
74 views

GAN generated images all similar per epoch

I'm working on a GAN using cifar-10 images. After each epoch I create 10 new random z noise vectors, and use them to create 10 images using the generator. All of the 10 images look very similar, but ...
0
votes
0answers
151 views

keras embedding training optimization objective

I am aware of this and this existing questions, as well as this issue on github. Unless I am missing something though, all these fail to explain how the example in the keras docs makes sense: ...
0
votes
0answers
147 views

Different results for stratified cross validation and train test split for CNN

I am trying to develop an image classifier using conventional neural networks. Now I was looking at evaluating the model using 10-fold cross validation and through repeated train test splitting (hold ...
0
votes
0answers
63 views

Neural network not learning with custom loss function

I have implemented a custom loss function that is supposed to enhance a binary cross entropy loss function, by weighting incorrect decisions depending on an opportunity cost. The whole code is listed ...
0
votes
1answer
80 views

What are different methods to find the slow decrease in training/validation loss

I am training YOLO network consisting of resnet50 architecture.This problem is to find different text labels on the image and predict bounding boxes During training, I am seeing very less change in ...