Questions tagged [keras]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
59 views

What is the best approach for multivariable and multivariate regression?

I want to build a multivariable and multivariate regression model in Keras (with TensorFlow as backend), that is, a regression model with multiple values as input (multivariable) and output (...
1
vote
0answers
28 views

How to perform regression with multiple numeric (positive and negative) inputs and one numeric output?

I have a dataset with different types of numerical values (both negative and positive numerical values) for the inputs (for example, -40, -35, 1, 25, 39, etc., that is, multiple inputs) and single ...
1
vote
0answers
19 views

Applying Machine Learning to 2D Laser Scanner Data

We are using 2D Laser Scanner to scan various objects of different geometric shapes for e.g. cylinder, spiked, cylinder with notch, cylinder with curved edges e.t.c. The dataset contains points in the ...
2
votes
1answer
81 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 ...
1
vote
1answer
63 views

Which model can I use for this problem with multiple inputs and outputs?

Which model is the most appropriate for this problem with multiple inputs and outputs? The data set is A1, A2, A3, A4, A5, A6, B1, B2, B3, B4 where ...
0
votes
0answers
34 views

How to get layers outputs during training at each mini-batch? [closed]

The method model.fit() is used to train the neural network. How can I get the output from any hidden layer during training?
2
votes
1answer
27 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 ...
0
votes
0answers
20 views

How to use keras.utils.Sequence with multiple files [closed]

I am looking at the documentation and this guide https://www.tensorflow.org/api_docs/python/tf/keras/utils/Sequence https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly And I ...
1
vote
0answers
7 views

Keras correlation coefficient as network metric in R

does anyone know how to use the correlation coefficient or squared correlation coefficient as a metric in keras in R (although other languages may provide clues). This is for a CNN that functions ...
1
vote
0answers
22 views

How to change the architecture of my simple sequential model

I'm new to Deep Learning with Keras. With some tutorials online for cat vs non-cat classification, I was able to compile this simple architecture for my own ...
0
votes
0answers
13 views

Model training with colored images instead of grayscale

I'm new to Python and Deep Learning with Keras. With some tutorials online for cat vs non-cat classification, I was able to compile this simple training code for my ...
2
votes
1answer
36 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 ...
0
votes
1answer
28 views

Techniques and semantics in better training of deep learning models

I'm relatively new to Deep Learning, and trying various models and datasets using Keras. I'm starting to love it! Through-out my experimentations, I have come into ...
2
votes
1answer
32 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
39 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
49 views

What is the fastest way to train a CNN with billions of examples?

I have a CNN model that I need to train for a large scale genomics application. It is working well with a subset of my training data. I have scaled up to a subset of about 130 million examples and ...
1
vote
1answer
13 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
54 views

How can I increase the speed and performance of my implementation of an AI for Reversi?

I made an AI for Reversi, aka Othello (8×8), like Alpha Zero, using this book. This book is written in Japanese. The source code of the AI I implemented can be found in this Github repository. There ...
5
votes
1answer
58 views

How do I combine models trained on different data to increase classification accuracy?

I have two trained models. One is using a LinearSVC algorithm and is trained on numerical data from medical examination from patients with diabetic retinopathy. The second one is a neural network ...
2
votes
0answers
42 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
2answers
379 views

How to implement word2vec using Tensorflow 2.0 keras API?

Since Keras API as defined as layers, how would it be used to implement the word2vec?
3
votes
2answers
28 views

Using a neural network to identify a stable region within a set of data?

I am working on a problem in which I am attempting to find a stable region in a spiral galaxy. The PI I'm working with asked me to use machine learning as a tool to solve the problem. I have created ...
0
votes
0answers
7 views

How to set loss weight to zero for an output dimension in keras?

Suppose I am training a model to detect facial keypoints that allow occlusions to be present. The input is an image of a face, and the model has to predict the x,y coordinate of both eyes and mouth. ...
1
vote
0answers
17 views

How we can keras.Imagedatagenerator from csv file? [closed]

How we can use Imagedatagenerator to produce images if we have a folder with a name "train" which contain all the images of every classification( folder contains mixed images). And we have one csv ...
1
vote
0answers
19 views

How to implement CNN with variable number of images in tensorflow or keras?

Suppose I have a problem where I want to classify the color of LEDs seen in the image. I can use OpenCV to pinpoint the exact location of these LEDs but I do not know their color for sure because the ...
6
votes
0answers
101 views

Why would you implement the position-wise feed-forward network of the transformer with convolution layers?

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 ...
2
votes
1answer
18 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
1k 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
1answer
25 views

How can we print weights per iteration in a simple feed forward MLP for an specific class?

im working on a project in which I have to make a multi-layer perceptron with two hidden layers with 3 nodes in each. The target value in my data contains 8 unique values/classes. One of the tasks ...
0
votes
0answers
19 views

Why is the value range of my LSTM model's prediction different from my test labels?

I am using LSTM to do time-series anomaly detection. The data is an hourly sensor input across multiple years (i.e. the global_active_energy attribute of the dataset from https://www.kaggle.com/uciml/...
1
vote
1answer
105 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,...
35
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
28 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
48 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
42 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
103 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
149 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
31 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
36 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
39 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 ...
0
votes
0answers
14 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
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
96 views

Accuracy too high too fast?

I have a simple text classifier, with the following structure: ...
2
votes
0answers
16 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
55 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
43 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
53 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
388 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 ...