Questions tagged [keras]

For questions related to Keras, the modular neural networks library written in Python. However, note that programming questions are off-topic here.

Filter by
Sorted by
Tagged with
37
votes
1answer
20k views

Which library would you recommend to begin with deep learning? [closed]

Which library (TensorFlow or Keras) would you recommend for a first approach to deep learning? I'm a neuroscience student trying for the first time computational approaches, if that matters.
32
votes
6answers
9k views

Why do CNN's sometimes make highly confident mistakes, and how can one combat this problem?

I trained a simple CNN on the MNIST database of handwritten digits to 99% accuracy. I'm feeding in a bunch of handwritten digits, and non-digits from a document. I want the CNN to report errors, so I ...
13
votes
2answers
2k views

Why would you implement the position-wise feed-forward network of the transformer with convolution layers?

The Transformer model introduced in "Attention is all you need" by Vaswani et al. incorporates a so-called position-wise feed-forward network (FFN): In addition to attention sub-layers, each of the ...
8
votes
1answer
620 views

Why does 'loss' change depending on the number of epochs chosen?

I am using Keras to train different NN. I would like to know why if I increment the epochs in 1, the result until the new epoch is not the same. I am using shuffle=False, and np.random.seed(2017), and ...
6
votes
2answers
12k views

Can LSTM Nets be speed up by GPU?

I am training LSTM Nets with Keras on a small mobile GPU. The speed on GPU is slower then on CPU. I found some articles that say that it is hard to train LSTMs (RNNs) on GPUs because the training ...
6
votes
2answers
966 views

Effect of batch size and number of GPUs on model accuracy

I have a data set which was split using a fixed random seed and I am going to use 80% of data for training and rest on validation. Here are my GPU and batch size configurations use ...
6
votes
2answers
87 views

Two data classes for a convolutional neural network, can one have a LOT more images for training than the other?

I have two classes in the training set: one that has images with a feature and the other of images without that feature. Can there be a LOT more images with "no feature" so I can fit in all possible ...
6
votes
0answers
113 views

Why does my NN not classify these tic tac toe pattern correctly? [closed]

I'm trying to teach an AI different pattern of tic tac toe to recognize wether a given pattern represents a win or not. Unfortunately it's not learning to recognize them correctly and I think may way ...
5
votes
1answer
297 views

How do I combine models trained on different data to increase classification accuracy?

I have two trained models. One is using a LinearSVC algorithm and is trained on numerical data from medical examination from patients with diabetic retinopathy. The second one is a neural network ...
5
votes
1answer
1k views

Putting constraints on output of deep neural network

I am training a deep neural network. There is a constraint on an output value of the network. (e.g. Output has to be between 0 and 180) I think some possible solutions are using sigmoid,tanh ...
5
votes
1answer
774 views

Training Custom object detection network using tensor-flow object detection API?

I was just wondering if some one could provide a nice tutorial on how to use the Recent tensor-flow object detection API to train custom network say like VGG-16? (Just USE the VGG-16, VGG-19, ...
5
votes
1answer
223 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....
4
votes
1answer
55 views

Why MLP cannot approximate a closed shape function?

[TL;DR] I generated two classes Red and Blue on a 2D space. Red are points on Unit Circle and Blue are points on a Circle Ring with radius limits (3,4). I tried to train a Multi Layer Perceptron ...
4
votes
1answer
379 views

Convolutional Layers on a hexagonal grid in Keras

Keras' convolutional and deconvolutional layers are designed for square grids. Is there was a way to adapt them for use in hexagonal grids? For example, if we were using axial coordinates, the input ...
4
votes
2answers
41 views

Using a neural network to identify a stable region within a set of data?

I am working on a problem in which I am attempting to find a stable region in a spiral galaxy. The PI I'm working with asked me to use machine learning as a tool to solve the problem. I have created ...
4
votes
1answer
538 views

Over- and underestimations of the lowest and highest values in LSTM network

I'm training a LSTM network with multiple inputs and several LSTM layers in order to setup a time series gap filling procedure. The LSTM is trained bidirectionally with "tanh" activation on the ...
4
votes
1answer
94 views

What is the best approach for multivariable and multivariate regression?

I want to build a multivariable and multivariate regression model in Keras (with TensorFlow as backend), that is, a regression model with multiple values as input (multivariable) and output (...
3
votes
4answers
2k views

How to reproduce neural network training with keras [closed]

I want to see the effects of changing some training parameters (batch size, learning rate, optimizer...) to the accuracy obtained. The problem is that with the same parameters I get significantlly ...
3
votes
3answers
176 views

Why are traditional ML models still used over deep neural networks?

I'm still on my first steps in the Data Science field. I played with some DL frameworks, like TensorFlow (pure) and Keras (on top) before, and know a little bit of some "classic machine learning" ...
3
votes
2answers
123 views

Will a neural network always predict the correct label if it sees the exact same input during training and testing?

If I'm performing a text classification task using a model built in Keras, and for example, am attempting to predict the appropriate tag given a Stack Overflow question: "how to subtract 1 from an ...
3
votes
1answer
46 views

How to describe an keras Model in a scientific report

how would you describe a machine learning model in a scientific report? It should be detailed but I just listed the hyperparameters... Have you got more important properties?
3
votes
1answer
4k views

Adding BERT embeddings in LSTM embedding layer

I am planning to use BERT embeddings in the LSTM embedding layer instead of the usual Word2vec/Glove Embeddings. What are the possible ways to do that?
3
votes
1answer
93 views

Can dropout layers not influence LSTM training?

I am working on a project that requires time-series prediction (regression) and I use LSTM network with first 1D conv layer in Keras/TF-gpu as follows: ...
3
votes
2answers
4k views

Keras : get back labels from a 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. ...
3
votes
1answer
101 views

What is the fastest way to train a CNN with billions of examples?

I have a CNN model that I need to train for a large scale genomics application. It is working well with a subset of my training data. I have scaled up to a subset of about 130 million examples and ...
3
votes
1answer
435 views

How can I reduce the GPU memory usage with large images?

I am trying to train a CNN-LSTM model. The size of my images is 640x640. I have a GTX 1080 ti 11GB. I am using Keras with the TensorFlow backend. Here is the model. ...
3
votes
1answer
708 views

Dice loss gives binary output whereas binary crossentropy produces probability output map

On recommendation of Kanak on stackoverflow I am posting this question here: Currently I am experimenting with various loss functions and optimizers for my binary image segmentation problem. The loss ...
3
votes
1answer
437 views

Mountain car problem with images - not converging

I'm trying to find the optimal policy for the mountain car problem using deep Q learning with images as input, however, I cannot find a way to get my Q function to give me good solutions (I followed ...
3
votes
0answers
33 views

Could zero-padding affect learning in a negative way?

I implemented an LSTM with Keras to perform word ordering task (given a syntactically unordered sentence, the goal is to label ...
3
votes
1answer
227 views

Adding a dense layer after a conv2d layer in a convolutional autoencoder

I am trying to implement a convolutional autoencoder with a dense layer at the bottleneck do to some dimensional reduction. I have seen two approaches for this which arent particularly scalable. The ...
3
votes
0answers
104 views

How can I increase the speed and performance of my implementation of an AI for Reversi?

I made an AI for Reversi, aka Othello (8×8), like Alpha Zero, using this book. This book is written in Japanese. The source code of the AI I implemented can be found in this Github repository. There ...
3
votes
0answers
19 views

L1 Reguarizer in Keras model throwing weight matrix dimension error

Was just experimenting with something when i ran into this error : I am getting matrix dimension errors only when i use L1 Regularizer. I have checked and the regularizer itself doesn't change the ...
3
votes
0answers
49 views

Deep Q-Learning agent poor performing actions. Need help optimizing

I'm trying to make deep q-learning agent from https://keon.io/deep-q-learning My environment looks like this: https://imgur.com/a/OnbiCtV As you can see my agent is a circle and there is one gray ...
3
votes
0answers
213 views

YOLO v3 complete architecture

I am attempting to implement YOLO v3 in Tensorflow-Keras from scratch, with the aim of training my own model on a custom dataset. By that, I mean without using pretrained weights. I have gone through ...
3
votes
1answer
496 views

Periodic Pattern in Validation Loss Curve

I am currently trying to solve a regression problem using neural networks. I want to detect movement patterns in images over time (video) and output a continuous value. During the training process I ...
3
votes
2answers
9k views

keras ValueError: Error when checking model target: expected activation_4 to have shape (None, 19) but got array with shape (100, 1) [closed]

I'm trying to create simple keras NN which will learn to make addition on numbers between 0 and 10. But I am getting the error: ...
3
votes
1answer
357 views

How does backpropagation work on a custom loss function whose components have magnitudes of different orders?

I want to use a custom loss function which is a weighted combination of l1 and DSSIM losses. The DSSIM loss is limited between 0 and 0.5 where as the l1 loss can be orders of magnitude greater and is ...
2
votes
2answers
229 views

How to tell a neural network that: “your i-th input is special”

Assume that I have a fully connected network that takes in a vector containing 1025 elements. First 1024 elements are related to ...
2
votes
2answers
139 views

What is the need for so many filters in a CNN?

Consider the following coding line related to CNNS Conv2D(64, (3,3), strides=(2, 2), padding='same') It is a convolution layer with filter size $3 \times 3$ and ...
2
votes
1answer
642 views

Deep Q-Learning poor convergence on Stochastic Environment

I'm trying to implement a Deep Q-network in Keras/TF that learns to play Minesweeper (our stochastic environment). I have noticed that the agent learns to play the game pretty well with both small and ...
2
votes
1answer
37 views

Is it a sign of overfitting when validation_loss dips and then goes up with increasingly bigger swings?

I am experimenting with a ConvNet to categorize images taken with a depth camera. So far I have 4 sets of 15 images each. So 4 labels. The original images are 680x880 16-bit grayscale. They are scaled ...
2
votes
1answer
53 views

Can we use a neural network that is trained using Reinforcement Learning for dynamic game level difficulty designing in realtime?

I am a newbie to Machine Learning and AI. As per my understanding, with the use of reinforcement learning (reward/punishment environment), we can train a neural network to play a game. I would like ...
2
votes
1answer
72 views

Which ANN can solve for y = x * x + b?

I am new to ANN. I am trying out several 'simple' algorithms to see what ANN can (or cannot) be used for and how. I played around with Conv2d once and had it recognize images succesfully. Now I am ...
2
votes
1answer
1k views

How to compute number of weights of CNN?

How can we compute number of weights considering a convolutional neural network that is used to classify images into two classes : INPUT: 100x100 gray-scale images. LAYER 1: Convolutional layer with ...
2
votes
1answer
42 views

How do I tag the most interesting parts of a video?

This is a follow-up question from my previous question here. I'm new to ML/DL, and one thing I need to do is to use a machine or deep learning video attention model which as the name suggests, can tag ...
2
votes
1answer
34 views

how to benefit from previous training weights in training again to increase accuracy?

I have trained a modified VGG classification CNN, with random initialized weights; therefor the validation accuracy was not high enough for me to accept (around 66%). now using the weights resulted ...
2
votes
2answers
105 views

How important is it that the generator of a generative adversarial network doesn't take in information about input classes?

I'm building a generative adversarial network that generates images based on an input image. From the literature I've read on GANs, it seems that the generator takes in a random variable and uses it ...
2
votes
2answers
1k views

How to implement word2vec using Tensorflow 2.0 keras API? [closed]

Since Keras API as defined as layers, how would it be used to implement the word2vec?
2
votes
1answer
34 views

Evaluate model multiple times in loss function? Is this reinforcement learning?

I am interested in models that exhibit behavior. My goal is a model that survives indefinitely on a two dimensional resource landscape. One dimension represents the location (0 to 1) and the second ...
2
votes
1answer
26 views

Generation of 'new log probabilities' in continuous action space PPO

I have a conceptual question for you all that hopefully I can convey clearly. I am building an RL agent in Keras using continuous PPO to control a laser attached to a pan/tilt turret for target ...

1
2 3 4 5