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
0 answers
6 views

Trouble With Keras in R

I am using Rstudio on windows 11 trying to install and use keras for deep learning. Following the instructions from the ISLR2 book for installing dependencies (https://hastie.su.domains/ISLR2/keras-...
amc98's user avatar
  • 1
0 votes
0 answers
12 views

heavy underfitting of keras LSTM regression

I moved the question from stackoverflow to here. I used keras LSTM to do the standard regression project of ...
user6703592's user avatar
0 votes
0 answers
26 views

Get graph execution error for BiLSTM and LSTM on keras

I want to use BiLSTM mode for text classification tasks. I use a data generator to get already batched and embedded files that have been split into 64 different files(for training) and 4 files each ...
Nekon's user avatar
  • 1
2 votes
0 answers
35 views

LSTM output capped at a maximum

I am using a LSTM built using to forecast a single-value (solar irradiance) by using weather data as my input. When predicting my validation test, I get a weird results as it looks like all my ...
Adam Jaamour's user avatar
0 votes
0 answers
8 views

Derive Keras Cosine Restarts Scheduler Formula from Source Code

I used Keras implementation of the cosine restarts algorithm. I need to know the exact formula of the algorithm for my LaTeX manuscript. The documentation is here. The implementation differs (in terms ...
trinity420's user avatar
0 votes
0 answers
13 views

Multi input model tensorflow with fixed data as input

I am tring to implement the following architecture. alpha and beta are fixed matrices, they are matrices I want to input on every forward pass. Meaning for every batch they should be the same My ...
Ahmed Gado's user avatar
0 votes
2 answers
29 views

Classification task on boolean only features: what model/layers/activators are better?

I'm trying to build a classification model. Features are purely boolean (not binary) and are in a csv file like 1,0,1,.. The result is an ...
Putnik's user avatar
  • 105
0 votes
0 answers
19 views

How to train Keras Sequential model in batches?

newbie here. I have a large dataset in many local CSV files. It's impossible to fit it in memory within budget. How can I train a Sequential model in batches? I've found ...
Putnik's user avatar
  • 105
0 votes
1 answer
23 views

Custom Loss Function in Tensorflow for UNet

I am working on a Segmentation task, where I planned to use U-Net for the input_image of shape (224,224,3), the output should be the mask image of shape ...
Vishak Raj's user avatar
0 votes
1 answer
16 views

How do I create an Image Dataset for a CNN?

I'm currently working on assembling a CNN for image classification with tensorflow.keras. I have all my images in a file which I already uploaded to my program. Also I have CSV-Files for training and ...
Martin Gerry's user avatar
0 votes
1 answer
17 views

Why most keras examples use shape=(None,) instead of shape=(None)?

I'm reading several keras tutorials and found that many examples are written like this: keras.Input(shape=(None,), dtype="int64", name="english")...
skan's user avatar
  • 163
0 votes
0 answers
10 views

Detection of noise and signal components with deep learning

There are thousands of datasets from the signal in the bellow image. With these datasets and machine learning, I want to first detect the jumping points (blue in the image) which are noises, and after ...
alexjan's user avatar
2 votes
1 answer
21 views

Changing model architecture doesn't impact results

I am currently learning binary classification. The problem is classifying positive and negative movie reviews. The dataset is 25,000 reviews with each review represented by 10,000 of the most used ...
Omer Mualem's user avatar
0 votes
0 answers
21 views

Different size of deep learning models but similar inference-time

I have three different semantic segmentation models with large differences in size. The first one includes 30,000,000 trainable parameters, the second one about 20,000,000 and the third one about 200,...
Capdi's user avatar
  • 111
0 votes
1 answer
27 views

Classification on sound data

My goal is to detect a problem in a windturbine. I have a dataset of 2h (1 hour for each class). To keep in mind, it will be embedded on an MCU target, so the neural network have to be less than 10M ...
Nept0's user avatar
  • 1
0 votes
0 answers
32 views

getting the error `Found input variables with inconsistent numbers of samples: [1, 35887]` while working with fer2013.csv

i am trying to build a facial emotion recognition project. and while i m at it, i m getting Found input variables with inconsistent numbers of samples: [1, 35887] ...
Tauhidul islam's user avatar
0 votes
0 answers
19 views

Input shape CNN speech

The shapes of x_train=(514, 256), y_train=(514,) x_test=(254, 256), y_test=(254,) I have 256 features and 770 samples of which ...
Srikanth's user avatar
0 votes
1 answer
31 views

Constructing an LSTM autoencoder for variable-lentgth sequences

I would like to construct an LSTM autoencoder model for sequence anomaly detection where the sequences can be varying in length. I understand based on this answer that padding and masking can be used ...
interoception's user avatar
0 votes
0 answers
10 views

Enumerable column in simple dataset

I have created my first dataset, which is divided into 3 smaller datasets. Main data is 1000 rows about cars, columns: model,year,mileage,price. Column "model" is enumerable (FiestaSedan,...
Saku's user avatar
  • 101
0 votes
0 answers
32 views

Fine tuning a pretrained model gives worse results

I have a pretrained model for multi-class activity classification. I also have a dataset D which is similar to the dataset used to train the pretrained model. When I run data from D through the ...
Questioner1234's user avatar
0 votes
0 answers
24 views

Why do I get such a low accuracy despite having good metrics?

I'm working on an image segmentation problem. I'm fine-tuning the network, and when displaying the metrics I obtain, I have some doubts. I am going to provide some details about the network: Solver: ...
PicaR's user avatar
  • 304
1 vote
1 answer
25 views

Patterns binary classification - model doesn't overfit

I am working on a very basic binary classification problem. For each set of four float numbers $(x,y,z,w)$, I want to check if they fall or not into one category. I have written a model in Keras with ...
apt45's user avatar
  • 121
0 votes
1 answer
42 views

Very low Neural Network Accuracy for Titanic Survival Problem

I am new to neural networks and have done a few projects but have got very low accuracy for all of them. I have included the code for titanic NN code here. Am I missing something or what? Can you help ...
thenoobcoder's user avatar
0 votes
0 answers
23 views

Tensorflow loss: 0.0000e+00 - accuracy: 0.0000e+00

I was making changes to improve myself in a chatbot code using LSTM. But Loss and truth values are getting ridiculous values. Code: ...
willy.js's user avatar
1 vote
1 answer
36 views

How to align the description of a convolutional neural network in keras with wikipedia's conceptual model?

I was going through the introductory guide to convolutional neural networks in tensor flow here And I was trying to logically map some of the code I saw to my actual understanding of how convolutional ...
Sidharth Ghoshal's user avatar
0 votes
0 answers
9 views

How to grid search LSTM manually using TimeSeriesSplit while preserve/load best_models?

This is a self-written LSTM tuner class. ...
frr0717's user avatar
0 votes
0 answers
23 views

How to build a NN for classifying custom timeseries data?

I'm trying to learn a little bit of machine learning and it occurred to me that my own household produces a lot of interesting data. Specifically, the ModBus-enabled digital power meter installed a ...
Sixtyfive's user avatar
  • 125
0 votes
1 answer
30 views

Training and validation loss sometimes not decreasing in Keras dense layer with the same data and random seed

I want to use a Multi-Layer-Perceptron in Keras (Dense layer) to map 6 inputs to 1 output. For doing this I use the following code: ...
PeterBe's user avatar
  • 71
0 votes
0 answers
16 views

How can I produce sentences response with AI when I use my own data to train the model?

I have trained a model in KERAS with my own text data from OneNote notices. Now, when I use the model.predict function with a question as an input, I receive as return data an array with 5700 elements ...
ntosis's user avatar
  • 1
0 votes
1 answer
33 views

Flattening before Fully-connected Layer (DENSE)

Can anyone explain why we need to flatten the data before inputting it into a fully-connected layer? What will happen if we input a matrix of size (m,n) into a fully-connected layer that has k ...
Nhan Nguyen's user avatar
0 votes
2 answers
36 views

Tensorflow: How to pass multiple images to VGG16 layers

This is a toy problem I am working on. I have an extruded N-sided polygon that I have rendered from 5 different randomly selected viewpoints. The classification task is to determine the number of ...
user491880's user avatar
0 votes
0 answers
93 views

Can I convert a TensorFlow tensor to a CSV file?

I'm working on a semantic segmentation problem. I have saved my images in a tensor of shape (4767, 192, 192, 3) [It contains 4767 images of size 192192 with RGB channels]. On the other hand, I have ...
PicaR's user avatar
  • 304
0 votes
0 answers
20 views

Generator loss keeps increasing while discriminator keeps decreasing

I am trying to build a GAN to generate LEGO images however my generator is not working at all. I have tried changing the learning rates but it caused the loss to go even more higher, sometimes into ...
Abhinav Painuli's user avatar
0 votes
1 answer
36 views

Transpose of a 3D tensor

I need to transpose a 3-dimensional tensor of the shape (batch_size, N, M) to (batch_size, M, N) in a custom loss function in Keras with tensorflow as the backend. I tried using the following function ...
Doc Jazzy's user avatar
0 votes
0 answers
33 views

I have a strange loss behavior in Tensorflow/Keras. It goes smooth towards better values, and then suddenly it increases rapidly before falling again

I have a model that trains on a dataset of 100000 data points. The model is a single dense layer with a single neuron. During training, I use a batch size of 1000 and train for 250 epochs. After ...
Runei's user avatar
  • 1
0 votes
1 answer
54 views

What preprocessing should I do to a multiclass segmentation mask?

I am working on a segmentation problem. My masks are tensors with a shape of (4767, 192, 192, 1) --> (num_img, height, width, number of channels). Each mask contains 13 different pixel values (0, 1,...
PicaR's user avatar
  • 304
1 vote
1 answer
23 views

Weights explosion with a simple demo

I am trying a very simple model : ...
welu's user avatar
  • 131
1 vote
0 answers
42 views

I can't get good performance from BERT

I trained NLP models. This is a subset (200 instances) of my data set of 10,000 instances:This the link of the dataset on pastebin I compare an LSTM model with a glove model and a BERT model. I ...
Seydou GORO's user avatar
0 votes
1 answer
34 views

How do I implement convolution partially on my dataset?

I'm training a neural network on the results of a CFD simulation (or rather, 300-ish simulations with different initial conditions). The dataset contains the values for temperature, density, velocity, ...
Sisyphus's user avatar
0 votes
0 answers
27 views

How to implement a custom loss function acting differently on multiple instances with keras?

I want to reproduce the results in "Online Neural Networks for Change-Point Detection" Hushchyn et al., but I'm having trouble implementing their loss function with Keras. The algorithm ...
Andrea Giovanni De Marchi's user avatar
0 votes
0 answers
127 views

Keras masking with MultiHeadAttention

I am following keras example to classify time series using transformers. Timeseries classification with a Transformer model The creation of the model is presented in the following code snippet: ...
nicos prive's user avatar
1 vote
2 answers
44 views

High accuracy on test and validation data but still can not predict on real data

Hello i am having a classification between two classes A and B and i have trained CNN model. I have high accuracy on all three set of data i.e training (98.7%) validation (99.3%) and test(98%) but ...
Ejaz's user avatar
  • 11
0 votes
0 answers
38 views

Why does my validation loss go so high after few epochs?

I am facing an issue with my pretrained mobilenetv3 model, it is quite strange how the validation loss is behaving, it starts low but then goes up ridiculously high. I have normalized my images as ...
NevMthw's user avatar
  • 47
1 vote
1 answer
51 views

What should I Improve from my Neural Network Model (Logistic Regression)

Initial Information I built a Neural Network Model (Logistic Regression) to classify Lung Cancer based on the patient's (user) symptoms My dataset is kind of small (only about 276 data) Here is the ...
Jonathan's user avatar
4 votes
3 answers
202 views

Which metric to use for imbalanced data in TensorFlow/Keras

I am doing a binary classification task with Keras and my model directly outputs either 0 or 1. Typically I compile the model like something below: ...
D.J. Elkind's user avatar
0 votes
0 answers
18 views

How to improve the val_loss in a keras sequential model for classification purpose

I'm training a keras sequential model with these layers included. The problem I face here is that the val_loss is constant and does not decrease.. The model is meant to classify the Diabetic ...
Aniket Aher's user avatar
0 votes
1 answer
420 views

How to correctly measure the inference time and FLOPs of a model?

For some reason, I can’t find built-in solutions (not really?) in keras and tensorflow, while on the site https://keras.io/api/applications/ they provide Time (ms) per inference step (CPU), but for ...
Shadow_fiend's user avatar
0 votes
2 answers
126 views

which Keras accuracy metric for multiclass classification

I am training a CNN for multiclass image classification into 4 images , what accuracy metric should i use from Keras. My labels are not one hot encoded as I am trying to predict probability of ...
Priyanshu's user avatar
0 votes
0 answers
96 views

Faster way to get all the intermediate outputs in tf keras

I want to collect some statistics of the activations of each layer in a network, and I have implemented a version of the idea usually described in answers: get all the outputs you want, create a new ...
arivero's user avatar
  • 101
0 votes
1 answer
51 views

Keras MLP not working

For my degree's final project I am working with Keras and trying to build different AI models. I'm having trouble with an MLP. First I preprocess the UNSW-NB15 dataset and later use it as input in a ...
alex martinez's user avatar

1
2 3 4 5
55