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
9 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
20 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
11 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
10 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 getting decent results. The problem is ,...
0
votes
0answers
9 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
489 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
11 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
34 views

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

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

Conv2d for image with additional features as input layer

I want to train a model with keras and tensorflow. My input consists of images and some additional features. I'd like to use conv2d for the images and dense for the other inputs The question is how do ...
0
votes
0answers
15 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
18 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
23 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
18 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
17 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
114 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
3 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
32 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
24 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
10 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
14 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
14 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
59 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
18 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
25 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
23 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
62 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
21 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
35 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
31 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
16 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
84 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 ...
0
votes
0answers
13 views

Saving and loading a WGAN model weights

I am using the WGAN implementation provided here: https://keras.io/examples/generative/wgan_gp/ And I wanted to save the GAN and its components. When I do wgan.save("my_folder") I get: ...
0
votes
0answers
18 views

ImageDataGenerator for image preprocessing

I'm trying to do a superresolution network, but I am having trouble importing my own data. I have two types of images: resized images (smaller), original images. The first one is going to be used as ...
0
votes
0answers
17 views

Train LSTM model with similar cyclic sequence

I am using keras LSTM to predict a seq2seq of 2 variables. I have test results for 50 subjects with ±20 tests per subject. the data is a 2 variable sequence with shape (101,2). as you can see, the ...
1
vote
0answers
11 views

Bad accuracy on predicting user ratings upon his reviews

I am trying to predict user ratings based on books he rated(ratings range between 1-10). So I encoded the summary of the books and then tried to train the model with the text encoding(practically the ...
1
vote
1answer
40 views

Does validation_split in tf.keras.preprocessing.image_dataset_from_directory result in Data Leakage?

For a binary image classification problem (CNN using tf.keras). My image data is separated into folders (train, validation, test) each with subfolders for two balanced classes. Borrowing code from ...
2
votes
0answers
16 views

Why does a linear regression in time series forecasting does not provide a line in predictions?

I'm reading the TensorFlow Time Series forecasting Tutorial 1 trying to perform my own time series prediction. However, specifically on single-shot models section for multiple time steps, the Linear ...
0
votes
0answers
13 views

Expected input for time-series transformers

I am trying to create a model starting from the Attention is all you need paper. Specifically I want to setup the Encoder/Decoder architecture to predict time-series. I would like to implement it in ...
0
votes
0answers
24 views

Text Classification for columns with numbers, string and special characters

I have a dataframe with 3 columns and 1 label Here is an example of a row ...
0
votes
0answers
15 views

save and load capsule network model?

Hi i'm working on the deployment of a trained capsule network model into web application and i have a problem loading the model in other .py file to make predictions. i tried get.config() and ...

1
2 3 4 5
52