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
2
votes
2answers
69 views

How can I have the same input and output shape in an auto-encoder?

I'm building a denoising autoencoder. I want to have the same input and output shape image. This is my architecture: ...
2
votes
1answer
2k views

Tensorflow-gpu cannot use Nvidia GPU with CUDA [closed]

I'm working on a Python Keras/Tensorflow image recognition script (on Ubuntu 18.04) which works ok, but it will only train on CPU (which is slow) and I want to be using my GPU (i have a Nvidia Geforce ...
2
votes
1answer
51 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
48 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
33 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
748 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
27 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
62 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
79 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
118 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 ...
2
votes
1answer
178 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
38 views

Inaccurate masks with Mask-RCNN: Stairs effect and sudden stops

I've been using matterport's Mask R-CNN to train on a custom dataset. However, there seem to be some parameters that i failed to correctly define because on practically all of the images, the bottom ...
2
votes
0answers
191 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 ...
2
votes
1answer
125 views

How to set the target for the actor in A2C?

I did a simple Actor-Critic implementation in Keras using 2 networks where the critic learns the Q-Values of every action, and the actor predicts probabilities for choosing each action. In training, ...
2
votes
0answers
32 views

How can I train a Deep Learning model using degraded photos and their clean version to correct photos

I have 5000 degraded pictures ( pixelated, blurry, too much luminosity ... ) and their clean versions, and I would like to train a model so that it can predict how to correct future pictures. I've ...
2
votes
0answers
85 views

Is it possible to use entity embedding with autoencoder for anomaly detetction?

I'm trying to build autoencoder in keras in order to detect anomalies. However, most of the data is categorical and I have to encode it. When it comes to production, categorical features can take new ...
2
votes
0answers
24 views

Can't figure out what's going wrong with my dataset construction for multivariate regression

TL;DR: I can't figure out why my neural network wont give me a sensible output. I assume it's something to do with how I'm presenting the input data to it but I have no idea how to fix it. Background:...
2
votes
0answers
25 views

How are batch statistics computed in Recurrent Batch Normalization?

I'm implementing recurrent BN per this paper in Keras, but looking at it and those citing it, a detail remains unclear to me: how are batch statistics computed? Authors omit explicit clarification, ...
2
votes
1answer
33 views

How to represent integer values in sequence to sequence prediction task in encoder-decoder LSTM?

I have a large 2D grid having 30k rows and 35k columns, so a total of 30x35k grid cells. Each grid cell is represented by a unique integer number (identity of grid cell). I have several trajectories ...
2
votes
0answers
44 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
1answer
103 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
106 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
1answer
42 views

Training Keras Towards Or Against Analog Value?

For example, if I want to do a cat and mouse AI, the cat would wish to minimize the time taken for it to catch the mouse and the mouse would want to maximize that time. The time is analog and thus I ...
2
votes
1answer
293 views

Is “dataset size” and “model size” same thing?

I mean what is determine my model size, connection amount between layers and neurons, or size of my dataset?
2
votes
0answers
103 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, ...
2
votes
0answers
31 views

i have trained my model & now trying to predict but unable to do using keras [closed]

i have trained my model & now trying to predict but unable to do please help. trying to predict cat or dog stuck in "prediction" ...
2
votes
0answers
94 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
101 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
196 views

Gym dict space as keras DQN agent input

I'm trying to make an AI to play my own card game. I have an OpenAI gym for the game with Dict as an observation space. It is nested dict, so I can't easily replace it with a tuple. I want to pass ...
2
votes
0answers
17 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
20 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
41 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
1answer
311 views

How do I get multiple loss per sample in keras evaluate?

Usually, when I evaluate() a model, I would get a single loss that is already averaged over all samples. How do I get the loss per each sample and return all of them? E.g. if my dataset has 100 ...
2
votes
1answer
270 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 ...
2
votes
0answers
37 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
88 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 ...
2
votes
0answers
32 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 ...
2
votes
0answers
225 views

Deep NN architecture for predicting a matrix from two matrices

Recently my friend asked me a question: having two input matrices X and Y (each size NxD) where D >> N, and ground truth matrix Z of size DxD, what deep architecture shall I use to learn a deep model ...
2
votes
0answers
376 views

CNN attention maps on non-images

My datasets are not actual images, so using methods with ImageDataGenerator or pre-trained networks might not apply in this case. Data Structure: Each "image" is a 2048-long vector that has float ...
1
vote
3answers
794 views

Ensemble Learning using Convolutional Neural Networks

I have created 22 different Convolutional neural networks that all test for the presence of unique objects in an image (each one of the classifiers is unique). Each sample in the test set has the ...
1
vote
2answers
658 views

Is my GRU model under-fitting given this plot of the training and validation loss?

I was running my gated recurrent unit (GRU) model. I wanted to get an opinion if my loss and validation loss graph is good or not, since I'm new to this and don't really know if that is considered ...
1
vote
2answers
1k views

Q Learning Algorithm not converging

I am trying to run Deep Q-learning algorithm on a game which i made in python using pygame library. The algorithm accepts the game screen (4 frames) as input to neural network which used as the ...
1
vote
1answer
30 views

Why is the convolution layer called Conv2D?

When I build a convolution layer for image processing, the filter parameters should have 3 dimensions, (filter_length, filter_width, color_depth) is that correct? ...
1
vote
1answer
46 views

When would bias regularisation and activation regularisation be necessary?

For Keras on TensorFlow, a layer class constructor comes with these: kernel_regularizer=... bias_regularizer=... ...
1
vote
1answer
61 views

Why does this model have 12 parameters?

I guess the model shown in this image (img_1) is the same as the one in this image (img_2) I was trying to build a neural net like that. This keras code is to do the job. ...
1
vote
1answer
374 views

How can I merge outputs of two separate layers so that the overall performance improves?

I am training a combined model (fine-tuned VGG16 for images and shallow FCN for numerical data) to do a binary classification. However, the overall AUC score is not what I expected it to be. Image-...
1
vote
2answers
53 views

Training accuracy vs validation accuracy on deep models

I'm training a deep network in Keras on some images for a binary classification (I have around 12K images). Once in a while, I collect some false positives and add ...
1
vote
1answer
264 views

How many parameters are being optimised over in a simple CNN?

Okay so here's my CNN (simple example from a tutorial) along with some arithmetic to get the total number of free parameters. We've got a dataset of 28*28 grayscale image (MNIST). First layer is a ...
1
vote
1answer
103 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 ...
1
vote
1answer
68 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 ...