Stack Exchange Network

Stack Exchange network consists of 174 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]

Keras is a minimalist, highly modular neural network library written in Python.

0
votes
1answer
12 views

Keras LSTM accuracy stuck at 50%

I'm trying to train an LSTM for sentiment analysis on the IMDb review dataset. Here is how I am creating it: ...
1
vote
0answers
6 views

Convolutional neural network for gray images

I am using vgg16 to design a CNN that takes gray input images. The model give me good results without changing anything related to colors. I am not sure if what I did is correct or not. I want to ...
0
votes
0answers
8 views

Adaptive Activation functions using Keras

I am new to Neural Nets. I am trying to use the activation function mentioned in this research paper, https://arxiv.org/pdf/1412.6830.pdf I am trying to use keras and I don't understand how to input ...
1
vote
1answer
58 views

Model Not Learning with Sparse Dataset (LSTM with Keras)

This classification problem is apparently simple and I have no idea why it's not working, perhaps I'm doing a conceptual mistake. I'm trying to make a predictor which will classify minutes on a clock ...
0
votes
1answer
7 views

Keras ImageDataGenerator.flow_from_directory doesn't find images

I'm working on a deep learning (CNN) problem. I have structured my images into folders correctly (I think), like this: ...
1
vote
1answer
20 views

How to implement keras LSTM time series [on hold]

I am learning how to implement Keras LSTM on a simple time series data. The dataset I'm using has $12$ columns and $300k$ rows. Each group of $200$ rows represents ...
0
votes
0answers
3 views

std::bad_alloc with densenet and hyperas

I am filing this issue after being stagnated here for couple of weeks. I am using hyperas to find the hyperparameters for my network, Densenet. My issue here is that my evaluation always fails with ...
0
votes
0answers
6 views

How is it that Compute the features by the CNN without targets of train data

Excuse my ignorance, but I am a newbie when it comes to deep learning in general. I am trying to run a training algorithm on train data which is images using VGG16 network part of trained models on ...
0
votes
1answer
32 views

Is my model over-fitting (LSTM,GRU)

I have small corpus max 150 text utterances, which is again distributed among 5 categories. To test I started with basic deep learning model, where i used word2vec embedding, added 1D convolution ...
0
votes
0answers
2 views

Model for predicting geospatial-temporal (climate) data?

I am attempting to reproduce parts of a dynamic climate model using machine learning in place of physics code. A Jupyter notebook illustrating my current approach is here. I have both inputs and ...
0
votes
0answers
31 views

How can I classify these aerial images?

I want to use R to classify high res aerial images (4 band tiffs). The images are of residential food gardens in Portland. I want to train a model to be able to identify if there is a food garden ...
0
votes
1answer
18 views

Keras input shape error

I am trying to load a Keras model and make predictions with it and run into a strange error. An minimal example is the following: ...
0
votes
1answer
21 views

Can't understand Output shape of a Dense layer - keras

I am following few online tutorial to classify images and started off with dense layers as a starting point to classify cifar10 data. ...
0
votes
0answers
16 views

Threadripper, multicores vs GPU for Keras

I am approaching building new Deep Learning rig on Linux. I have a couple of machines I use for development for my Deep Learning projects. What is important is the speed of various CPUs. I have ...
0
votes
0answers
14 views

Understanding LSTM/RNN structure

In keras when we apply LSTM/RNN model, we specify the node [i.e.,LSTM(128)]. I have a doubt how it actually works. From the LSTM/RNN unfolding image or description, I found that each RNN cell take one ...
0
votes
0answers
14 views

ValueError: Numpy arrays that you are passing to your model is not the size the model expected

I am trying to perform concatenation on the Bidirectinal LSTM layer. I have my model defined like this: ...
2
votes
2answers
90 views
+100

Keras - Error when using HDF5Matrix to fit the model

So I define my data like this: ...
0
votes
0answers
16 views

Backpropagation through time - How many Layers will an unfold produce?

In terms of Recurrent Neural Networks a backpropagation through time is used. That means, a RNN oder LSTM layer in Keras will be unfolded to x layers and backpropagation is performed on this unfolded ...
0
votes
0answers
8 views

Keras LSTM with wavelet transformed inputs grouping?

I am doing a project where I am using financial candle data (OHLCV). If I preprocess each column using Haar discrete wavelet transform, each float value is converted into 2 separate values, the ...
0
votes
1answer
30 views

Keras Fit Function (R): Train Regression Model with multiple Labels

I am trying to implement a deep learning model in R using Keras. Let's say I had a dataset of people's faces and a CSV with information about the person's age, gender, and ethnicity. I want to train ...
0
votes
1answer
58 views

How to properly save and load an intermediate model in Keras?

I'm working with a model that involves 3 stages of 'nesting' of models in Keras. Conceptually the first is a transfer learning CNN model, for example MobileNetV2. (Model 1) This is then wrapped by a ...
0
votes
0answers
10 views

Keras : efficiently create a sample to perform ZCA whitening

I am using Keras' ImageDataGenerator class to generate training & validation dataset for my network. As far as I understand, when one wants to use ZCA whitening, one has to first fit the data ...
1
vote
1answer
15 views

How to make two parallel convolutional neural networks in Keras?

I created two convolutional neural networks (CNN), and I want to make these networks work in parallel. Each network takes different type of images and they join in the last fully connected layer. ...
2
votes
1answer
18 views

Classifying objects based of a varying number of the same type of feature vector for each object

For a congressional session, I have created a doc2vec model of speeches made. Using the vectors from this model, I have a dataset of each congressperson, their political affiliation, and a list of the ...
0
votes
0answers
13 views

Keras : get labels back from saved model

I have a saved keras model. How can I get back the labels from the model ? Because right now, I can use the predict method to get back the probability for a sample to belong to a certain class e.g. ...
0
votes
0answers
27 views

How to train LSTM

Imagine 5 matrices, each with shape 200 x 20. I want take 5 rows of a matrix and predict the 6th (and so on). This will result in 196 samples per matrix (5 x 196 in total). The Keras LSTM layer ...
0
votes
0answers
8 views

Fraud Autoencoder in Keras weird metrics

I have been hammering this simple sketch for some time now, and I still cant wrap my head around what is happening. I am beginning to suspect that the error lies in the dataset, but anyway, I need ...
2
votes
1answer
13 views

Relation between amount of training samples and model depth?

When I add more hidden layers to my CNN (e.g. Dense Layers) it seems that the model needs more training samples to produce good results for classes with few training samples. In the single layer case ...
0
votes
1answer
21 views

Can't train input variable with Keras+Tensorflow

I have a Keras model and I want to do some cool visiualizations with it. It's an object recognition network. So I thought, It would be cool to input a blank image into the network and treat the image ...
0
votes
1answer
8 views

How does keras handle subfolders

I am going to train a network to label a given image whether it belongs to category A or category B (a binary classifier). I use flow_from_directory to generate ...
0
votes
0answers
6 views

Which classifier to select for extracting errors from log file?

I am fairly new to data science, so I have a task to extract the error from a log file if it's return code is not equal to Zero The log file (if there is error) consists of an error, I want to get it ...
1
vote
1answer
45 views

How to Implement a Custom Loss Function with Keras for a Sparse Dataset

My dataset is composed of an idle system that, at some time instants, receives requests. I'm trying to predict these instants through a clock. Since the requests are sparsely distributed (I've forced ...
2
votes
0answers
16 views

clipping the reward for adam optimizer in keras

I would like to clip the reward in keras. I saw it is possible to clip the norm and clip the value is sgd as follows: ...
2
votes
1answer
33 views

Keras: Dimension Error with Sparse Categorical Crossentropy

I'm trying to make an NN that, given the time on the clock, would try to predict which class (out of 32 in this example) is making a request to the system. As a first attempt, I've tried to use ...
5
votes
0answers
69 views

Why does my Keras model learn to recognize the background?

I'm trying to train this Keras implementation of Deeplabv3+ on Pascal VOC2012, using the pretrained model (which was also trained on that dataset). I got weird results with the accuracy quickly ...
2
votes
1answer
13 views

Keras input dimensions for a MLP

I have been training a multilayer perceptron using Keras to make a prediction on a function similar to that of a normal distribution. I have  input variables , and I have one output value . When I set ...
0
votes
1answer
23 views

Denoising Autoencoder Parameter Search

I have ran a hyperparameter search for a denoising autoencoder and the results suggest I should make the sizes of my hidden layers as large as possible (within the range of values I allowed it to ...
0
votes
0answers
22 views

Defining and training together simple nested models in Keras

Let's say I have a list of Keras type models models[i], each returning a single value as an output. I would like to define a model that takes outputs from that list ...
0
votes
0answers
24 views

Input shape for forecasting time series with Keras LSTM

For the last few days I have been trying to get familar with time series forecasting using LSTM in Keras. I have been mostly following tutorials on https://machinelearningmastery.com. Overall the ...
1
vote
0answers
19 views

Shaping data for ConvLSTM for many-to-one image model

Ultimately, I am trying to obtain a binary segmentation mask for an image sequence. I have n number of image sequences, each with 500 greyscale images of size 256px by 400px. Each of these sequences ...
1
vote
1answer
37 views

How to use LeakyRelu as activation function in sequence DNN in keras?When it perfoms better than Relu?

How to use LeakyRelu as activation function in sequence DNN in keras? if I want to write something similar to: model = Sequential() model.add(Dense(90, activation='LeakyRelu')) What is the ...
0
votes
1answer
40 views

Models that converged before aren't converging anymore in Keras

I have two models with saved data that worked well previously but won't anymore. First, it happened with one of my Jupyter notebooks. I can even load the saved model and weights that work. When I ...
2
votes
1answer
14 views

Restricting the output of a model didn't improve the loss value of the model evaluation

There is a deep model for prediction. The outputs are some numbers between 0 and 80. (In the dataset the outputs are 0-80) The model Loss value is 70 and I would like to reduce it. I printed the ...
0
votes
0answers
15 views

Metric to evaluate keras multi-class text classifiation

I saw a lot of published jupyter notebooks where a multi-class text classification was performed. In most cases there are more than 3 possible classes. However, I noticed that the models usually 'only'...
1
vote
1answer
21 views

Keras functional api explanation of activation() layer?

With the keras functional api it is possible to write something like this: x = Activation('relu')(x) x = Dense(8, activation='softmax')(x) My question is whether ...
0
votes
1answer
24 views

How to read the output of Binary cross entropy?

Suppose for a single training example, the true label is [1 0 0 0 0] while the predictions be [0.1 0.5 0.1 0.1 0.2]. How to calculate its binary cross entropy? And how output value decides whether a ...
0
votes
1answer
45 views

Keras Conv1D for simple data target prediction

I am trying to use conv1D layer from Keras for predicting Species in iris dataset (which has 4 numeric features and one categorical target). Following is my code: ...
0
votes
1answer
25 views

Validation-split of Keras fit function

Validation-split in Keras Sequential model fit function is documented as following on https://keras.io/models/sequential/ : validation_split: Float between 0 and 1. Fraction of the training data ...
0
votes
1answer
24 views

Neural network options for simple data classification

I want to clear about keras neural network options for classification of simple data where there are a number of features and one target column, as in iris flower dataset (Species is target): ...
1
vote
1answer
23 views

Why this single layer network does'nt work

I am trying following code (modified from https://www.kdnuggets.com/2017/10/seven-steps-deep-learning-keras.html ): ...