Skip to main content

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
13 views

Getting nearly 100% accuracy using Binary Classification in Tensorflow but incredibly wrong prediction levels for email messages

I'm creating a Chrome Extension to read user emails via Gmail's API, and then passing in user emails to a trained Keras model in Flask to determine whether the email was written by an AI or a Human, ...
Chibuike S. Eze's user avatar
0 votes
0 answers
8 views

Overfitting - Imbalance Classification using Deep-feed forward network

I have an unbalanced dataset, so I used SMOTEENN on the training set to resample, after training DFF,i could see the model is overfitting, could someone help me solve this? Thank You. ...
Pavithra K's user avatar
2 votes
1 answer
21 views

Custom loss function in python

I am trying to implement a custom loss function inspired by https://arxiv.org/pdf/2305.10464.pdf. That is: $ L(\mathbf{x}) = (1-y) \left\lVert \mathbf{x_{true} - \mathbf{x_{pred}}} \right\rVert^2 + y \...
Gst's user avatar
  • 21
0 votes
0 answers
32 views
+50

Tensorflow SegNet architecture

I was unable to find a complete description of the SegNet architecture for image segmentation (specifically, the decoder layers). Therefore, I would like to clarify the correctness of my ...
D .Stark's user avatar
-1 votes
0 answers
7 views

I want to send parallel inputs to LSTM layers each LSTM layer should recieve 60 timesteps of single feature. How should i shape my inputs

...
Shreedatta Nasik's user avatar
1 vote
1 answer
39 views

Does using different optimizer change the loss landscape

I plot the landscape using this code, and I notice the landscape shape has changed a lot. My understanding is that the optimizer does not change the loss landscape. But now I'm confused if its just ...
user836026's user avatar
0 votes
1 answer
18 views

How do I ensure final output shape matches input shape for a semantic segmentation task?

I trying to replicate the semantic segmentation example https://keras.io/examples/vision/oxford_pets_image_segmentation/ but train on my own data. I have 8 labels (7 features + background). My images ...
utx7563yu's user avatar
0 votes
0 answers
19 views

Calculate AUC-ROC and AUC-PRC for an LSTM Model

I have the following simple Bidirectional LSTM model for a binary classification task: ...
thatsroughbuddy's user avatar
0 votes
0 answers
13 views

How can I change my input shape in the architecture for the cnn(transfer learning)?

I have already made a model and trained it, and then saved the model along with its weights. The input shape in that model is [900,300,1] which is [height,width,channel]. I want to use the same model ...
beschichtung346's user avatar
0 votes
0 answers
17 views

Tensorflow keras training/validation loss digits of precision

I have my model defined with certain structure and now just permuting between filter counts and number of layers of structure. I am watching the output of model.fit() such as ...
user2624395's user avatar
0 votes
0 answers
9 views

Using a neural network to predict disease outcomes in individual cases

I'm working on a research project with the goal of using a neural network to predict disease outcomes for patients. I've built a neural network using Tensorflow and Keras and I've trained and tested ...
Daniel Tveten's user avatar
0 votes
1 answer
10 views

Connecting Flatten layer to Dense layer

I'm struggling with my neural network. In short, I need to recreate a model from anywhere on the internet, I've found a model that combines BiLSTM, LSTM and GRU. However, based on the error I got when ...
Tatiana Budanova's user avatar
1 vote
1 answer
59 views

why validation accuracy is stuck at 75%?

i am using tensorflow=2.15.0 and keras associated with it I have made a cnn network to identify a total of 2294 images into 10 different classes or, data is divided as 229 images are contained in each ...
beschichtung346's user avatar
0 votes
0 answers
13 views

Evaluation of the loss function

Why the three evaluations of the loss in the following code do not agree? ...
Perochkin's user avatar
  • 311
-1 votes
1 answer
40 views

In order to predict after training on Standardized data, do I need the StandardScaler as well?

Is the scaler saved inside the model.keras file or I need to separately save it? I want to train an neural network, save it, and ...
Cohensius's user avatar
  • 163
0 votes
0 answers
9 views

Does Keras cache activations if lower layers are frozen?

I've been experimenting a bit with gradually adding layers to a model, while freezing N layers and only leaving the N+1th layer trainable. In my mind, the time to train any layer should be roughly ...
John Smith's user avatar
0 votes
1 answer
33 views

My custom neural network is converging but keras model not

in most cases it is probably the other way round but... I have implemented a basic MLP neural network structure with backpropagation. My data is just a shifted quadratic function with 100 samples. I ...
tymsoncyferki's user avatar
0 votes
0 answers
18 views

How to make my validation plots more stable and improve R2 metric?

I'm working on predicting 4 numeric values basing on signal spectrum (spectrum is represented as an array of 800 numeric values in scale 0 to 1). The input values are scaled by using StandardScaler. ...
mkow93's user avatar
  • 1
0 votes
1 answer
28 views

What exactly is saved when I save a NN?

After we trained a Neural Network, we can save it in order to be able to predict without re-training. So when we use model.save('my_model.keras') what exactly is ...
Cohensius's user avatar
  • 163
0 votes
1 answer
52 views

How to automate the restarting of training of deep learning model in TensorFlow

I am trying to automate the (recursively) restart of a finished deep-learning training session in TensorFlow. Currently, to restart I am manually restarting my kernel and re-running the training code. ...
user10529827's user avatar
1 vote
1 answer
22 views

Building a CNN (with Keras for pixelwise classification)

I have a set of 120x120 input images with 3 channels. I want to build a basic CNN to predict the value of each pixel. I have 2 doubts. One is regarding the last layer - should be a Dense layer, or a ...
Filippo Nunes's user avatar
0 votes
0 answers
18 views

Neural network does not overfit my data. (Primarily linear function)

I am using TensorFlow and Keras. My goal is to approximate a primarily linear function that is partially nonlinear, such that a linear regression yields a Mean Absolute Error (MAE) of 0.13. All ...
Maxim Maximov's user avatar
0 votes
0 answers
20 views

Keras DNN outputs the same value over and over

I'm creating an ensemble of NNs with the same architecture, but each NN only outputs one value when given X_test data. The data (continuous values transformed to be [-1,1]) yields results as expected ...
quasimodo's user avatar
0 votes
0 answers
27 views

What is the difference between two different Keras sequential models?

I run two different Keras sequential models on IMDB data: truncate the input data by the first 100 words and translating to float32 array convert the input data using categorical array The "1&...
user1312837's user avatar
0 votes
1 answer
67 views

Training Loss for Classification Model Isn't Decreasing

I'm currently building a video classification model for engagement detection but I'm having some trouble training it. The model takes in two tensors as inputs: a 10x48x48x1 tensor which holds a stack ...
snowball's user avatar
1 vote
1 answer
56 views

How to balance labeled datas and then carry out execution with a certain ratio?

I'm building a binary classification model using a neural network, with python and the libraries tensorflow and keras. For that I have an unequal amount of labeled data: Around 2'000'000 labeled with <...
user155518's user avatar
1 vote
1 answer
42 views

Keras CNN early stopping not working as expected with patience parameter in imbalanced datasets

So I want to stop the cnn when a custom (not implemented in keras) logged metric is not improving with a patience of 5 (I chose macro f1 score) and here's what I did: Created a callback to log the ...
giza2001s's user avatar
0 votes
0 answers
9 views

I'm trying to build image search like Google Photo-Image with face is given to model & it'll get all the images in database in which he/she is present

When a user upload a selfie, the model search same person in dataset of images of multiple persons and get back all the images in which that person is present. Step 1: From dataset of images I detect ...
BKP's user avatar
  • 1
0 votes
1 answer
44 views

CNN training accuracy flatlines

I'm training a CNN from scratch to do tagging of images. And my training is going nowhere. I was hoping someone could help me identify an obvious error. I would like to end up with a network that ...
laslowh's user avatar
  • 101
0 votes
1 answer
37 views

Number of feature extraction layers in CNN

In a course I took about machine learning, we normally used about 2 feature extraction layers for image classification tasks, using MNIST or ...
evilmandarine's user avatar
0 votes
0 answers
19 views

Regarding TextVectorization reserved tokens

From the documentation of TextVectorization: max_tokens: Maximum size of the vocabulary for this layer. This should only be specified when adapting a vocabulary or when setting pad_to_max_tokens=...
Enk9456's user avatar
  • 105
0 votes
0 answers
20 views

Why isn't the validation data loss close to the test data loss?

First I set aside about 15% of my data as test data. Then, I used tensorflow.keras to create a relatively simple neural net model. Then I set the model.fit() parameter validation_split=0.2, so 20% of ...
Alex's user avatar
  • 1
1 vote
0 answers
37 views

Is it possible to determine the probability of each time sample to belong a certain class using gaussian distribution with Recurrent Neural Networks?

I'm trying to train a deep learning model that predicts the probability of each time sample in a two-component time series . In this case, I want the target tensor (Y) to be a probability value for ...
Kevin Vargas's user avatar
1 vote
1 answer
30 views

Is it bad to average several MAEs calculated from chunks of a big test dataset?

In my regression problem, I am using Mean Absolute Error (MAE) as a metric for my network. My test dataset is too big to fit in memory, so I am reading the test dataset in chunks and then Keras' ...
ihavenoidea's user avatar
2 votes
1 answer
131 views

Why the test accuracy showing some odd behaviour in comparison to train accuracy?

I am currently training an ANN using Sequential(a class from Keras API within tensorflow), and I am optimizing the model's architecture and came across something I have not seen before. The graph of ...
Aach_copro's user avatar
0 votes
0 answers
52 views

How the RecommenderNet model works

I'm newbie to collaborative filtering based recommendation, I have some questions about collaborative filtering when using keras' RecommenderNet model The RecommenderNet model uses Item-based ...
Khang Khang's user avatar
0 votes
1 answer
149 views

What may cause the CNN layer weight regularizer to reduce the model accuracy

What may cause the accuracy reduction when using the tf.keras regularizer at layers in CNN in the symptom? The example is simple but it happens with more complex CNN causing no improvement during the ...
mon's user avatar
  • 711
0 votes
1 answer
36 views

LSTM For Predicting Vector Sequences

I am attempting to construct a Keras model that intakes a sequence of vectors and outputs the most likely next vector in the sequence. I have followed a few tutorials, but nothing is quite seeming to ...
slastine's user avatar
1 vote
1 answer
91 views

activation=tf.keras.activations.relu vs activation='relu'

Both models are for binary classification problems Model 1 ...
Justin Jonany's user avatar
0 votes
1 answer
38 views

Confusion with tensorflow's Sequential Dense Layers

I'm working on a regression probem using Tensorflow, and have created two models with slight differences in their first Dense layer. The Models ...
Justin Jonany's user avatar
1 vote
1 answer
36 views

Keras Model Produces Different Outputs, But Outputs Map To The Same Vector

I have a neural network that produces output vectors from input vectors. These output vectors are different depending on what input vector it is being asked to predict for. I have a dictionary that ...
slastine's user avatar
0 votes
1 answer
90 views

Neural Network for binary classification not working

I have made a neural network that was working correctly as a multi-class classifier, but after changing the loss and the activation function, plus the output layer to just 1 neuron, it is not working ...
alex martinez's user avatar
0 votes
0 answers
26 views

Cant pass input_shape to LSTM layer in Keras

I have a numpy array X_train of shape (number of samples, timestep , number of features) =...
John adams's user avatar
0 votes
0 answers
30 views

Why does the AutoKeras NAS require reshaping of data?

Please take a look at the following source codes: training.py ...
user366312's user avatar
0 votes
0 answers
20 views

How to choose the right typt of ANN architecture for a regression model

So, im working on a project where i am leveraging ai to get accurate price predictions in terms of houses and real estate properties. I would like to use an artificial neural network so now i have to ...
maizen's user avatar
  • 1
1 vote
1 answer
111 views

Conv1D layer input and output in keras with input shape having 4 dimensions

Keras example on conv1d they mention that input shape can have 4 dimensions: With extended batch shape [4, 7] (e.g. weather data where batch dimensions correspond to spatial location and the third ...
user155709's user avatar
1 vote
1 answer
84 views

Why is the sprase categorical accuracy decreasing every epoch and predictions are always NaN?

Problem Summary My model is built and compiled properly but gets the NaN validation loss on all epochs. The training set accuracy is also infinitesimally small and keeps decreasing. I couldn't find a ...
Joachim Rives's user avatar
0 votes
0 answers
14 views

Meaning of mean squared error in multistep prediction

In multistep prediction with LSTM(keras), say we had this kind of result: target = [[1,2,3] ,[4,5,6] ] predictions = [[1.1,2.2,3.3] , [4.4,5.5,6.6]] When we choose mean_squared_error as the loss ...
the_he_man's user avatar
0 votes
0 answers
31 views

LSTM - How can I predict the status an hour before in advance?

I’m very beginner, I’m trying to design a prediction model for forecasting the status one hour ahead.I have 150 sample data, each consisting of of 24 hours of time-series data with multiple features (...
user2578441's user avatar
2 votes
1 answer
230 views

Role of stateful parameter vs shuffle parameter in LSTM keras

I'm trying to make prediction on a multivariate time series using LSTM. I know stateful=True in keras LSTM means state(hidden) of each sequence, in a batch, at index i - is passed to the next batch, ...
the_he_man's user avatar

1
2 3 4 5
55