Skip to main content

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
0 votes
1 answer
2k views

LSTM in reinforcement learning [closed]

Please tell me that is the LSTM network for the problem of reinforcement learning, as I explain to her what she will get the reward of a prediction, because the output will contain only actions? Well,...
alex-rudenkiy's user avatar
2 votes
1 answer
152 views

Deep Q Learning for Simple Game Not Effective

This is a follow-up question about one I asked earlier. The first question is here. Basically, I have a game where a paddle moves left and right to catch as much "food" as possible. Some food is good (...
shurup's user avatar
  • 131
0 votes
1 answer
319 views

Deep Q Learning Algorithm for Simple Python Game makes player stuck

I made a simple Python game. A screenshot is below: Basically, a paddle moves left and right catching particles. Some make you lose points while others make you gains points. This is my first Deep Q ...
shurup's user avatar
  • 131
3 votes
1 answer
749 views

How to train a LSTM model with multi dimensional data

I am trying to train my model using LTSM layer in Keras (python). I have some problems regarding the data representation and feeding it into the model. My data is 184 XY coodinates encoded as a numpy ...
Dawid's user avatar
  • 131
1 vote
0 answers
58 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 ...
Mary's user avatar
  • 973
2 votes
0 answers
170 views

What are the possible neural network architecture for linear regression or time series regression?

I started modeling a linear regression problem using dense layers (layers.dense), which works fine. I am really excited, and now I am trying to model a time series linear regression problem using CNN, ...
Jun Liu's user avatar
  • 29
2 votes
1 answer
287 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 ...
Mithun Sarker Shuvro's user avatar
3 votes
1 answer
1k views

Entropy term in Proximal Policy Optimization (PPO) becomes undefined after few training epochs

I have implemented the total loss of my PPO objective as follows:- ...
Chintan Trivedi's user avatar
2 votes
0 answers
206 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 ...
Joker's user avatar
  • 21
2 votes
0 answers
209 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 ...
offchan's user avatar
  • 325
2 votes
1 answer
1k views

Reinforcement learning to play snake - network seems to not get trained at all

I am trying to build a network able to play snake game. This is my very first attempt to do such stuff. Unfortunately, I've stuck and even have no idea how to reason about the problem. I use ...
ayeo's user avatar
  • 123
1 vote
0 answers
312 views

Why doesnt my lstm model for time series prediction improve after certain level of performance?

I created an lstm model which predicts multioutput sequeances. It takes variable length sequences as input. These sequences are padded with zero to obtain equal length. Note that the time series are ...
mastersom's user avatar
  • 111
2 votes
1 answer
9k 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?
Srikant Jayaraman's user avatar
1 vote
0 answers
169 views

How can I interpret the following error graph?

I am training a neural network which produces the following errors (epoch number on the x axis). I have some questions regrading interpreting it. When I say ...
Can't Tell's user avatar
2 votes
0 answers
27 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 ...
Greg Thatcher's user avatar
1 vote
1 answer
36 views

What type of network for a repeated experiment

I have a problem where I have 9 data points that are collected every minute for 40 minutes, and, by the 40th minute, the solution would be either end up being black or white. I would like to set up a ...
Rad D's user avatar
  • 13
1 vote
0 answers
25 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 ...
newbie programmerz's user avatar
1 vote
1 answer
627 views

Train and Test Accuracy of GRU network not increasing after 2nd epoch

So I´m currently implementing my first neural network using GRUs as a model and Keras as an implementation since it´s pretty highlevel. My problem is about the classification of 8 hour long timeseries ...
JohnDizzle's user avatar
2 votes
0 answers
47 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 ...
Георги Кременлиев's user avatar
1 vote
1 answer
409 views

Is this neural network with a softmax in the output layer suitable for multi-label classification?

I have data with about 100 numerical features and a multi-labelling that encodes ownership of a certain product (i.e. my labels are of the form $[x_i, i=1, \dots, n]$, where $n$ is the number of ...
Joseph Doob's user avatar
0 votes
1 answer
153 views

How can I suppress a CNN’s translation invariant or translation equivariant?

I am trying to understand this post, but I get confused by the definitions and the differences. What's definition of equivariant? If I remove all the pooling layers from a CNN, will it make the ...
0x90's user avatar
  • 281
1 vote
0 answers
399 views

Policy gradient loss for neural network training

Say i want to train a neural network with 10 classes as outputs and use categorical_cross_entropy as a loss function in keras. This will try to fit the training ...
danny's user avatar
  • 119
2 votes
1 answer
51 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 ...
norahik's user avatar
  • 125
2 votes
2 answers
176 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 ...
Bryan Tan's user avatar
  • 183
3 votes
0 answers
65 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://i.sstatic.net/EJHTD.jpg As you can see my agent is a circle and there is one ...
EnesZ's user avatar
  • 131
1 vote
1 answer
134 views

Why doesn't my image classification network get better with training?

I am attempting to train a network to do something I thought would be a relatively simple case to learn with: identify whether the back of a scanned vintage postcard has one of 'no postage stamp', a '...
pr3sidentspence's user avatar
3 votes
2 answers
2k views

Why am I getting spikes in the values of the loss function during training?

I trained a neural network on the UNSW-NB15 dataset, but, during training, I am getting spikes in the loss function. The algorithms see part of this UNSW dataset a single time. The loss function is ...
A. De Rybel's user avatar
1 vote
0 answers
238 views

How can VAE have near perfect reconstruction but still output junk when using random noise input

I am creating a VAE for time series data using CNNs. The data has 4800 timesteps and 4 features. It is standardized and normalized. The network I am using is implemented in Keras as follows. I have ...
Samyak Shah's user avatar
3 votes
2 answers
532 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, I am attempting to predict the appropriate tag for a given Stack Overflow question: How do I subtract 1 ...
thx1138's user avatar
  • 31
3 votes
1 answer
2k 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 ...
Eeuwigestudent1's user avatar
1 vote
1 answer
953 views

LSTM language model not working

I am trying to use a Keras LSTM neural network for character level language modelling. As the input, I give it the last 50 characters and it has to output the next one. It has 3 layers of 400 neurons ...
user117279's user avatar
2 votes
1 answer
503 views

Should I apply ReLU to non negative output?

Suppose I want to predict the position of a sensor based on its reading. I can first predict the unit vector and predict the distance to be multiplied to this vector. And I know that distance will ...
offchan's user avatar
  • 325
1 vote
1 answer
244 views

How can I oppose two AI agents with keras / tensoflow?

I am trying to use tensorflow / keras to play a text based game. The game opposes two players that play by answering questions by choosing an answer among the proposed ones. Game resembles this: ...
Matthieu Raynaud de Fitte's user avatar
0 votes
1 answer
122 views

How can I prevent the CNN from classifying a new input into one of the existing labels (it was trained with) when the input has a new different label? [duplicate]

I'm trying to perform image classification with a CNN. In my case, the inputs are the covers of 9 books, so there are 9 labels. I am using TensorFlow's Keras. If I pass a new input (that has a label ...
user avatar
0 votes
1 answer
351 views

Label arrangement for custom Keras image generator

I am trying to generate 90 and 270 degrees rotated versions of my sample images on the fly during training. I found an example and modifying it. But I am confused about what should be the order? For ...
jonathan eslava's user avatar
7 votes
1 answer
1k 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 ...
Sanavesa's user avatar
  • 163
4 votes
1 answer
4k views

How to constraint the output value of a neural network?

I am training a deep neural network. There is a constraint on the output value of the neural network (e.g. the output has to be between 0 and 180). I think some possible solutions are using sigmoid, ...
raemoii's user avatar
  • 41
4 votes
0 answers
359 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....
Daqi Dong's user avatar
1 vote
1 answer
128 views

Difficulty understanding Keras LSTM fitting data

I'm try to train a RNN with a chunk of audio data, where X and Y are two audio channels loaded into numpy arrays. The objective is to experiment with different NN designs to train them to transform ...
Dmitry's user avatar
  • 19
1 vote
0 answers
1k views

NEAT + Keras : reproducibility problem (World Models implementation)

I'm trying to apply the World Models architecture to the Sonic game (using the gym-retro library). My problem concerns the evolutionnary algorithm part that I use as the controller (worldmodels = ...
Magnus's user avatar
  • 11
3 votes
1 answer
317 views

Using a DQN with a variable amount of Valid Moves per turn for a Board Game [duplicate]

I have created a game on an 8x8 grid and there are 4 pieces which can move essentially like checkers pieces (Forward left or Forward right only). I have implemented a DQN in order to pull this off. ...
pi-r-squared's user avatar
1 vote
1 answer
77 views

Why would giving my AI more data make it perform worse?

So I trained an AI to generate shakespeare, which it did somewhat well. I used this 10,000 character sample. Next I tried to get it to generate limericks using these 100,000 limericks. It generated ...
Christopher King's user avatar
2 votes
0 answers
167 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 ...
pi-r-squared's user avatar
1 vote
2 answers
88 views

CNN Pooling layers unhelpful when location important?

I'm trying to use a CNN to analyse statistical images. These images are not 'natural' images (cats, dogs, etc) but images generated by visualising a dataset. The idea is that these datasets hopefully ...
Matt Hamilton's user avatar
4 votes
1 answer
657 views

Convolutional Layers on a hexagonal grid in Keras [closed]

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 ...
Christopher King's user avatar
1 vote
1 answer
96 views

Automatic prediction of whether a customer will come into the shop or not

So as my university project I am planning to make a prediction system as described in the title. My current idea is to use the age/gender classifier and run it on a video(taken in front of a shop) ...
Duke Glacia's user avatar
1 vote
0 answers
36 views

Sequence to sequence machine learning / NMT - converting numbers into words

I want to do some sequence to sequence modelling on source data that looks like this: /-0.013428/-0.124969/-0.13435/0.008087/-0.269241/-0.36849/ with target data ...
spaces_'s user avatar
  • 11
3 votes
0 answers
39 views

Does it make sense to add word embeddings as additional features for LSTM model?

I have an LSTM model. This model takes as input tokens. Those tokens represent XML markups extracted from some XML files. My model is working fine. However, I want to optimize it by adding word ...
Emna Jaoua's user avatar
8 votes
2 answers
21k views

Can LSTM neural networks be sped up by a GPU?

I am training LSTM neural networks with Keras on a small mobile GPU. The speed on the GPU is slower than on the CPU. I found some articles that say that it is hard to train LSTMs (and, in general, ...
Dieshe's user avatar
  • 289
0 votes
2 answers
2k views

How to decrease accuracy from 99% to 80%~85% using keras for training a model

How do I decrease the accuracy value when training a model using Keras; which parameters can I change to decrease the value? My objective is not to actually decrease it, but just to know which ...
epssy_sy's user avatar