Skip to main content

Questions tagged [keras]

Open source high-level neural network library for Python and R. Uses TensorFlow as backend.

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

Quantification of Leaf Disease with Semantic Segmentation

I am trying to quantify leaf disease using dataset of original images and corresponding masks. I have two approaches in my mind: Train-Test model for Semantic Segmentation of Leaf and diseased region ...
Urwa Shanza's user avatar
2 votes
1 answer
22 views

What would be the convolutional layer output by keras.layers.Conv2D when conv output is fractional?

I have input ($n=224$), strides ($s=4$), filter size ($k=11$) and no padding which gives me a fractional conv output: $$\texttt{conv output} = (n-k+2p)/s + 1 = 54....
Shri's user avatar
  • 23
0 votes
0 answers
7 views

How to train with convLSTM2D on variable input shape?

I am classifying time series of 72x72 images in 4 filters (just like RGB). Things work well ...
user43280's user avatar
  • 101
0 votes
0 answers
15 views

How to use Conv2D for make predictions on spatio-temporal data (non-image)?

I have multivariate time series data consists of 4 independent variables, 1 dependent variable (target variable), and spatial data (latitude and longitude). The data is taken from 5 different cities, ...
Riri Ana's user avatar
0 votes
0 answers
26 views

Is it possible to train a neural network to feed into a Random Forest Classifier or any other type of classifier like XGBoost or Decision Tree?

I want to create a model architecture to predict future stock price movement as such: The Goal of this model is to predict if the price will go UP or DOWN within the next 3 months. I have tried a few ...
Evank's user avatar
  • 1
1 vote
0 answers
7 views

Image classification metrics

I have been working on an image classification task using CNNs and getting some puzzling results. My training, validation and test loss keep going down with epochs and are comparable. So this might ...
Nithin's user avatar
  • 11
0 votes
0 answers
22 views

How to modify my classification neural net with keras to improve accuracy? [duplicate]

I am trying to build a neural net to predict binary output [0,1]. I have a pretty small dataset 600 samples, 200 of them label 0, 400 of them label 1. I have 23 features, some of them are ...
Anna Svirshchevsky's user avatar
0 votes
0 answers
29 views

Pre-trained CNN models for high resolution images

I am trying to fine-tune a model with my dataset using Keras. However instead of using the default input shape (224 x 224 x 3) for almost all of the available models, I want to set the input shape as ...
Berk Çam's user avatar
0 votes
0 answers
53 views

How to detect small details in high resolution images using CNNs?

I have the goal of training a CNN model that can detect if clothing items has any defects (holes, stains etc.) on them. I am using Keras to accomplish this. I will use the model for image ...
Berk Çam's user avatar
0 votes
0 answers
19 views

Time Series Prediction for Variable-Length Input with Fixed Sampling Period

I'm working on a time series prediction task where I need to predict the parameters (amp, phase, freq, offset) that best fit a variable-length input series. The samples are always at the same period. ...
Andrea Arlotta's user avatar
0 votes
0 answers
11 views

Model's training highly dependent on weights initialitation. How to deal with it?

I am training a simple RNN model in keras to predict a time series. The time series I am considering is just a sine function $$ f(t) = \sin \left(\frac{3}{10}t\...
apt45's user avatar
  • 273
0 votes
0 answers
24 views

Trained network always predicts zero [duplicate]

I have an encoder model and I'm training it with a dataset of signals with size (500,1). The data set is normalized and then used to train the model but the problem is that after the model is trained, ...
rrSep's user avatar
  • 1
1 vote
1 answer
199 views

The loss of VAE is negative. is it normal?

the function loss of VAE is : ...
Ramzy's user avatar
  • 21
0 votes
0 answers
21 views

Keras Implementation of a neural network found on a paper

I am trying to implement a neural network I found on an open access paper as I have a similar problem and I am struggling with it. I am using tensorflow.keras for the implementation. Here is the paper:...
Francesca Borrelli's user avatar
0 votes
1 answer
55 views

Creating a CNN model for multi-output prediction where one target variable is categorical, and others are numeric

I want to create a simple CNN model for multi-output prediction. The predicted values are four numeric values (all between 0-1) and one categorical value (4 classes). When I try to create a model ...
Dkasi's user avatar
  • 1
1 vote
0 answers
32 views

Neural Network ReLU majority of weights small

When I view a histogram of my weights it is very much centred at 0, with the overwhelming majority being very small. I want to ensure I do not have a vanishing gradient problem. I must preface this ...
Governor's user avatar
  • 125
0 votes
1 answer
316 views

Why not use input padding in the first attention block in transformer decoder

I was studying the transformer decoder code below in Keras/Tensorflow. It was not clear how they made making decisions. In the first attention block below (self.attention_1), why did they use ...
Chika's user avatar
  • 1
0 votes
0 answers
16 views

How to adjust the scaling of the new data while use Incremental training of a neural network?

I am planning to use incremental training of my neural network model since I continually get new data and at present retrain the model after a period of time but the training window shifts forward. To ...
user62198's user avatar
  • 109
0 votes
0 answers
27 views

Assistance with LSTM Keras model for predicting heart rate from velocity

Good Morning, Currently, I'm new to Kears and neural networks in general. I'm working through Deep Learning In R With Keras with a 'capstone' project in mind, but I'm struggling to understand how to ...
Jordan Webb's user avatar
1 vote
0 answers
14 views

Predicting new timeseries based on related timeseries?

Let's say I have multiple timeseries, representing different features, all of length n, and I want to predict a new timeseries which represents another feature, without any past history for that ...
Theo's user avatar
  • 111
1 vote
0 answers
73 views

Adam optimiser strange behaviour on first epoch if using EMA

In the first training epoch, the Adam optimiser seems to reset the weights of my model if I have use_ema=True. I am compiling a keras model and loading weights from a file using ...
ThreeOrangeOneRed's user avatar
0 votes
1 answer
154 views

How do I determine the output dimension of my input layer?

I'm building a keras model for a binary classification. ...
s28's user avatar
  • 11
1 vote
0 answers
21 views

Create different model architectures in loop [closed]

I'm building a NN using keras and I'd like to build different architectures. My question: Can I create several models with a different number of layers at once? (e.g. using a loop). It should be ...
s28's user avatar
  • 11
1 vote
0 answers
213 views

Keras RMSProp what is the alternative to "decay" (no longer available after Keras 2.3)

Background: Hello, I'm creating a GAN with an RMSProp optimizer for both discriminator & generator. The generator model has half the learning rate of the discriminator (1e-4) and half the decay of ...
carsof's user avatar
  • 11
1 vote
1 answer
2k views

Is it ok to have low validation loss from the first epoch?

I'm trying to implement Neural Collaborative Filtering recommender system using Keras, the dataset I'm using is movielens-small. Whatever I do to hyperparameters or network, when training, the ...
alexr's user avatar
  • 11
2 votes
2 answers
257 views

Binary input variables for a Keras Neural Network

I have a set of forty predictors each of which are binary. I’m using elastic net logistic regression in addition to a random forest Is there any reason why you could not use binary inputs for a Keras ...
Englishman Bob's user avatar
0 votes
1 answer
197 views

RNN/LSTM networks on spectrograms underfitting massively - is the CNN encoder a prerequisite?

I am prototyping a pipeline on the FSDD dataset (audio/10-class classification); the audio data are loaded with librosa, 0-padded/trimmed to 0.5 sec (4000-dimensioned numpy vectors) each and converted ...
Nikos H.'s user avatar
1 vote
1 answer
627 views

How to calculate the decay rate given an initial learning rate and final learning rate for schedulers when training neural networks?

I am training a neural network in TensorFlow and I would like to use firstly an exponential decay optimizer scheduler (https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/schedules/...
user380572's user avatar
0 votes
0 answers
505 views

F1 score for validation and testing datasets is different

I have the following F1 score function that I use for the model when I train it as part of metrics and as well during prediction: ...
Avv's user avatar
  • 249
1 vote
0 answers
27 views

Much better results when standardizing features to train LSTMs

I have a data set of time series. Each time series represents trajectories of the same path taken. So, the time series captures acceleration in $x$, $y$ and $z$ direction, respectively for the ...
Invader's user avatar
  • 11
2 votes
1 answer
1k views

How to generate new data with a VAE?

I have built the following function which takes as input some data and runs a VAE on them: ...
quant's user avatar
  • 521
0 votes
1 answer
1k views

Single input - multiple outputs with different loss functions in Keras: how is the gradient computed?

I've implemented a neural network with single input - multiple outputs using Keras API. The general structure of the network is like in this figure: Because each branch does a different task, I ...
Elise Le's user avatar
6 votes
1 answer
2k views

How to determine if two images contain the same object without a dataset?

The problem I am trying to solve is, given two images, determining whether they contain the same object or not. Here is an example: The first two images contain the same object, while the third image ...
NoahGav's user avatar
  • 161
0 votes
0 answers
86 views

Predict angle by linear loss

I'm trying to solve following nonlinear regression task: We got fixed point from which the bullet is released with some start speed v0 (value v0 changes each time). On the opposite side we generate ...
franz-german's user avatar
-1 votes
1 answer
692 views

Scikit-learn and Keras' MLP very different with same hyperparameters

I'm using Multilayer Perceptron ANNs at the very beginning of my project (it's a binary classification problem). Because it's simpler, I started with Scikit-learn. I got a magic result, with my model ...
Heliton Martins's user avatar
1 vote
2 answers
990 views

Why does a neural network trained with random data and fixed initialization have different weights between runs?

I wrote a simple code that creates a neural network with two dense layers and then trains it. In this code, the initial coefficients of each layer are fixed. Why do the answers change every time? (In ...
Hamed's user avatar
  • 11
0 votes
0 answers
55 views

Why am I obtaining values close to zero when using a NN for regression? [duplicate]

Here is the dataset. I tried converting this implementation into its analog with Keras. Why are my predictions SO bad? They are almost always close to a single number. Doesn't matter if I use more ...
Caterina's user avatar
  • 229
0 votes
0 answers
14 views

Imbalanced binary classification results discussion

Hello I'm wondering how do you consider these result For binary classification with class imbalance.(84% to 16). Accuracy 96 Precision 94 Recall 80 F1 86 Roc_auc 98
Yassine's user avatar
0 votes
0 answers
377 views

Multilabel Classification: Accuracy is very low. Metric or Model, which is inadequate?

In my multilabel classifaction problem, which I approach similarly to what can be see in this post: How does Keras handle multilabel classification?, the resulting accuracy only increases from 2% to 5%...
Viktor's user avatar
  • 101
1 vote
1 answer
117 views

Keras Prediction one step beyond

I am trying to make time series forecasting with keras. Has any one observe the phenomenon where the model can predict the next value after the current (the one that should predict)? If in fact I move ...
gbarel's user avatar
  • 21
1 vote
1 answer
215 views

Loss Function for Binary Classification with Multiple Correct Choices

I have a binary classification problem, where there are multiple correct predictions, however, I would consider the prediction to be correct if the highest confidence prediction of a 1 is correct. I ...
John Meighan's user avatar
1 vote
0 answers
267 views

Is it possible to do feature selection within the Keras deep learning framework? [closed]

I know most people perform feature selection running RFE on a linear regression model, for example, BEFORE training the model with Keras. However is it possible to do it within the training procedure ...
Caterina's user avatar
  • 229
1 vote
0 answers
33 views

What are the differences between AdaDelta and RMS prop in Keras (if any)? [duplicate]

I have read many references which suggest that RMSprop and Adadelta are basically same, just developed independently. However, Keras has two different classes for it. Also, it allows RMS prop to have ...
Anomalisa's user avatar
0 votes
1 answer
167 views

Understanding keras layer structure/notation

I am trying to understand the following keras model: ...
user1886681's user avatar
0 votes
0 answers
91 views

How can reduce improve my ANN accuracy and reduce overfitting?

My ANN model produces classic overfitting characteristics, producing high R2 values (90-99%) but low accuracy scores (10-40%). I'm currently inputting 28655 data entries, using 8 input features to ...
user avatar
1 vote
1 answer
57 views

Learning stochastic pattern using RNN

I have a pattern of count time series of vehicle demand as shown below.The time series is generated as follows: Categorical Random Variable, x = {0,1,2} and p(x) = {0.6,0.3,0.1} low vehicles = 1 + x , ...
Jose_Peeterson's user avatar
0 votes
0 answers
347 views

High validation accuracy and training accuracy but low test accuracy

I have a LSTM model that has good training accuracy(~90%) and excellent validation accuracy(> 95%) but it gives poor results when I test it on data it hasn't seen. I am training hyperparameters ...
crossword's user avatar
3 votes
1 answer
169 views

Best hyperparameter is not consistent among different seeds

I do hyper-parameter tuning on my network and it outperforms the simple classifier. The difference in classification is considerable after hyper-parameter tuning. But, the problem is that an optimal ...
Mor Mory's user avatar
3 votes
2 answers
3k views

Using "X_test, y_test" as validation data on Keras

I was looking at some examples on how to use Keras for Regression and I came acrossed some tutorials that used X_test and y_test as validation data and then use them again at .predict. ...
Ad Astra's user avatar
1 vote
1 answer
669 views

Sequential Binary Imbalanced data classification with LSTM

I'm building an LSTM sequential Binary Classification Model, the data is highly imbalanced like say Fraud detection case. After building an LSTM model on Sequential Vectorised data, I'm getting a very ...
Jagrut Panchal's user avatar

1
2 3 4 5
14