Questions tagged [keras]

Keras is a minimalist, highly modular neural network library written in Python.

Filter by
Sorted by
Tagged with
1
vote
0answers
9 views

why keras gives me desired results for my Entity Embedding but not pytorch?

I tried to build Entity Embeddings of categorical data from a dataset. I took a dataset - "Bike share”.This dataset shows number of bike share/rent/sales in every ...
1
vote
0answers
15 views

Help understanding the Tensorboard histogram names and meaning in an LSTM Model

Can someone please help me understand what the names and shapes of the following tensorboard histogram outputs mean about an LSTM model I coded? Thank you! I understand the terms in the names like ...
1
vote
0answers
16 views

How are the Convolution kernels learned?

As I went through the basics of machine learning, I failed to understand how do the Convolutional layers in a CNN learn the convolution kernels. After looking at first few tutorials, I thought the ...
-1
votes
0answers
13 views

Tensorflow Model : Model.Predict Error “Matrix size-incompatible: In[0]: [1,20], In[1]: [21,4]” [closed]

Tensorflow Ver. 2.1 Model running with 21 columns/features. Learning and Test slices and normalized data. Model performs OK until try to use model.predict then ...
3
votes
0answers
26 views

Avoid Load and re-Train of a Neural Network Model [closed]

I built a feedforward neural network, his goal is to classify a target value, the train has to be defined for n-days. The input is constituted by 12 neurons (since I have 12 different data each of ...
1
vote
2answers
27 views

Loss being outputed as nan in keras RNN

Since the first Epoch of the RNN, the loss value is being outputted as nan. Epoch 1/100 9787/9787 [==============================] - 22s 2ms/step - loss: nan I have normalized the data. ...
1
vote
0answers
31 views

Keypoint detection from an image using a neural network

I am trying to design and train a neural network, which would be able to give me coordinates of certain key points in the image. Dataset I've got a dataset containing 1800 images similar to these: ...
0
votes
0answers
7 views

Can't load custom Keras metrics using mlflow.pyfunc

I have a DNN in Keras, which includes a custom metric function and which I want to pipeline with some SKlearn preprocessing. I further want to persist the model using MLFlow for easy deployment. The ...
3
votes
1answer
23 views

Is it wrong to use Glorot Initialization with ReLu Activation?

I'm reading that keras' default initialization is glorot_uniform. However, all of the tutorials I see are using relu ...
1
vote
0answers
19 views

Tensorflow, Optimizer.apply_gradient: 'NoneType' object has no attribute 'merge_call'

My programme gives the following error message: ...
0
votes
0answers
19 views

Validation loss flattens or increases even after changing model architecture

I am trying to implement the Hierarchical Attention Model on 2.5M Dataset of Amazon Reviews but even though the training loss goes down the validation loss is almost constant. The first thing that ...
1
vote
0answers
23 views

setting class weights for imbalanced dataset, how using EarlyStopping?

I want to train a CNN with Early Stopping (Keras). The data set is imbalanced, so I have set class_weights to 'balanced' like follows: ...
0
votes
1answer
22 views

Keras RNN (batch_size

I created RNN model for text classification with LSTM layer, but when I put the batch_size in the fit method, my model trained on the whole batch instead of just the mini batch _size. This also ...
0
votes
0answers
17 views

Keras custom metrics - MAP and MRR

I am trying to build a LSTM model in keras where I have one question with 10 answers but only ONE among them is correct. So basically im tring to build a 10 class classification problem. As most of ...
0
votes
0answers
10 views

ways to implement multiple discriminators for GAN?

I'm tyring to build TTS system using GAN and was wondering if it's possible to build it using multiple discriminators and if I can, can you also explain how to? I'm building it using Keras.
1
vote
1answer
29 views

Using LSTMs for continous learning and predicting

I'm trying to develop a model to predict a commodity price movement direction based on previous observations. The model should learn common technical analysis patterns, e.g. head and shoulders. So, I ...
1
vote
0answers
24 views

How to interpret training results

I am working on an image similarity network. I have around 90,000 pairs of images contain an equal number of positive and negative samples. For learning the similarity between image pairs, I used the ...
-1
votes
0answers
16 views

Keras - Preparing the Embedding layer with Word2Vec [closed]

I have a word2vec model. But I can't implement word2vec with keras embedding layer. In this tutorial, Preparing the Embedding layer section, they used GloVe. I want to use word2vec instead. How can I ...
2
votes
1answer
22 views

How do i get to make colab read my images from my google drive?

I havee about 2000 images, I have uploaded them to my Google drive. How do I make colab see and read these images. All the images are in one folder.
2
votes
1answer
29 views

Why does MAE differ after prediction (Neural Network)?

I'm having trouble understanding what's happening in the following code. I already have defined x_train, y_train, x_val, y_val and x_test which define my training, validation and test sets. I'm using ...
6
votes
1answer
55 views

Activation function between LSTM layers

I'm aware the LSTM cell uses both sigmoid and tanh activation functions internally, however when creating a stacked LSTM architecture does it make sense to pass their outputs through an activation ...
2
votes
0answers
12 views

How to create anchor-positive and anchor-negative pair for feature X in a signature data set for training Siamese network

How to create anchor-positive and anchor-negative pair for feature X in a signature data set for training Siamese network? Im have a cedar signature data set with 55 peoples signatures(classes) with ...
5
votes
5answers
152 views

How can we extract fields from images?

I am making an document parser which extracts data fields from the documents and store them in a structured way. Each field in my dataset is horizontal which is easy to extract. But the model fails ...
1
vote
0answers
26 views

Suggestions for building Localisation algorithm for 5 classes

I'm currently working on a project for object detection using a very light CNN model , but till now I was able to classify all 5 classes with ~94% accuracy with 5 layered CNN using Keras and now I'm ...
1
vote
0answers
20 views

How to classify unseen text data?

I am training an text classifier for addresses such that if given sentence is an address or not. ...
2
votes
0answers
32 views

From unsupervised to supervised in fraud detection

I have a question. I am working on the fraud detection domain. And I have data from imports to the country. As you can get from the title, I have unsupervised data. I do not know that the record is ...
0
votes
1answer
19 views

Keras generator Function

I am trying to write a batch generator function so that I can train my Keras model using it but I don't know from where to start. Does anyone have some examples or tutorials?
2
votes
1answer
23 views

Using embedding layer output as input to .fit() call in Keras

I want to build a classifier in Keras that predicts the next item bought by a customer (i.e. multiclass classification). One of the features I intend to input to the model will be the last item bought ...
1
vote
0answers
34 views

Errors loading tensorflow (.pb) model into c# (Tensorflow.NET)?

I'm new to tensorflow.NET and I am currently following the documentation online (TF.NET/Example) to import my trained CNN model from python into c#. So far I've imported my protobuf (.pb) file into ...
2
votes
0answers
17 views

Understanding the significance of LeNet-5 w/ MNIST data set

I'm beginning to learn about conv nets and started with what I understand to be one of the seminal works: LeNet-5. However, my limited experimentation doesn't seem to show any advantage over a single ...
1
vote
0answers
30 views

Cannot clone object <keras.wrappers.scikit_learn.KerasRegressor object at 0x7fdc9c3ba550>

Trying to hypertune ANN but getting an error while using fit..(grid1.fit(X_train, y_train)) Below is the code ...
1
vote
1answer
20 views

Need of Weighted Mean Squared Error

We have MSE and RMSE as evaluation metrics for regression problems. I have for some problems people use Weighted Mean Squared Error (WMSE) as the evaluation metrix. Below is the WMSE formula: Can ...
2
votes
0answers
16 views

Dense? or TimeDistributedDense? after LSTM layer in Keras

Dense and TimeDistributedDense, which one is suitable after LSTM layer in Keras? For example, ...
1
vote
0answers
24 views

Where can I get pre-trained weights for character recognition?

I'm doing a simple pipeline and I need a digit recognition algorithm. There are definitely pre-trained weights out there for character recognition, but I can't find them. They can be in Keras, ...
1
vote
0answers
15 views

Getting different result when converting keras model into tensorflow?

I'm trying to convert my Keras model into .pb format to be used in TensorFlow (specifically c# to import into Unity at some later stage). I have 4 output layers that return a heatmap. When I use the ...
2
votes
0answers
15 views

Is it possible to get prediction intervals in sequenced data RNN forecasting?

Is it possible to get prediction intervals in sequenced data RNN (keras+python)forecasting? For example: predicts your car sales or new purchase The question is: UserId 1 will change his car in the ...
0
votes
1answer
18 views

PELU activation: how does it work, and how to implement?

I have encountered PELU (Parametric Exponential Linear Unit) in the literature, but I can't find practical applications of it. Moreover, I have some questions about how it works: Are its parameters ...
0
votes
0answers
9 views

Freezing (graph) a CNN model with an intermediate layer as the output?

I'm looking for a way to freeze a CNN graph where the output is an intermediate layer. I've successfully tried both Model and K.function to get the intermediate layer as shown below. ...
2
votes
0answers
17 views

Masking seems not working for missing values problem in LSTM

I am trying to use LSTM to predict time series in keras. My input data shape is (1000,6,1)(samples,timesteps,features). There is some missing data in different timesteps. For example,[2,1,1]=NaN,[3,4,...
3
votes
1answer
24 views

How to quantitatively evaluate raw neural network activations?

Below are the activations for 2 different predictions. These predictions are for different labels/classes. They are being run through a dense Keras NN (96.6% accurate) with 2 hidden layers and adam ...
0
votes
0answers
15 views

How to input sentence embedding as a feature in Neural Networks?

After preprocessing, I have the pandas dataframe like in the screenshot attached. I want to train a Keras neural network model to classify the vectors into intents. The vectors here are LASER ...
0
votes
0answers
13 views

How can I load file from my local drive in keras using get_file?

I am using google colab and I need to load data from my local drive. How I can do that using get_file? what should be the origin?
3
votes
2answers
34 views

TensorFlow Sigmoid activation function as output layer - value interpretation

My TensorFlow model has the following structure. It aims to solve a binary classification problem where the labels are either 0 or 1. The output layer uses a sigmoid activation function with 1 output. ...
1
vote
0answers
31 views

please help with ValueError: Input contains NaN, infinity or a value too large for dtype('float64') [closed]

How to fix error ValueError: Input contains NaN, infinity or a value too large for dtype('float64'). Im thinking the error is from too large for dtype or an infinity. This is an imbalanced ...
2
votes
1answer
28 views

What is the correct way to call Keras flow_from_directory() method?

In the following article there is an instruction that dataset needs to be divided into train, validation and test folders where the test folder should not contain the labeled subfolders. Instead it ...
0
votes
0answers
10 views

CNN filter for music spectrograms

I am new to Data science and I am trying to build a neural Network to recognise Musical Instruments .. I am Kind lost here on how to choose the CNN filter size ?
2
votes
0answers
11 views

Keras model predicts differently when predicting based on video frame vs. individual snapshot

I'm training a binary image classification model in Keras, with the end goal of parsing through entire videos. I have a script that reads in a few snapshots from training videos and lets the model ...
4
votes
1answer
28 views

Training Machine Learning Model - Neural Network - Islands Problem

I was working on the following leetcode problem: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting ...
2
votes
0answers
33 views

How to use arctan2 function inside Keras model?

I'm trying to add arctan2 function to the end of Keras model, but it looks like it is not getting any near even local minimum. Here is my ridiculous but minimal ...
1
vote
0answers
30 views

Dataset for musical Instruments recognition

I am looking for a "rich" Dataset to Teach my model to seperate Music intruments .. any Suggestion ? I found the URMP Dataset but it doesn't have many files.. I appreciate your help thanks and happy ...