Questions tagged [keras]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Iterate in Keras custom loss function [migrated]

I know that is better avoid loop in Keras custom loss function, but I think I have to do it. The problem is the following: I'm trying to implement a loss function ...
0
votes
1answer
45 views

How to handle extremely 'long' images?

After transforming timeseries into an image format, I get a width-height ratio of ~135. Typical image CNN applications involve either square or reasonably-rectangular proportions - whereas mine look ...
1
vote
0answers
20 views

NN for card game evaluation function

I've written an Monte Carlo Tree Search player for the game of Castle (AKA Shithead, Shed, Palace...). I have set this MCTS player to play against a basic rule based AI for ~30000 games and collected ~...
4
votes
0answers
33 views
+50

How to implement taylor expansion of progressive Convolutional NN?

I intend to implement CNN like progressively expanded neural network in Keras. The basic idea is the first input node can be decomposed into multiple nodes with different orders and coefficient, then ...
0
votes
0answers
7 views

tf.data.Dataset: The `batch_size` argument must not be specified for the given input type [migrated]

I'm using Talos and Google colab TPU to run hyperparameter tuning of a Keras model. Note that I'm using Tensorflow 1.15.0 and Keras 2.2.4-tf. ...
0
votes
2answers
23 views

What does it mean to have epochs=30 in Keras' fit method given certain data?

I have read a lot of information about several notions, like batch_size, epochs, iterations, but because of explanation was without numerical examples and I am not native speaker, I have some kind of ...
2
votes
0answers
12 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 ...
0
votes
0answers
10 views

Verifying if GPU is actually used in Keras/Tensorflow, not just verified as present [migrated]

I've just built a deep learning rig (AMD 12 core threadripper; GeForce RTX 2080 ti; 64Gb RAM). I originally wanted to install CUDnn and CUDA on Ubuntu 19.0, but the installation was too painful and ...
0
votes
0answers
15 views

How can I implement a simple memory augmented neural network as provided in this PyTorch implementation with Tensorflow 2 and Keras? [migrated]

I found this repo (https://github.com/donggong1/memae-anomaly-detection) with a PyTorch implementation of a simple memory for a neural network. I think that this memory can be really easily ...
1
vote
0answers
17 views

How can I implement a custom loss function that takes into account multiple predictions of the network? [migrated]

I am currently implementing a CNN with a custom error function. The problem I am trying to solve is physics-based, so I can calculate the maximal achievable precision, or to put it another way, I know ...
0
votes
0answers
11 views

How do I modify the activation functions from keras? [migrated]

I would like to use the activation function relu with its parameter alpha set to 0.2, but I could not figure out how this can be ...
2
votes
1answer
30 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, ...
4
votes
1answer
43 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 ...
0
votes
0answers
18 views

Error when checking input: expected dense_203_input to have shape (1202,) but got array with shape (1,) [migrated]

I've made a very simple neural network, which is meant to do reinforcement learning. However, I cannot predict anything as I get an error when trying to predict. Error in question: Error when ...
0
votes
0answers
11 views

what is the meaning of “None” in TensorFlow keras model? [migrated]

I am using TensorFlow with Keras for pattern recognition. My input data is a 32*32 pixel binary image and the output is 4 classes. I created model as follow ...
0
votes
0answers
25 views

Image data generator for my (x, 12, 370, 235, 3) dataset [migrated]

I have made a model with 12 2D CNN inputs. I suddenly realized that the ImageDataGenerator from from keras.preprocessing import image don't accept inputs with ...
0
votes
1answer
101 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 ...
0
votes
0answers
21 views

Creating custom sequential dataset in keras [migrated]

I have data saved in multiple csv files (16000+) and my aim is to create a dataset from these files. Each csv has the columns: "Source node", "Path", "Target node". In each of these columns is a one-...
0
votes
0answers
21 views

Which axis of the input of the RNN is used as the “temporal” axis in Keras? [migrated]

When using a SimpleRNN or LSTM for classical sentiment analysis algorithms (applied here to sentences of length <= 250 words/tokens): ...
1
vote
0answers
37 views

Neural Network Results always the same

I have a GRU model which has 12 features as inputs and I'm trying to predict output power. I really do not understand though whether I choose 1 layer or 5 layers 50 neurons or 512 neuron 10 epochs ...
0
votes
0answers
18 views

How to run tensorflow inference for multiple models on GPU in parallel? [migrated]

Do you know any elegant way to do inference on 2 python processes with 1 GPU tensorflow? Suppose I have 2 processes, first one is classifying cats/dogs, 2nd one is classifying birds/planes, each ...
1
vote
0answers
35 views

How to deal with features which are here just for training?

I'm new to the Data Science field and last week I started to learn about Neural Networks and Deep Learning. To practice, I decided to do a small project: design a Neural Network to predict the winner ...
1
vote
1answer
44 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-...
2
votes
1answer
22 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 ...
1
vote
0answers
16 views

Invalid argument: indices[0,0] = -4 is not in [0, 40405) [migrated]

I have a model that was kinda working on some data. I've added in some tokenized word data in the dataset (somewhat truncated for brevity): ...
1
vote
1answer
30 views

How can I use autoencoders to analyze patterns and classify them?

I generated a bunch of simulation data from a complex physical simulation that spits out patterns. I am trying to apply unsupervised learning to analyze the patterns and ideally classify them into ...
1
vote
1answer
52 views

Why is my validation/test accuracy higher than my training accuracy

Is this due to my dropout layers being disabled during evaluation? I'm classifying the CIFAR-10 dataset with a CNN using the Keras library. There are 50000 samples in the training set; I'm using a ...
1
vote
0answers
147 views

How can I deploy a Keras machine translation model on Flask or django [closed]

I want to deploy a machine translation system implemented in Keras on Flask. In which format do I have to save my model for flask? Is there a tutorial that shows how to deploy a Keras model on Flask?...
0
votes
0answers
10 views

My CTC loss model's loss stagnates and then outputs only blank characters

I am trying to implement BaiDu's DeepSpeech1 in keras using CTC loss, my code is below: ...
0
votes
0answers
14 views

Feed data into Keras LSTM layer

I'm trying to understand how to feed data into LSTM layer of Keras, but I'm in trouble and I don't understand how to do it. I've ...
0
votes
0answers
27 views

Training an unsupervised convolutional neural network to learn a general representation of a Lua module

I am trying to train a CNN in keras to learn a general representation of a Lua module, e.g. requires at the beginning, local variables, local functions, interface (returns) and in between some ...
1
vote
1answer
38 views

Is there a car detection software written in Tensorflow or Keras with Python?

For a current project demo, I'm searching for a car detection neural network in Python written in TF/Keras (or any other type, as long as it has no C++ dependencies). Later on, I gonna write my own, ...
1
vote
0answers
17 views

Can tensorflow debugger debug a trained keras model during prediction?

I have a trained LSTM model created with keras. Is it possible to use tensorboard debugger or tensorflow debugger to debug the model during prediction runtime? Meaning that it steps through the model ...
1
vote
0answers
8 views

Standardize images using ImageDataGenerator in keras

I was trying to normalize my input data images for feeding to my convolutional neural network and wanted to use standardize my input data. I referred to this article: https://stackoverflow.com/...
2
votes
0answers
26 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
63 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 ...
1
vote
0answers
29 views

Are there any tools I can use to debug a Keras LSTM model during prediction?

I want to be able to debug my Keras LSTM model. For example, I want to be able to check the values of the input/output gates, cell states and hidden states at every time-step during prediction. Are ...
1
vote
0answers
33 views

What are the pros and cons of Keras, PyTorch and Caffe for computer vision?

I have tried to get the basic grasp of the following deep learning frameworks with python: Keras Pytorch Caffe However, I have lately noticed that people in the computer vision community care less ...
0
votes
1answer
54 views

Indexing tensors in custom loss function with Keras

I'm using a custom loss function in Keras. This is the function: ...
0
votes
0answers
12 views

Keras MLP returns always loss 0.0

I'm implementing a multilayer perceptron with Keras to predict the correct words order in a sentence. I'm using train_on_batch()because I convert each sentence in a ...
1
vote
1answer
30 views

Hand-Signs Recognition using Deep Learning Convolutional Neural Networks

I am developing a CNN model to recognize 24 hand-signs of American Sign Language. I have 2500 Images/hand-sign. The data split is: Training = 1250 Images/hand-sign Validation = 625 Images/hand-sign ...
1
vote
0answers
31 views

Does this tutorial use normalization the right way?

There is this video on pythonprogramming.net that trains a network on the MNIST handwriting dataset. At ~9:15, the author explains that the data should be normalized. The normalization is done with ...
0
votes
1answer
35 views

LSTM implementation in KERAS

I would like to build an LSTM to predict the correct words order given a sentence. My dataset is composed of sentences, where each sentence has a variable number of words (each word is embedded). The ...
1
vote
0answers
9 views

Generation of realistic real-valued sequences using Wasserstein GAN fails

My goal is to generate artificial sequences of real-valued data (e.g. time series) with GANs. Starting simple I tried to generate realistic sine-waves using a Wasserstein GAN. But even on this simple ...
0
votes
2answers
44 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 ...
0
votes
0answers
25 views

How would I go about performing a single step of gradient descent on this model?

I have a classification model that consists of a CNN followed by an SVM. I used the Keras library for the CNN portion and sklearn for the SVM portion. I am assuming I will have to fiddle with the ...
30
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 ...
2
votes
1answer
350 views

Tensorflow-gpu cannot use Nvidia GPU with CUDA

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 ...
1
vote
0answers
10 views

How do I build a multi RNN network with keras?

I have 2 (independently long) sequences (a and b) of feature vectors that I want to use as input for a neural network. The idea was to build 2 GRU based encoders (one for each sequence). I would than ...

1
2 3 4 5