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
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. ...
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
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 ...
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 ...
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 ...
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
3answers
89 views

Accuracy too high too fast?

I have a simple text classifier, with the following structure: ...
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 ...
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
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,...
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 ...
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 ...
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
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
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
1answer
36 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:- ...
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 ...
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 ...
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 ...
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 ...
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
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: ...
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
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 ...
1
vote
0answers
29 views

Keras CRNN implementation with multiple input images

Hello I am trying to implement a CRNN with multiple input images (in my context it is 6 images) This is a regression problem and output is two real value. And for the CNN block I am thinking of using ...
2
votes
1answer
654 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?
0
votes
0answers
24 views

Why such a big difference in number between training error and validation error?

Question Why such a big difference between my 'Train loss' and 'Validation loss' as shown in the picture below? Is it a signal that my codes are wrong and my trained network is wrong as well? Some ...
0
votes
1answer
24 views

Intermittent type error when operating CNN inside Docker container

I've been working on a simple computer vision API with a few endpoints for grabbing useful information from ebay images. The API lives in a docker container that looks for the h5 files, downloads ...
0
votes
0answers
43 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 ...
1
vote
0answers
51 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
14 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 ...
0
votes
1answer
23 views

What type of network for a repeated experiment

good day 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 ...
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 ...