Questions tagged [keras]

Open source high-level neural network library for Python and R. Is capable of using TensorFlow or Theano as backend.

Filter by
Sorted by
Tagged with
0 votes
0 answers
25 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
48 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
12 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
10 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
  • 233
0 votes
0 answers
20 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
73 views

The loss of VAE is negative. is it normal?

the function loss of VAE is : ...
Ramzy's user avatar
  • 11
0 votes
0 answers
19 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
41 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
31 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
190 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
14 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
21 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
57 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
0 answers
14 views

Input shapes for multiclass LTSM classification model in tensorflow

I am building a classifier for 7 classes where my array shapes are as follows: ...
Maria Bruevich's user avatar
0 votes
0 answers
16 views

Effect of batch normalization after input layer on model performance

I built a ML model with high accuracy using ...
s28's user avatar
  • 11
0 votes
1 answer
57 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
20 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
147 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
0 votes
1 answer
1k 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
  • 1
2 votes
2 answers
160 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
0 answers
17 views

Why are my deep learning models giving unreasonably high accuracy on test data?

I'm trying to do sarcasm detection on Twitter data to replicate the results mentioned in this paper. Binary classification problem. For that I used a separate set of unlabeled tweets to create the ...
Debbie's user avatar
  • 119
0 votes
0 answers
180 views

Managing Missing Values in LSTM Time-Series Model using Keras Masking Layer

I am currently working on developing an LSTM model using six time-series data as an input with the objective to predict one of them. However, the data contains missing values that need to be addressed....
mqq5's user avatar
  • 1
0 votes
1 answer
152 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
0 votes
1 answer
497 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
430 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
25 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
782 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
  • 511
0 votes
1 answer
995 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
4 votes
1 answer
1k 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
  • 141
0 votes
0 answers
68 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
497 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 ...
Héliton Martins's user avatar
1 vote
2 answers
847 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
345 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
100 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
193 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
257 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
32 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
152 views

Understanding keras layer structure/notation

I am trying to understand the following keras model: ...
user1886681's user avatar
0 votes
0 answers
75 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
0 votes
1 answer
50 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
334 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
147 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
549 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
0 votes
0 answers
49 views

Validation performance is really problematic; should I give up on increasing the validation performance of my deep learning model? [duplicate]

I am working on a multiclassification problem using time series data. Three datasets are utilized in this study. My deep neural network performs satisfactorily across two different data sets. However, ...
Ahmad's user avatar
  • 161
0 votes
0 answers
56 views

Neural network loss not dropping to expected levels

I am attempting to create a neural network that can learn to evaluate chess positions. I'm following along with this paper and trying to recreate its results. The general idea is to have the NN ...
achandra03's user avatar
0 votes
0 answers
996 views

Proper masking in MultiHeadAttention layer in Keras

I am new to Transformers and I am trying to create a very simple model (not NLP area) for processing data of variable length (not sequence data because for my problem order in data does not matter). ...
antivujo's user avatar

1
2 3 4 5
14