Questions tagged [keras]

For questions related to Keras, the modular neural networks library written in Python

Filter by
Sorted by
Tagged with
35
votes
1answer
19k views

Which library would you recommend to begin with deep learning?

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.
7
votes
1answer
406 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
7k 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
0answers
101 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 ...
6
votes
0answers
108 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
58 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
903 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
2answers
69 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 ...
4
votes
2answers
106 views

Can DQN perform better than Double DQN?

I'm training both kind of agents against an environment but DQN performs significantly better than Double DQN. As I've saw here, Double DQN use to perform better than DQN. Am I doing something wrong ...
4
votes
1answer
715 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, ...
4
votes
1answer
374 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
59 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 (...
4
votes
1answer
103 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....
3
votes
2answers
72 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
326 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
280 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 ...
3
votes
2answers
28 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 ...
3
votes
1answer
42 views

CNN how can i reduce gpu memory usage with large image sizes?

I am trying to train a cnn-lstm model, my sample image sizes are 640x640. I have a GTX 1080 ti 11GB. I am using Keras with tensorflow backend. Here is the model. ...
3
votes
0answers
41 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
123 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
2answers
8k 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: ...
2
votes
1answer
342 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
33 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
30 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
98 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
379 views

How to implement word2vec using Tensorflow 2.0 keras API?

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

Text classification task chatbot

I'm building a customer assistant chatbot in Python, so a text classification task, and I have available more or less 7 hundred sentences of average length 15 words (unbalanced class). What do you ...
2
votes
1answer
27 views

How to reduce variance of the model loss during training?

I know that stochastic gradient descent always gives different results. What are the best practices to reduce this variance today? I tried to predict simple function with two different approaches and ...
2
votes
1answer
36 views

Multi label Classification using Keras

I am trying to build a Multi label classification model, having dataset with different input numerical values and specific label... Eg: Value Label 35 X 35.8 X 29 Y 29.8 Y 39 AA 41 CB ...
2
votes
1answer
32 views

Semantic issues with predictions made by my trained model

I'm new to Deep Learning. I used Keras and trained a inception_resnet_v2 model for my binary classification application (fire ...
2
votes
1answer
39 views

ValueError: Error when checking target: expected dense_3 to have shape (1,) but got array with shape (2,)

I am trying to build a CNN model on Keras. The data has a dimension of 921 rows × 10000 columns. Here is the code: ...
2
votes
1answer
49 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 ...
2
votes
1answer
18 views

The best way of classifying a dataset including classes with high similarity?

I have a dataset which has two very similar classes (men wrestling, women wrestling). I've used InceptionV3 as a classifier to solve the problem of classifying this dataset. Unfortunately, the ...
2
votes
1answer
43 views

Understanding the intuition behind Content Loss (Neural Style Transfer)

I'm trying to understand the intuition behind how the Content Loss is calculated in a Neural Style Transfer. I'm reading from an articles: https://medium.com/mlreview/making-ai-art-with-style-transfer-...
2
votes
1answer
43 views

How can I keep context in my chatbot

I have created a chatbot by Keras based on movie dialog. I used RNN more specifically GRU . My bot can reply well. But the problem is , it can't hold the context . As an example if I say ...
2
votes
1answer
1k 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?
2
votes
1answer
314 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 ...
2
votes
1answer
145 views

Keras pattern finding between hash and word

My goal is to build a neural net that can find patterns between a hash and a word on it's own. So that it returns the word of any hash that I will input. Unfortunatally my skill in the area of ...
2
votes
0answers
42 views

Which deep neural networks are appropriate for the detection of bombs?

This is a follow-up question from my previous post here about explosion detection. I gathered a dataset of explosions. As I'm new to Deep Learning in Keras, I'm trying to see what architecture best ...
2
votes
0answers
54 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 ...
2
votes
1answer
81 views

Why is this ResNet50 misclassifying objects?

I'm new to Deep Learning, and I have some conceptual problems. I followed a simple tutorial here, and trained a model in Keras to do image classification on 10 classes of logos. I prepared 10 classes ...
2
votes
0answers
31 views

how to use Softmax action selection algorithm in atari-like game

I'm currently writing a program using keras (python 3) to play a game similar to Atari games, only in this one there are objects moving in the screen in different angles and directions (in most of ...
2
votes
0answers
16 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 ...
2
votes
0answers
40 views

Understanding CNN+LSTM concept with attention and need help

I have a question about the context of CNN and LSTM. I have trained a CNN network for image classification. However, I would like to combine it with LSTM for visualizing the attention weights. So, I ...
2
votes
0answers
40 views

Paper & code for “unsupervised domain adaptation” for regression task

Does anyone know a paper or code that does "unsupervised domain adaptation" for regression task? I saw most of the papers were benchmarked on classification tasks, not regression. I want to do ...
2
votes
0answers
16 views

In addition to matrix algebra, can GPU's also handle the various Kernel functions for Neural Networks?

I've read a number of articles on how GPUs can speed up matrix algebra calculations, but I'm wondering how calculations are performed when one uses various kernel functions in a neural network. If ...
2
votes
0answers
17 views

Binary classification for a series of data (using Keras) to tell if it is a straight line or not a straight line

I am new to machine learning and I would like to seek some advice/help for directions on implementing a binary classification for a series of data and tell if it is a straight line or a not? for ...
2
votes
0answers
38 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 ...
2
votes
0answers
34 views

Autoencoder why it is special for image decoding?

I have read about auto encoder. Understood what is encoding part, and decoding part, and the latent space. Now, i tried to implement this in keras. Below is the code. ...
2
votes
0answers
61 views

Mapping Actions to the Output Layer in Keras Model for a Board Game

I have created a game based on this game here. I am attempting to use Deep Q Learning to do this, and this is my first foray into Neural networks (please be gentle!!) I am trying to create a NN that ...