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

Help with trying to reimplement ADEC paper (clustering using AE and GAN). Encoder loss is not decreasing

I am trying to reimplement the ADEC paper (https://arxiv.org/abs/1909.11832) which mixes an autoencoder with a GAN network, but I am facing the issue that the encoder loss does not decrease. I have ...
Droidenkiller's user avatar
0 votes
0 answers
147 views

Keras Tuner Error: Failed to find data adapter that can handle input: <class 'function'>, <class 'NoneType'>

I am working on a project where I have a dataset of emails with information such as subject, body, attachment names, etc. My goal is to classify/predict around ~5,000 different sites. I am using Keras ...
patchie's user avatar
  • 101
0 votes
0 answers
11 views

How can I ask a conditional auto encoder to put more emphasis on the condition without setting epochs too high?

Here's an example of what I'm testing on. I have the mnist digits data and I randomly add a random number from 1 to 10 to each digit and divide it by 11. I do this because I wanted to test out the ...
purple1437's user avatar
1 vote
1 answer
30 views

How to correct ValueError about incompatible dimensions of training data set in locallyconnected1D layer NN

I'm training this simple network with a few points, but it can't train. The model looks okay, but when training it raises a ValueError about the dimension of the training data sets. Could someone help?...
KaRJ XEN's user avatar
0 votes
1 answer
125 views

How to use Keras Sequential with LocallyConnected layers

enter image description here I am trying to use locally connected neural networks to estimate finite elements of a mathematical function, using the Keras Sequential model. When I use dense layers all ...
KingMe's user avatar
  • 1
0 votes
0 answers
21 views

Resizing layer in adversarial GAN

A lot of questions have already been asked regarding resizing layer in sequential models but I couldn't find any that could solve my specific architecture. I am creating an adversarial GAN. First an ...
OkOutside84's user avatar
0 votes
0 answers
15 views

TypeError: TripletLoss.call() missing 1 required positional argument: 'neg'. Custom Training Loop

The below is the triplet loss. It's call method has 3 arguments ...
vivian.ai's user avatar
0 votes
1 answer
116 views

How to compute sample weight in multi-task model?

What's the correct way to calculate sample weight in a multi-task model? Concretely, I have a model that outputs a 400 class [multi-class] classification, as well as a 5 class multi-label ...
Snake Verde's user avatar
0 votes
1 answer
63 views

Defining loss weights with a target tensor

We have a model with an output target that is a 2D tensor. That is, the output represents a set of n classes, evaluated at m bins within the data. That is the output shape is: ...
Hephaestus's user avatar
0 votes
0 answers
94 views

Keras CNN model is throwing as error message as 'ValueError: Layer 'conv1d_12' expected 2 variables, but received 0 variables during loading'

Hope you're in good health and doing great. I am trying to implement a CNN model to help predict kidney stones. Now, this model is running as expected on my local machine, but when I try deploying the ...
Suvam Kumar's user avatar
0 votes
0 answers
43 views

Keras outputting integers rather than class names / labels?

I've created a ANN using Keras to predict what class a specimin belongs in based on other variables. I used label encoding to turn these classes into integers (Dogs,cats,horse,etc) to use in the ANN. ...
12455's user avatar
  • 1
0 votes
0 answers
22 views

How to interpret tensorboard histograms in CNN

I'm using tensorboard to monitor the training of my CNN, and each time I ignore the histograms because I don't understand what tensorboard is trying to show me or what I should interpret from it. Is ...
Michael Pulis's user avatar
0 votes
0 answers
8 views

Stream in images to keras from disk to avoid blowing up the memory

I have the following model that is supposed to zoom out (outpaint) images. I have a dataset of 20000 300x400 images. The problem is that neither my GPU nor RAM can hold all images at once. So this ...
user2741831's user avatar
0 votes
1 answer
116 views

Backpropagation keras source code

I searched for the backpropagation code in keras github but I couldn't find it. Searched model.fit() Please help. Thank you
vivian.ai's user avatar
0 votes
0 answers
7 views

Getting fitted outouts from hideen layer in CNN

I have a fitted CNN model through keras, with a convolution layer and pooling layer before 2 hidden layers. What I would like to see is the training data which is transformed through the final hidden ...
Paul's user avatar
  • 255
0 votes
1 answer
75 views

Trying to build a MLP in python with Keras. UNSW-NB15 used as input dataset

I need to build a MLP to classify the different types of network attacks present in the UNSW-NB15 dataset. When I obtain the correlation matrix it's clear that I am doing something wrong. Any help ...
alex martinez's user avatar
0 votes
0 answers
12 views

Test accuracy different results per training despite fixed randon seed

I'm training a tensorflow model which classifies hyperspectral images. The randon seed variable is set. On one system I am getting the same test accuracy every time I train it (training is done on GPU)...
Beach Williams's user avatar
0 votes
0 answers
23 views

AutoKeras create model from specific trial_id

I have trained ImageClassifier of 128 trials, I found best console result on trial 99. How can I load that structure at 99 trial as a model? I want to fit it and save it as well.
ML_enjoyer's user avatar
0 votes
1 answer
78 views

Deepstack autoencoder

I'm trying to go through the first edition tabular challenge on Kaggle. Obviously my first few trials results did not satisfy me, so I went to see how other people did, and in the post of the first ...
Marek M.'s user avatar
0 votes
0 answers
47 views

The weighted average ensemble model does not train on the whole data

I am using custom data generator. I want to apply weighted average ensemble. The training set has 1042 samples, and validation indicates 298 samples. The batch size is 64. when I run this : ...
Zara Nz's user avatar
0 votes
0 answers
74 views

Voting classifier ensemble error: 'ValueError: Unknown metric function: 'function'.'

I am trying to create a hard voting ensemble of three neural networks. I've already converted them to Keras Classifiers. Here is the code: ...
Will Wong's user avatar
0 votes
0 answers
11 views

ANN regressor with multiple outputs in place of single data output

I built an ANN model(Keras) to handle a regression problem with one output. By mistake I filled 10 units at the output layer (instead of 1). To my surprise, there was no error. Later on this was ...
Regi Mathew's user avatar
0 votes
0 answers
36 views

Reinforcement learning with Q-learning doesn't seem to be learning

I'm learning reinforcement learning with Q-learning and I made a training script for Flappy Bird. The problem is that it doesn't seem to be learning and I'm not sure why. My guess is that there's ...
Be nice to others's user avatar
0 votes
0 answers
126 views

Binary transformer classification model predicts everything as same value

I'm training a binary classifier using a transformer on structured numerical data (so the order of the columns in my spreadsheet matters). I have adapted the keras text classification model for IMDb ...
mins134's user avatar
0 votes
0 answers
7 views

ner transformers implementation in keras

I am following this keras link https://keras.io/examples/nlp/ner_transformers/ to train my own NER model. I am not clear why we have tags +=1 in the following ...
bithi jain's user avatar
0 votes
1 answer
23 views

Is it possible to recover initial weights from Keras model?

I've trained basic model from keras.Sequential class but didn't save weights right after running model.compile(). Is it possible ...
Brzoskwinia's user avatar
0 votes
0 answers
149 views

ValueError: Input 0 of layer sequential_3 is incompatible with the layer: expected ndim=5, found ndim=3. Full shape received: (None, 1, 200)

I m confused about the input shape for the convLstm model ! I need some help for a classification problem. I would be very grateful if anyone could help me. So, the dataset is in the form of Drug ...
xxxxxxx's user avatar
1 vote
1 answer
85 views

What values are actually used for the kernel when using a Conv2D layer?

I'm currently trying to fully understand what a Conv2D layer actually does and I think I got most of it. But theres one thing I don't quite get. When reading about Kernels there were multiple mentions ...
Gereon99's user avatar
0 votes
1 answer
58 views

Why don't we increase the parameter from 64 to 128 in this CNN model?

I'm looking at an example lab from a coursera course titled Intro to Tensorflow. In this CNN model, they're gradually increasing the no. of filters from 16 to 32 and then 64. Why don't we increase it ...
karak87rt0's user avatar
1 vote
0 answers
70 views

Unsupported object type int Error where array is already in float32

I am learning DL. For the following dataset:: spam.csv can be found here::Click here to see. I am trying to implement a simple NN to detect spam email. For the following code:: ...
Ishrat Hossain's user avatar
0 votes
1 answer
16 views

CWRU Bearing fault

I am new to ML. I have been asked to use a pre-trained GRU model for detecting a bearing fault in CWRU. is pre-trained model another name for transfer learned model?
Asma Shah's user avatar
0 votes
0 answers
16 views

Combining 2 losses for 2 different tasks and training the networks in Keras

I have to implement a communication model consisting of a mapper , channel , detector and demapper blocks. The mapper , detector and demapper blocks are neural networks and channel is a AWGN channel. <...
Firebolt's user avatar
0 votes
1 answer
1k views

Tensorflow 2.11 error: AttributeError: module 'tensorflow._api.v2.compat.v2.__internal__' has no attribute 'register_load_context_function'

I had to update Tensorflow to the currently latest version 2.11. when importing i get "AttributeError: module 'tensorflow._api.v2.compat.v2.internal' has no attribute '...
fede72bari's user avatar
0 votes
0 answers
42 views

Getting bad accuracy of classification using Keras VGG-16

I am very new to the data science domain and directly jumped to TensorFlow models. I've worked on examples provided on the website before. My first time doing any project using it. I am building an ...
Niklas's user avatar
  • 1
0 votes
0 answers
27 views

How to load time series data set, from .csv into keras 3D tensor

I would like to load, from CSV, where data are listed row by row, to load into Keras 3D tensor for LTMS. I've got error, that it requires 3D data, but I've only got 2D from CSV. Thank you in advance.
Fuzzy System's user avatar
0 votes
0 answers
41 views

Input shape for a keras custom layer

How does one find the input shape for a custom keras layer? Say I have a layer which accepts a list of 2D tensors as an input [a, b, c...] where only ...
R Walser's user avatar
  • 101
0 votes
1 answer
155 views

Can I change the number of inputs to a keras model while preserving the trained existing weights

I have a simple Sequential keras model with 150 Inputs. Some of these are simply OneHotEncoded values. Now I would like to add more options to the OneHotEncoder. As an example: I previously had Blue, ...
FLOROID's user avatar
0 votes
0 answers
64 views

How does tensorflow keras lambda layer pass gradients?

Tensorflow / Keras has a Lambda layer which aids in working with arbitrary expressions as a Layer object. In my understanding a layer should be differentiable so that gradients can propagate through ...
Eka's user avatar
  • 291
0 votes
0 answers
35 views

How to sequentially combine two tensorflow models having same input features, connected through a function

This is a little more complex and tricking question than the simpler case of combing the output and input of two TensorFlow models. In this case, both the models accept the same N features from the ...
fede72bari's user avatar
0 votes
0 answers
25 views

Correcting 4-dimensional shape to 3-dimensional shape TCN

I am having issues correctly shaping the 3-dimensional layer in the model. Each time I run the code, I receive the error ...
isabella's user avatar
0 votes
0 answers
6 views

ExponentialSmoothing holtwinters with Keras Interace

Is it possible to wrap the statsmodels holtwinters with the Subclassing API in keras? The reason i want to do it, is i have a WindowGeneratorthat creates me batches ...
ChrisChross's user avatar
1 vote
0 answers
292 views

The val_loss is nan, but loss is printing. Both train and validation losses are nan in model.evaluate(), and the acc improves during training

There is a 2-class classification problem, and my loss function is custom. The labels are categorical, and the final activation function is Softmax. During the training, the loss is printed, but the ...
Armin Amini's user avatar
0 votes
0 answers
8 views

Is this GRU learning good?

Result seems to be a little out of "expected" values. It's timeseries dataset.
Paul Paku's user avatar
  • 101
0 votes
0 answers
17 views

Ground truth as a function of weights in Keras

I have a convolutional neural network that takes an image an outputs a value between -1 and 1. If the image is an array $I$, and the network transforms the array such that $\text{output} = f(I) \in [-...
Chandrahas's user avatar
0 votes
1 answer
599 views

How do I fit huge dataset into GPU memory?

I have data that I read from feather file, and it's divided into x and y, where y is the label for the data. x is DataFrame and y...
Arsen Zahray's user avatar
0 votes
0 answers
261 views

Custom loss function in keras with class weights for each batch

I am new to deep learning and tensorflow. I am working on a speech binary classification problem, trying to replicate a research paper. Number of samples in class 1 are 2700 approx and in class 2 are ...
Nitin's user avatar
  • 1
0 votes
0 answers
11 views

Is the same dataset used to train the individual models (model1 and model2) and the ensemble model(stacking)?

I've trained two individual models. I stacked them and built an ensemble model. Code snippet: ...
Rezuana Haque's user avatar
0 votes
0 answers
7 views

Can't concatinate texture_features and resnet50_features

I have extracted resnet features(array) and texture features(list) of my image dataset. My idea is to concatinating both of the features and then use the merged feature to fit the model. Code snippet: ...
Rezuana Haque's user avatar
0 votes
1 answer
131 views

Tensorflow / Keras - Using both ModelCheckpoint: save_best_only and EarlyStopping: restore_best_weights

ModelCheckpoint save_best_only: if save_best_only=True, it only saves when the model is considered the "best" and the latest best model according to the quantity monitored will not be ...
Panda's user avatar
  • 21
1 vote
0 answers
20 views

Reproducibility issue between GPU graphic cards for DNN Tensorflow models

I am facing reproducibility issues on my DNN (Tensorflow, Keras) models when using different GPU cards. For example, when I use two a100 cards, I would be able to reproduce my results. If I use one ...
Sung Joon Won's user avatar

1
2
3 4 5
55