Questions tagged [keras]

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

Filter by
Sorted by
Tagged with
34
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.
0
votes
0answers
7 views

Multiple digits classifier using MobileNetV1

I want to train a model to be able to classify 16 number of digits in image, the numbers of digits are constants. So I create my dataset like these images (Print random 16 number with different font ...
0
votes
0answers
7 views

How does keras `train_on_batch` return value work?

From the doc, train_on_batch() will return a scalar representing the loss and the metric. I want to know whether the loss/metric is evaluated before the weight is ...
0
votes
1answer
42 views

TF Keras: How to turn this probability-based classifier into single-output-neuron label-based classifier

Here's a simple image classifier implemented in TensorFlow Keras (right click to open in new tab): https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/quickstart/...
3
votes
1answer
30 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. ...
4
votes
1answer
95 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....
1
vote
1answer
144 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
25 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 ...
1
vote
1answer
29 views

Tensorflow and Keras model having same parameters, hyperparameters, weight and bias initialization give different accuracy? [closed]

I have made sure that layers,parameters, hyperparameters,kernel_initialization, bias_initialization, seed and dataset are all equal. But still the output for both the models are different. ...
1
vote
1answer
38 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 ...
1
vote
0answers
24 views

How to get same accuracy with identical models in Keras and Tensorflow?

As we all know Keras backend uses Tensorflow and so it should give out same kind of results when we provide same parameters, hyper-parameters, weights and biases initialisation at each layer, but ...
4
votes
0answers
34 views

Transformer: Position-wise Feed-Forward network

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 ...
0
votes
0answers
12 views

Make an LSTM model for each class separately

I have a dataset of some activities. The dataset contains the status of different sensors and the label of activity. T trained a model in Keras with the following architecture which models the ...
0
votes
1answer
46 views

LSTM in reinforcement learning

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,...
0
votes
0answers
7 views

Looking for the right type of 1D-Convolution that only considers one column/attribute

My input has the shape of n rows (time steps) and m columns (attributes). I want to train a convolutional neural network on it to predict a class. I am currently using 1D-Convolutions. I got a good ...
0
votes
3answers
89 views

Accuracy too high too fast?

I have a simple text classifier, with the following structure: ...
2
votes
0answers
15 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 ...
0
votes
1answer
53 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 ...
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 ...
2
votes
1answer
39 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-...
0
votes
1answer
49 views

Why do I get a straight line as an output from a neural network?

I am using feedforward neural network for regression and what I get as a result of prediction is a constant value visible on the graph below: Data I use are typical standardised tabular numbers. The ...
2
votes
1answer
372 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 ...
2
votes
1answer
261 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 ...
1
vote
1answer
27 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?
0
votes
1answer
18 views

Create optimizer object using the tf.keras.optimizers.get function

I am trying to have the type of optimizer as a variable in the hyperparameter tuning phase. For that reason I am trying to use the tf.keras.optimizer.get function ...
0
votes
2answers
95 views

Loss function spikes

For the UNSW-NB15 dataset i receive spikes in the loss function during training. The algorithms see part of this UNSW dataset a single time. Loss function is plotted after every batch. For other ...
1
vote
1answer
68 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 ...
0
votes
1answer
17 views

Is a trained model in keras is saved with the weights for max accuracy?

Does a model trained in keras (tensorflow backend) saves the weights with max accuracy and minimum losses or does it simply saves the weights from the last epoch? If it is the latter then how do I ...
1
vote
1answer
101 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 ...
1
vote
0answers
37 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, ...
1
vote
1answer
77 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 (...
1
vote
1answer
71 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 ...
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 ...
1
vote
0answers
18 views

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

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
1answer
40 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 ...
0
votes
0answers
31 views

Neural Network cannot learn nonlinear function

I am currently creating a neural network to learn a function of the following form I am using both keras and tensorflow and with both scripts I get the following result . Somehow my neural network ...
0
votes
0answers
31 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 ...
1
vote
0answers
36 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 ...
0
votes
0answers
12 views

Imbalance large dataset with keras using flow from directory

I want to detect dataset bias, and for that, the first approach is to build a model that can recognize from which dataset belongs an image. I am working with Python3, with limited computing and more ...
1
vote
0answers
51 views

Can I perform image recognition using a very small dataset?

I have 3 types of classes and I have 2 images of each object (or class). Can I perform image recognition using this very small dataset?
0
votes
1answer
39 views

Why does keras model get bigger after training?

I notice that I create a model using tensorflow.keras.Sequential(), save it and the file size is around 5 MiB, but after I call ...
0
votes
0answers
32 views

What to look for when CNN returns same prediction for every input?

I am trying to use a CNN to do a regression prediction on some statistical data. The data is time-series data formatted into a 2-D grid. The network I'm using looks like this: ...
0
votes
0answers
20 views

How to implement Multiple Neural network architecture, connected in parallel and series in Keras or Pytorch

Hello Dear StackExchange members, I want to make a deep network as shown in the image. I want each 'network 1 to look at the specific part of the input and I don't want to divide my input beforehand ...
1
vote
1answer
90 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 ...
0
votes
0answers
44 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 ...
-1
votes
1answer
64 views

Which is better to start deep learning and understand it in depth (and not just a simple overview) - pytorch or tensorflow 2.0?

I am beginning to learn deep learning. I recently spoke with an expert in the field. He suggested that I start with pytorch because of these reasons: Keras abstracts the stuff a lot that we will not ...
0
votes
0answers
15 views

Issues related to RoI Pooling in keras

I am trying to do RoI pooling of an image whose RoI bounding box coordinates are known to me. Can anyone provide me the code for doing the same? I have read many repositories but I didn't get any ...
0
votes
0answers
23 views

Custom optimizer and word-vector evaluator lstm

I’m using Keras LSTM layers and building a model that is trained off ethics text. I have a problem of often over fitting (the network basically remembers my input corpus as it is very small). I was ...