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.

1,113 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
22 votes
0 answers
3k views

Understanding Timestamps and Batchsize of Keras LSTM considering Hiddenstates and TBPTT

What I'm trying to do What I am trying to do is predicting the next data-point $x_t$ for each point in the timeseries $[x_0, x_1, x_2,...,x_T]$ in the context of a date-stream in real-time, in theory ...
user avatar
9 votes
0 answers
2k views

Why is my Keras model not learning image segmentation?

Edit: as is turns out, not even the model's initial creator could successfully fine-tune it. This is most likely a problem of implementation, or possibly related to the non-intuitive way in which the ...
  • 199
8 votes
0 answers
109 views

Training value neural network AlphaGo style

I have been trying to replicate the results obtained by AlphaGo following their supervise learning protocol. The papers specify that they use a network that has two heads: a value head that predicts ...
  • 101
7 votes
0 answers
3k views

Tensorflow v1 Dataset API AttributeError with ndim

I'd like to make pipeline for optimizing Gpu and Cpu. Dataset It's about 10000 datapoint and 4 description variables for the regression problem. ...
6 votes
0 answers
121 views

Unable to transform (greatly performing) Autoencoder into Variational Autoencoder

Following the procedure described in this SO question, I am trying to transform my (greatly performing) convolutional Autoencoder into a Variational version of the same Autoencoder. As explained in ...
6 votes
1 answer
8k views

Keras - Implementation of custom loss function with multiple outputs

I am trying to replicate (a way smaller version) the AlphaGo Zero system. However, in the network model, I am having a problem. The loss function I am supposed to implement is the following: $$l = (z -...
6 votes
0 answers
298 views

Optimal implementation of vanilla DQN loss in Keras

I've implemented vanilla DQN for continuous/non-images (no CNN) states in keras. But, I'm not sure if my implementation of the loss computation is optimal. For reminder the loss is defined as : $loss=...
6 votes
0 answers
2k views

Using the Python Keras multi_gpu_model with LSTM / GRU to predict Timeseries data

I'm having an issue with python keras LSTM / GRU layers with multi_gpu_model for machine learning. When I use a single GPU, the predictions work correctly ...
6 votes
0 answers
220 views

Connect output node to next hidden node in RNN

I'm trying to build a neural network with an unconventional architecture and a having trouble figuring out how. Usually we have connections like so, where $X=$ input, $H=$ hidden layer, $Y=$ output ...
  • 2,158
6 votes
0 answers
1k views

Keras objective function shared between outputs

Is there any way to implement a loss function that is shared between outputs? I have a 2D image output and scalar classification that are both used by a single loss function. I have attempted writing ...
5 votes
0 answers
926 views

Tensorflow, Optimizer.apply_gradient: 'NoneType' object has no attribute 'merge_call'

My program gives the following error message: ...
  • 163
5 votes
1 answer
552 views

How can I detect partially obscured objects using Python?

I'm building a computer vision application using Python (OpenCV, keras-retinanet, tensorflow) which requires detecting an object and then counting how many objects are behind that front object. So, ...
4 votes
1 answer
2k views

Is it wrong to use Glorot Initialization with ReLu Activation?

I'm reading that keras' default initialization is glorot_uniform. However, all of the tutorials I see are using relu ...
  • 478
4 votes
1 answer
81 views

Training Machine Learning Model - Neural Network - Islands Problem

I was working on the following leetcode problem: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting ...
4 votes
1 answer
3k views

Autoencoders for the compression of time series

I am trying to use autoencoder (simple, convolutional, LSTM) to compress time series. Here are the models I tried. Simple autoencoder: ...
  • 41
4 votes
2 answers
6k views

Saving and loading keras.callbacks.History object with np.save and np.load

I have been saving my training history in keras as follows: ...
4 votes
2 answers
219 views

Benefits of using Deep Learning-specific hyperparameter optimization tools vs. sklearn?

There are quite a few library for hyperparameter optimization that are specific to Keras or other Deep Learning libraries, like Hyperas or Talos. My question is, what's the main benefit of using ...
4 votes
2 answers
747 views

How to determine the number of the training images in Keras after data augmentaion?

I want to create a CNN model and I am using data augmentation. I want know the number of augmented images in Keras. How to determine the number of the training images in Keras after data augmentation?...
  • 1,825
3 votes
1 answer
598 views

Understanding Conv1D Output Shape

I am a little confused with the output shape that Conv1D produces. Consider the code I have used as the following (a lot has been omitted for clarity): ...
3 votes
0 answers
402 views

Autoencoder: Size of out_backprop doesn't match computed

This question was asked before and non of the answered worked for, I have the code ...
3 votes
0 answers
230 views

Is it possible to increase the number of images of one class using data augmentation, which is not applied on the other class, in the same dataset?

I have 2 classes for my image classification problem, say class A and class B, and I am using tensorflow and keras for the same. One of them have around 5K images while the other have just around 2K ...
3 votes
1 answer
240 views

Keras early stopping to a target

I'm really struggling to understand how the parameters of Keras early stopping callbacks play out, especially in the presence of a baseline. What I want is simply for the training to stop within 2 ...
3 votes
0 answers
231 views

Multiple features in LSTM

It's clear how LSTM works with 1 feature. But what happens if the number of features is > 1? According to the answer proposed here, Keras creates a computational graph that executes the sequence ...
  • 157
3 votes
2 answers
1k views

What is the better way to predict classes for the models developed using the functional API in Keras

We can predict the class for new data instances using the Sequential classification model in Keras using the predict_classes() function. What is the way to predict the class for models that developed ...
3 votes
1 answer
841 views

Error when trying Transfer Learning

I'm trying to train a model which is an extension of Google's Inception-V3 for the purpose of recognizing and classifying whether there is any pneumonia using x-ray images. I've used Tensorflow-Hub ...
3 votes
0 answers
287 views

Chess deep learning siamese network overfitting when shouldn't in theory

TLDR: My network is training with pairs so instead of 10^6 samples it has 10^12 samples (The number of samples squared) . With that large of a data set is shouldn't overfit but it does after very few ...
  • 31
3 votes
0 answers
171 views

Help understanding the Tensorboard histogram names and meaning in an LSTM Model

Can someone please help me understand what the names and shapes of the following tensorboard histogram outputs mean about an LSTM model I coded? Thank you! I understand the terms in the names like ...
3 votes
2 answers
1k views

Keypoint detection from an image using a neural network

I am trying to design and train a neural network, which would be able to give me coordinates of certain key points in the image. Dataset I've got a dataset containing 1800 images similar to these: ...
3 votes
0 answers
475 views

Keras custom metrics - MAP and MRR

I am trying to build a LSTM model in keras where I have one question with 10 answers but only ONE among them is correct. So basically im tring to build a 10 class classification problem. As most of ...
  • 31
3 votes
0 answers
160 views

How to create anchor-positive and anchor-negative pair for feature X in a signature data set for training Siamese network

How to create anchor-positive and anchor-negative pair for feature X in a signature data set for training Siamese network? Im have a cedar signature data set with 55 peoples signatures(classes) with ...
  • 1,301
3 votes
1 answer
3k views

Making predictions / Loading model in TensorFlow 2.0

I use TensorFlow/Keras on a daily basis to make predictions for a project. Everything works fine but I was getting regular warnings about the transition to TensorFlow 2.0 and I thought this week I ...
  • 1,187
3 votes
2 answers
110 views

How can we create an label, value detector?

I am trying to implement an text detector using MaskRCNN such that the model detects the label and value as shown in the image below. Detecting the same is easier for fields like page date and order ...
  • 81
3 votes
0 answers
320 views

Training an LSTM with different time steps and number of features

I want to use an LSTM using Keras to make course grade predictions. My dataset includes student transcripts, which consist of courses taken and their respective grades of students. For each course, I ...
3 votes
1 answer
174 views

How to build a symmetric similarity model on top of embeddings?

I have two equal length vectors that come out of two identical embedding layers. I want to calculate their similarity, and I don't trust the embedding layer enough to just use dot product (e.g. it's ...
  • 131
3 votes
2 answers
2k views

Running out of memory when training Keras LSTM model for binary classification on image sequences

I'm trying to come up with a Keras model based on LSTM layers that would do binary classification on image sequences. The input data has the following shape: ...
  • 131
3 votes
0 answers
82 views

Keras model with second to last sigmoid activated Conv1D layer followed by globalMaxPool outputs values outside [0,1]. Why?

I am trying to train a binary classifier. It is a residual network with skip layers etc. but ultimately, the bottom two layers are a 1D convolution with sigmoid activation followed by a global max ...
3 votes
1 answer
1k views

Training an ensemble of small neural networks efficiently in TensorFlow 2

I have a bunch of small neural networks (say, 5 to 50 feed-forward neural networks with only two hidden layers with 10-100 neurons each), which differ only in the weight initialization. I want to ...
3 votes
1 answer
270 views

How to get the number of steps until a certain accuracy in keras?

I want to see how many steps does it take for my model to reach a certain accuracy.Say 90 percent on cifar10.How can I get this info from the keras model ? EDIT: accuracy in each epoch is accessible ...
  • 223
3 votes
0 answers
222 views

Neural networks (keras): predicting a periodic output array

I have a non-linear multiple regression problem where my target arrays have a length of 256 (for a single sample). These arrays have a periodic structure, since it's actually composed of 16 semi-...
3 votes
0 answers
51 views

Keras 'cross section' model with time trend

Problem: I have a problem in which cross-sectional features (X) explain a continuous outcome (y). In addition, there is a linear time trend (t) in the data. Using OLS, such a model would write: $y = ...
  • 7,054
3 votes
1 answer
2k views

One hot encoding as input to recurrent neural networks

I'm trying to predict next label in a pattern based on previous labels using recurrent neural network. In total I have 100 labels Example of input pattern: ...
3 votes
0 answers
595 views

Embedding variable length "multi-hot-encoded" features

How can I implement an embedding layer in Keras that takes in an input that could have a variable length? For instance, if the vocabulary was 10-long I could have inputs like: ...
  • 439
3 votes
0 answers
197 views

Why does my model only converge when I add a MaxPooling with stride of 1 layer at the beginning?

I have a model that takes an input of inertial sensor data collected at 60 hertz and outputs one of two classes. I have broken the data into 1 min snapshots which seems to be appropriate. I have split ...
3 votes
0 answers
500 views

Grouping the Input Features for LSTM (keras)

When I have a input feature of 2-dimension (variable*feature), is it still good to flatten them into 1-dimension input ...
  • 131
3 votes
0 answers
484 views

Knowing when a GAN is overfitting (sequence classification study)

I have sequences of long, sparse 1_D vectors (3000 digits, made of of 0s and 1s) that I am trying to classify. I have previously implemented a simple CNN to classify them with relative success (with ...
3 votes
0 answers
264 views

convLSTM : how to structure input data

I have the following dataframe containing training data that I have been using to perform a regression task using CNN + FC : ...
3 votes
0 answers
1k views

Multi label classification and sigmoid function

I'm new to neural networks so this may be silly question. I have build standard CNN network for image classification. I want multi-label classification network so I use binary_crossentropy as loss ...
  • 31
3 votes
1 answer
718 views

Keras functional API Layer name not captured with TimeDistributed wrapper

...
  • 161
3 votes
0 answers
2k views

Using Keras masking layer with 2D convolutions (Conv2D)

I'm trying to design a neural network including time dependent input with different lengths and I'm currently using a Masking layer. This network worked well with TensorFlow version 1.9.0 but after ...
  • 31
3 votes
1 answer
1k views

Cross validation for convolutional neural network

I am using Keras to create a CNN model, and I would to use K-fold cross-validation to train the dataset. The dataset contains images and I am using ...
  • 1,825

1
2 3 4 5
23