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
1 answer
24 views

Keras Binary Classification - Maximizing Recall

Let me start by saying my machine learning experience is... dangerous at this stage. I'm still a beginner. I have a binary classification data set of about 100 000 records. 10% of the records are ...
user avatar
  • 101
1 vote
1 answer
19 views

RNN/LSTM timeseries, with fixed attributes per run

I have a multivariate time series of weather date: temperature, humidity and wind strength ($x_{c,t},y_{c,t},z_{c,t}$ respectively). I have this data for a dozen different cities ($c\in {c_1,c_2,...,...
user avatar
  • 13
0 votes
0 answers
5 views

Constant trend for test error

I'm using keras functional API in order to model a multi-input/multi-output relation in the form (y1,y2) = f(x1,x2,x3). I have a really simple architecture composed by 2 hidden layer of 64 nodes and ...
user avatar
0 votes
0 answers
8 views

DeepSets Keras Architecture

I am interested in the Deepsets Model but I am not quite sure how to implement it in Keras/Tensorflow for a normal regression task. More specifically the DeepSet model should take an arbitrary-sized ...
user avatar
1 vote
0 answers
19 views

How to predict a mathematical progression with keras

I try the following model for a many-to-many recurrent network: ...
user avatar
0 votes
0 answers
10 views

NaNs in predictions with LSTM

I have an LSTM model that I have trained and tested it with a dataset. Now I want to test it to an other dataset and I use the following snippet: ...
user avatar
  • 101
0 votes
1 answer
18 views

Input shape error

I've this item: ['6', '1', '6', '843537', '3', '0', '5', '1006709', '3', '1', '4'] with shape: (11,) but when go to predict with: ...
user avatar
0 votes
1 answer
24 views

What kind of neural network am I using? How can I build a specific kind of network?

I'm going through a tutorial for tensorflow with keras and at one stage you build the neural network model using the code below. ...
user avatar
1 vote
1 answer
31 views

Imbalanced Binary Dataset in Keras. Finding the best threshold after fit s.t. sensitivity and specificity is maximized?

I have made an ANN in Keras that works on an imbalanced binary dataset. The data is used after fitting the model to predict the binary classes and I want to choose a threshold s.t. sensitivity and ...
user avatar
0 votes
0 answers
11 views

Using custom layers in Functional API

I am trying to write a custom layer using subclassing in Keras and then use it in functional API. I followed the advise in the documentation - https://www.tensorflow.org/guide/keras/...
user avatar
0 votes
0 answers
10 views

What kind of Keras data classification mode should I pick for my kind of machine learning problem?

So I have to come up with a machine learning model for a specific problem that I have. As far as I know, Keras allows for four different types of classification: Binary, Categorical, Multiclass ...
user avatar
0 votes
0 answers
8 views

Custom loss for classification of geolocation in Keras

I have a model that predicts geolocation coordinates based on some data. The way I have it set up at the moment is that I clustered my points (2D coordinates) into 100 classes that my model predicts ...
user avatar
2 votes
2 answers
43 views

Genetic Algorithms (Specifically with Keras)

I can't get my deep genetic algorithm snake game to work and I can't figure out why. At this point, I think it must be either the crossover_rate/mutation_rate or the actual crossover code itself is ...
user avatar
0 votes
0 answers
36 views

Transformer time series classification using time2vec positional embedding

I want to use a transformer model to do classification of fixed-length time series. I was following along this tutorial using keras which uses time2vec as a positional embedding. According to the ...
user avatar
0 votes
0 answers
17 views

Why (or how) does a Keras model skip Stemming or Lemmatization steps?

This Keras article / tutorial here does perform text standardization i.e removing HTML elements, punctuation, etc. from the text dataset, however, there is a distinct lack of any stemming or ...
user avatar
0 votes
0 answers
7 views

How to generate a sentence around words in Keras?

I know that how to generate next word in keras with lstm but how to predict previous word for example If you have two words like "car" and "running" then It should generate "...
user avatar
  • 1
0 votes
0 answers
13 views

Creating a new prediction for the Keras.io BST model

The Keras.io example of a Transformer-based recommendation system is a great example for me to understanding neural networks in Keras. But how would you use the create_model_inputs() to get a new ...
user avatar
0 votes
0 answers
14 views

Too optimistic results with efficientnet v2 with cifar10

I'm trying to run efficient net with cifar-10 which should get high results, but not 100%. Here is my code: ...
user avatar
-1 votes
0 answers
10 views

Problem with root error

I currently built a model for classify age with Keras function API for studying then i'm stuck in this error for a long time. Don't know how to fix it, please help me solve this problem. Here is my ...
user avatar
0 votes
0 answers
11 views

Predicting value using LSTM

I'm currently learning about LSTM and want to make a prediction using an array as an input and have an output as a single value. I currently trying to do that by using this model: ...
user avatar
0 votes
0 answers
7 views

Data Augmentation Keras length of data

I'm confused when I add data augmentation should I get more data or the same data I tested my x_train length to confirm but I got the same length before augmentation and after augmentation is that ...
user avatar
  • 1
0 votes
0 answers
16 views

Tensorflow 2 Semantic Segmentation - loss function for two classes

I am trying to implement a U-net for semantic segmentation with two classes (foreground=1 and background=0) in the segmentation mask images, following this tutorial. They have used ...
user avatar
  • 101
0 votes
0 answers
9 views

How to create the categorical mask for images specifically for Tensor? Or port the NumPy function correctly to Dataset.map function

I'm trying to move from NumPy array as my dataset to tensorflow.Dataset. Now, I've created a pipeline to train the model for classification problems. At some point, I just normalize all the images ...
user avatar
0 votes
0 answers
9 views

How to load several numpys in batch generator from directory

I have a deep learning model which has to be feed with a huge amount of data (200k of 256x256 images), so it runs out of memory. I have divided my data in several numpy arrays that are in an specified ...
user avatar
0 votes
0 answers
13 views

How to use LSTM for multiple individual but predicting at every timestep

My dataset consists of a large (1000s+) number of individuals, who may be considered independent of each other. Each individual has a timeseries of about 10-60 data points (each point being a vector ...
user avatar
  • 101
1 vote
1 answer
11 views

How Did Keras Determine The Number of Parameters In My Model

I have the following keras model: ...
user avatar
0 votes
0 answers
16 views

Could not load file or assembly 'Python.Runtime' or one of its dependencies. Attempt to load an incorrectly formatted program

I'm trying to use keras.net in visual studio 2022. I'm using a .Net application of 32bits so I had to install python 32 bits. I installed keras.net and tenwsorflow with python 32bits but I got this ...
user avatar
1 vote
0 answers
36 views

Lstm model predict only float between 0 and 1

i created a lstm model to predict number of crimes in months. For each month I predict the number of crimes for the next month. The targets are values ​​greater than 1 (normally) but the model ...
user avatar
  • 11
1 vote
0 answers
10 views

Keras sparse_categorical_crossentropy throws squeeze error

I am attempting to convert a Keras model from regression to classification. It's a stock trading system, where I want to buy the 3 symbols out of a universe of 15 or 20 with the best predicted ...
user avatar
  • 11
0 votes
0 answers
17 views

tensorflow predict gives same values for any input

I'm trying to create a classification model for images, using TensorFlow and Keras. For this classification problem, I've created a model like this: ...
user avatar
0 votes
0 answers
25 views

Keras vs PyTorch vs Tensorflow

I would like to get started in deep learning but I don't know which framework to start with. Which one do you advise me? More power? Easier to learn? thanks and best regards.
user avatar
  • 320
0 votes
0 answers
27 views

Using LSTM for text generation keeps generating same word

I work on a simple text generation problem using a portion of the Shakespeare dataset that I decided to use LSTM for. I primarily used this tutorial for reference. However, as I ran the below code, I ...
user avatar
  • 257
1 vote
0 answers
18 views

Training validation and accuracy are very high, but testing accuracy is low

The training accuracy and validation accuracy of my model is extremely high. ...
user avatar
  • 111
0 votes
0 answers
17 views

find the number of classes in Cifar-10 dataset

I am trying to find the number of classes in Cifar-10 dataset, but it gives me the error below: ...
user avatar
0 votes
0 answers
80 views

Using "Demon Adam" as optimizer in Tensorflow

I am working with a simple neural network in Google Colab using Python with Tensorflow where I've only tried to use the optimizers already available in keras such as Nadam, Adam, Adadelta, Adagrad etc....
user avatar
  • 101
0 votes
0 answers
9 views

Group multiple ImageNet labels into a more general label

I'm a beginner in the world of machine learning, and my goal is to produce a mobile app that can recognize, label and group your gallery picture to make it more organized. I started by digging into ...
user avatar
0 votes
0 answers
21 views

Keras Backpropagation when Later Layers are Frozen

I am working on a project with facial image translation and GANs and still have some conceptual misunderstandings. In my definition of my model, I extract a deep embedding of my generated image and ...
user avatar
0 votes
2 answers
62 views

Keras: ambiguity regarding state maintenance in RNNs

The following is mentioned in the official keras RNN documentation (https://www.tensorflow.org/guide/keras/rnn). By "Normally", I assume they mean when stateful=False, which is also the ...
user avatar
  • 79
0 votes
1 answer
20 views

How to compute the mean of weights of multiple models?

Hi i'm a student and i'm working on a Federated Learning problem, but before doing that with the proper tools like OpenFL or Flower, I started a little experiment to try in local to train using this ...
user avatar
2 votes
1 answer
30 views

Estimating Length of Hyperband Trials in Advance

I would like to use the (Keras/Tensorflow) hyperband tuning algorithm more than the Keras random search, for instance, when testing hyperparameters. With random search I can set max trials and get a ...
user avatar
  • 21
0 votes
1 answer
10 views

Why doesn't batch normalization 'zero out' a batch of size one?

I'm using Tensorflow. Consider the example below: ...
user avatar
0 votes
0 answers
14 views

Is RoI Pooling appropriate to retrieve fine details from objects of varying sizes?

I’m using a RoI Pooling after a CNN that extract features from images of varying sizes, containing defects I want to classify. The images and defects sizes range from a couple of pixels to ~100 pixels....
user avatar
1 vote
0 answers
52 views

What does `BaseRandomLayer` do?

At the very bottom of base_layer.py (imported as tf.keras.engine.base_layer.py in v2.8) there is a class called ...
user avatar
  • 11
1 vote
1 answer
28 views

Cannot achieve good result while Transfer Learning CIFAR-10 on ResNet50 - Keras

I'm trying to Transfer Learn ResNet50 for image classification of the CIFAR-10 dataset. It's stated in the original paper and also ResNet50 documentation on keras.io that the ResNet should have a ...
user avatar
  • 11
1 vote
0 answers
19 views

Time Series Forecast using LSTM and Neural Network

I am doing a univariate time series forecast using Keras. The first Image shows forecasts using a neural network and the second image shows forecasts using an LSTM model. The models have been trained ...
user avatar
  • 11
0 votes
1 answer
20 views

Why does Keras UpSampling2D layer cast to float32?

When using the Keras UpSampling2D layer to resize a float64 array the result is cast to float32. The following code snippet demonstrates this behavior. ...
user avatar
0 votes
0 answers
23 views

validation accuracy is stuck at 99.44% from the first training epoch while training accuracy and loss are increasing and decreasing respectively

and I don't understand why is this happening is it a problem with the architecture or the training itself I tried slightly different models but with the same problem. its for jigsaw-toxic-comment-...
user avatar
1 vote
0 answers
14 views

keras binary classifier is predicting same outcome and has very poor AUC

I tried to build a binary classifier for a dataset with 298 binary factors and 1 predictive binary outcome, but the predicted values for the test data are all the same. My code is: ...
user avatar
  • 11
1 vote
0 answers
18 views

Fraud detection with machine learning with partialy labeled data

I am facing difficulties handling an issue with my dataset. The purpose of my analysis is to find an electricity thief given a dataset. The first dataset: contains the list of all customers (unlabeled,...
user avatar
  • 11
0 votes
0 answers
10 views

Problems with recurrent neural net working with time steps

I am trying to design a recurrent classificatory network with Keras. I have analyzed key characteristics of the frames of a video, and from them I want to identify when certain events occur during the ...
user avatar

1
2 3 4 5
53