Questions tagged [keras]

Keras is a popular, open-source deep learning API for Python built on top of TensorFlow and is useful for fast implementation. Topics include efficient low-level tensor operations, computation of arbitrary gradients, scalable computations, export of graphs, etc.

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

Loss NaN and accuracy not increasing for categorical problem

I'm trying to approximate age from photos into categories. Basically number 1 represent infants, number 2 teenegers etc.. so I am solving a categorical problem. However, my model is not working ...
1
vote
1answer
4 views

Dimension error when tuning LSTM layer

I am working on a sentiment analysis problem which is a binary classification. These are some of the parameters that might be useful: 1.) Length of train list = 203 2.) Length of test list = 51 3.) ...
0
votes
0answers
17 views

Normalizing images with OpenCV (divide by 255)

I'm loading images from my dataset, which are all of resolution 200x200 and in RGB format. I'm loading them using OpenCV for Python, with the following code: ...
0
votes
1answer
23 views

Need help understanding how this Neural Network is working

This is a model I came across, and I need some help understanding how it works It uses South German Credit Prediction data set from Kaggle ...
0
votes
1answer
10 views

Input- and Output Data Shape Difficulty

I'm a Keras beginner. My main problem right now is how to build a model that suits my data. For the Model itself I'd like to build it so the inputs/outputs are: Input Data: (List that contains) three ...
0
votes
0answers
13 views

Keras Adam Optimizer minimize function: no gradientes provided

I need to optimize a function with Adam Optimizer (no Neural Network involved). I made a dummy example to understand how it works, using the minimize function but ...
0
votes
0answers
10 views

How to stack Transfer Learning models in a Sequential

To make a nice architecture, I wanted to stack Transfer Learning models one over the other. The three models I wanted to stack were : VGG16 InceptionV3 Resnet50 So, I defined the three models as ...
0
votes
0answers
23 views

Adding a static layer to LSTM text generation

I am using Tensorflow guide to build a LSTM text generation model (uses the keras functional API) (https://www.tensorflow.org/text/tutorials/text_generation) I would like to add an additional input ...
0
votes
0answers
11 views

TensorFlow Speech Emotion Recognition Model gives same prediction for all inputs

Dataset used: RAVDESS (I've only used the audio only files) Here's a sample after I've processed the data: And the code for the label encoding: ...
0
votes
1answer
22 views

model.predict gives the same output for all images

I am trying to create a model using resnet50 to classify ct scan images as covid or not. However when using model.predict with a given image its giving the exact ...
0
votes
1answer
7 views

keras: what do we do when val_loss and loss differ markedly?

I am new to Deep learning. I want to understand when it is a good time to stop training and the tweaks that should be made. Thank you. 1) I understand that if val_loss increases but val is flat, we ...
0
votes
1answer
15 views

Running model.fit multiple times for an LSTM?

I have time-series histogram data from many separate machine runs (see this post for detail). I am working to train an LSTM in order to predict the final histogram in a machine run based on the past ...
0
votes
0answers
12 views

Keras CNN -Identify Non-Related Images

I have a CNN classification problem, where the 2 classes are mutually exclusive. I am using Keras keras.losses.BinaryCrossentropy(from_logits=False) and I am ...
0
votes
0answers
15 views

How to extract attention weight from MultiHeadAttention layer in Keras?

How to extract attention weights from MultiHeadAttention layer in Keras? With the attention weights, I hope to plot attention heatmaps.
3
votes
1answer
499 views

Which method is more suitable? overfitting of traning data or low accuracy?

Recently, I tested two methods after embedding in my data, using Keras. Convolution after embedding Maxpooling after embedding The first method's loss and validation loss are like, The second ...
0
votes
0answers
12 views

Keras CNN low training and val acc

I don't what is wrong with my current network architecture maybe some of you can help. I have a dataset that is highly imbalanced so i have implemented a datagenerator which balances the image data so ...
0
votes
1answer
35 views

How to calculate a single accuracy for a model with multiple outputs in Keras?

Consider the following, rather simple, model: ...
0
votes
1answer
21 views

Conv2d for image with additional features as input layer

I would like to train a model with Keras and TensorFlow. My input consists of images and some additional features. I would like to use conv2d for the images and dense for the other inputs. The ...
0
votes
0answers
17 views

What is the difference between batch, batch_size, timesteps & features in Tensorflow?

I am new to deep learning and I am utterly confused about the terminology. In the Tensorflow documentation, for [RNN layer] https://www.tensorflow.org/api_docs/python/tf/keras/layers/RNN#input_shape <...
0
votes
0answers
9 views

RNN Input Shape: Is the 1st Dimension the number of Batch or the Batch Size?

I am new to Deep Learning. I read different explanation of the input shape for the 1st layer. This explanation seem to imply the 1st D is the Batch Size: ...
1
vote
1answer
19 views

Keras: How to restore initial weights when using EarlyStopping

Using Keras, I setup EarlyStoping like this: EarlyStopping(monitor='val_loss', min_delta=0, patience=100, verbose=0, mode='min', restore_best_weights=True) When I ...
0
votes
1answer
28 views

Keras: How to define input shape for 1st DENSE layer?

I am new to deep learning & keras. Refer to below code. I don't understand why yhat differs when I define the 1st layer input shape as 'input_shape' vs 'input_dim'. yhat should only be (1,1) - a ...
0
votes
2answers
21 views

How does Keras Tokenizer choose tokens given a sentence?

I tried to find the answer to this question but I can't find anything, so I ask here: How does Keras Tokenizer choose tokens given a sentence of words ? To be more precise with what I want to know, ...
0
votes
0answers
18 views

What is leaking rate?

I am implementing an echo state network using TensorFlow and am studying the parameters, one of which is called "leaky". The documented definition is as follows: Float between 0 and 1. ...
0
votes
1answer
38 views

How to perform regression on image data using Tensorflow?

Overview I understand the surface of the mathematics* of simple neural networks. I went through single label image clasification problems (ie using MNIST & fashion-MNIST datasets) using native ...
2
votes
0answers
120 views

How to use the keras.layers.AdditiveAttention correctly?

My understanding on the topic is superficial at best, so do bear with me. I have a couple questions (specifically on how to use keras.layers.AdditiveAttention) which I hope is suitable to be asked ...
0
votes
0answers
5 views

Reference code for LSTM Variational Autoencoder for dimensionality reduction

I have time series data, with many features. I would like to reduce the dimentionality by using LSTM VAE. Does anybody know an example code or a reference to guide me to impolement it? Both Pytorch ...
0
votes
0answers
6 views

model loss is less but prediction is wrong

I have 100 samples having following data ...
0
votes
0answers
17 views

NN regression model predictions incomprehensible

I'm trying to build a deep learning regression model for price prediction of AirBnB listings. As a baseline, I started with a simple 3-layer NN as follows: ...
1
vote
1answer
35 views

should text augmentation take place before or after splitting the dataset?

I've a text dataset with ~20000 samples (which is not enough). I used text augmentation to "invent" more samples so essentially I've multiplied each sample by 10 - ending up with ~200000 ...
0
votes
0answers
27 views

Model weights not updating on the higher layers

I would like to use a feedforward NN with 3 sigmoid hidden layers to demonstrate the vanishing gradient problem. I used the Pima dataset containing 8 features and it is binary classification task. I ...
0
votes
0answers
11 views

LSTM Multiple Independent Input Time Series - Data Preprocessing

Given a single univariate time series of complexity say 5, look-back of 2 and forecast of 1 the generated samples would be: TS = [ 1 , 2 , 3 , 4 , 5 ] xTrain = [ [1,2] , [2,3] , [3,4] ] that gets ...
0
votes
0answers
15 views

Update deep learning model with a new class and data for that class

I wanted to create a deep learning model with Keras capable of continually updating, but I do not want to retrain the model on the whole dataset, only on the new data. That is: if for example ...
0
votes
0answers
17 views

Variational autoencoder for time series denoising and dimentionality reduction

I have a dataset X of multiple series say 100 (size=100). I would like to use VAE to both denoise the data and reduce the dimensions to a smaller latent space Z (size Z << size X), because I ...
1
vote
0answers
60 views

Keras model prediction always has unwanted offset

I am trying to predict next 10 days by looking into the last 60 days. So tried to implement an LSTM layer. Before jumping into the question, I want to clarify a few points. Firstly, this is a Multiple ...
0
votes
0answers
20 views

Using Validation Set in Transfer Learning for Feature Extractor Preprocessor

I have a set of images of products. I am using transfer learning for images feature extraction in this way : I load a model (res-net, vgg) I add 2 dense layers, first one will be my features and the ...
0
votes
0answers
30 views

Batch size and steps per epoch

My data size is 6011, which is a prime number, and therefore, the only batch size number that divides this data evenly is either 1 or 6011. However, I need the batch size to be 32, which means that ...
0
votes
0answers
25 views

Keras: Predict a combination of categorical and continuous variables

The output I am trying to predict with my keras model contains a mixture of continuous and categorical variables. How do I design the architecture to simultaneously predict continuous and categorical ...
0
votes
1answer
65 views

Which Keras metric for multiclass classification

I have a multiclass classification data where the target has 11 classes. I am trying to build a Neural Net using Keras. I am using softmax as activation function ...
0
votes
1answer
20 views

Issue with sarcasm detection

I am working on the Reddit dataset for sarcasm detection but the sarcastic data points(1) are showing zero percent recall, precision, and accuracy however nonsarcastic are showing 100% recall and 50 ...
0
votes
0answers
22 views

Deep learning - edge detection

I am trying to build a model, which would be used for edge detection of the iris. For this purpose, I have built a U-net model, which successfully works for image segmentation tasks. Also, I have a ...
0
votes
0answers
36 views

Multi-task learning for improving segmentation

I am building a multi-task model, where my main task is segmentation and my auxiliary task is either denoising or image inpainting. The goal is to try to improve the quality of the segmentation with ...
0
votes
0answers
9 views

Appropriate loss function and metrics for regression task with mixed outputs

I'm trying to train an EfficientNet-based Keras model that takes an image as input and returns two numeric values as output. Here's the model: ...
2
votes
1answer
32 views

Fashion MNIST: Is there an easy way to extract only 1% of the data to do a minimal gridsearch?

I am trying implement several models on the fashion-MNIST. I have imported the data according to the tf.keras tutorial: ...
0
votes
0answers
9 views

Need some ideas for specified ML task

So I got many boxes and every box may contains many items (from 1 to 50), for example: Box1 : ball, small ball, table, table Box2 : golden ball Box3 : tea Box4:: t-shirt, t-shirt2 ... For chosen box I ...
0
votes
0answers
18 views

custom convolutional layer in Keras but model.predict() fails

I've developed a custom convolutional layer. I can use to build a model and train it (model.fit works), but model.predict() ...
2
votes
1answer
109 views

What is the difference between TextVectorization and Tokenizer?

What is the difference between the layers.TextVectorization() and ...
0
votes
1answer
20 views

Applying standardization using ImageDataGenerator

I have a multiclass image dataset ( 8 classes) that is divided as follows, the main folder is called training and I have 8 subfolders with each subfolder for one class. I know how to perform data ...
0
votes
0answers
9 views

Increasing training accuracy of U-Net segmentation model

I was working with segmentation using u-net and MobileNet. While I trained with input size 256*256 it had an output with Val loss: 0.044 (In this time dense layer was 256, 128, 64, 32 with a learning ...

1
2 3 4 5
52