Questions tagged [keras]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
2 views

Binary classification for variable outputs

I am creating a binary classifier in Keras and here's the code ...
0
votes
0answers
3 views

Can tanh be used as an output for a binary classifier?

I am creating a binary classifier in Keras and here;s the code ...
1
vote
0answers
6 views

I am having issues with the output dimensions of my neural network

I am trying to make an image denoiser using a neural network in keras. I have 2 sets of images, un-noised images, and the same images with noise. All the images have the dimensions of (200,200,3). I ...
0
votes
0answers
28 views

Transfer learning on new image size

Transfer learning: Take a trained neural network and use it for a new classification task. When we want to use transfer learning with a convolutional neural network, we don't have to use the same ...
1
vote
1answer
22 views
0
votes
0answers
11 views

How to maintain CBOW dataset dimension and fit it in Neural Network?

I am new to neural network. I'm trying to train word embeddings without using word2vec package. Using titles from reddit worldnews dataset I'm have done some CBOW representation. For window size ...
0
votes
2answers
32 views

How to build a hybrid graph with CNN and RNN Architecture?

For an instance, we have M matrix of size n*k, I would like to treat each matrix independently and perform the convolution operation at each one in order to introduce to an LSTM layer the outputs of ...
0
votes
0answers
15 views

Multi-label classification + restriction of predicted classes

Good day. Please help to find a solution. I have built classification for goods to choose the best supplier (tf+keras+lstm) using https://www.tensorflow.org/tutorials/keras/basic_text_classification ...
0
votes
0answers
32 views

How multi layer LSTM are interconnected?

I am trying to understand the layers in LSTM for my own implementation using Python. I started with Keras to getting familiarized with the layer flow. I have tried the below code in Keras and I have ...
0
votes
0answers
15 views

How to load model using Microsoft.ML.Tensorflow?

I'm trying to load model using tensorflow. The model is converted from .h5 to .pb using this method: ...
0
votes
0answers
7 views

Increasing the no. of FC layers increases the size of the model … Image Classification

I have trained a model using Transfer Learning. There are 13 Image classes and around 2000 images in Total. I have trained various models varying the FC layers and their dimensions. For ex: 1 ...
0
votes
0answers
19 views

Error when checking input: expected dense_67_input to have shape (9,) but got array with shape (8,)

I have a dataset like ab, 1:8 9:9 10:10 cd, 2:0 3:1 mn, 4:5 om, 6:9 9:5 First read and encode data like ...
1
vote
1answer
23 views

Is hyperparameter tuning more affected by the input data, or by the task?

I'm working on optimizing the hyperparameters for several ML models (FFN, CNN, LSTM, BiLSTM, CNN-LSTM) at the moment, and running this alongside another experiment examining which word embeddings are ...
0
votes
0answers
11 views

How to convert model.h5 to model.pb?

I wrote in google-collab to get the model using keras, but I have to do predictions in Visual Studio using tensorflow I've search for a method converting models from keras .h5 to tensorflow .pb, but ...
0
votes
0answers
11 views

How to add layers of one model to another model in Pytorch?

Like in Keras we can add layers of one model to another model using the following commands - ...
0
votes
1answer
20 views

Adding machine learning classifier at the end of CNN layer

I wanted to use the CNN as feature extractor for my images and then fed these features to some machine learning classifiers such as SVM, decision tree and KNN. However when I was trying with SVM I got ...
1
vote
1answer
30 views

How to Improve Low Accuracy Keras Model Design?

I am trying to train a system that looks at some data points and predicts the quantity of surfers on a surf break. I have labeled the pattern for the past 2 months and I have 1500+ training examples ...
0
votes
0answers
16 views

How can I reduce the noise of prediction graph?

I am trying to use LSTM to predict a time series data as you can see in the following image, the predicted graphs is very noisy: The original data is looking like this: That I normalized it like ...
0
votes
0answers
5 views

Does BatchNormalization Layer supports Masking Layer?

I am using keras to implement my network architecture. Suppose I have one training sample with six columns in X_train as [45,2,4,67,0,0] where I have appended my training sample with '0' values as to ...
0
votes
0answers
6 views

Multivariate Multilag Regression with one shot prediction using LSTM

I am working on a multivariate regression task using a LSTM and I am interested in one shot prediction of my target variable (which is the price of a commodity). For example, the first parameter I ...
0
votes
1answer
16 views

ensuring that dependent variable decreases monotonically with independent variable

I have one key relationship between a numeric independent variable X and a numeric dependent variable Y, which is like a negative exponential function determined by 2 parameters. There are other ...
2
votes
1answer
47 views

How to add a new category to a existing trained deep learning model?

i have trained my deep learning model initially with 5 classes now i want to add another class without training the whole model over again for those 5 classes. How can I do that?
1
vote
1answer
94 views

tflite_convert a Keras h5 model which has a custom loss function results in a ValueError, even if I add it in the Keras losses import

I have written a SRGAN implementation. In the entry point class of the Python program, I declare a function which returns a mean square using the VGG19 model: ...
0
votes
1answer
16 views

How to get tf tensor value computed in loss function in keras train_on_batch without computing it twice or writing custom loop?

I have a model and I've implemented a custom loss function something along the lines: ...
0
votes
0answers
19 views

How to convert Keras h5 to PyTorch pth format?

I have trained a feature extractor in Keras and saved the weights as a h5 file. Now I want to load the same weights into the same model created and initialized in PyTorch for performance comparisons. ...
0
votes
0answers
10 views

Equivalent of tf.constant(size,size) in Keras

Can we upsample a 'inp' of size (64,64,128) input to (129,129,128) using keras In tensor flow, we can achieve this using api mentioned below tf.image.resize_nearest_neighbour(inp,tf.constant([129,...
0
votes
0answers
18 views

Keras - Deal with inputs of 2 different shapes

I'm trying to make a model that deals with categorical data of the shape (891,4,20) and numerical data of the shape (891,4). To explain further, the categorical data has 891 sequences, 4 different ...
0
votes
0answers
3 views

How to find layer-wise split of non trainable parametes in keras?

I am working on an image classifier using a CNN architecture in keras. I Instantiated a model with several Conv2D layers followed by batch normalization layers and Pooling layers and then a fully ...
0
votes
0answers
27 views

Why is this network not overfitting?

I wanted to try to make a neural network that deliberately overfit the data, but i cannot get it working. It won't converge properly, even if i lower the complexity of input/output values. I suspect ...
0
votes
0answers
34 views

Hyperbolic coordinates (Poincaré embeddings) as the output of a neural network

I'm trying to build a Deep Learning predictor that takes as the input a set of word vectors (in Euclidian space) and outputs Poincaré embeddings. So far I am not having much luck, because model ...
1
vote
1answer
24 views

Is there a different between one hot encoding and labelling categorical as scalar value and then normalise the batch?

Let's say I have label = ['Male', 'Female', 'Undefined']. Is there a difference if I label it as: ...
0
votes
1answer
29 views

Keras binary classification model is not learning anything. How to improve my model?

I am trying to train a binary image classifier on a an imbalanced dataset of images which are really small in dimensions(the largest dimension is 40*70). I am augmenting images by grayscale, rescaling ...
0
votes
1answer
16 views

What are the best activation functions for Binary text classification in neural networks?

I know that there are many activation functions like Relu, sigmoid, tanh ..etc, I just want to know the best one for my case - Binary text classification. I have heard that Relu is best for Binary ...
0
votes
0answers
14 views

Converting a Keras model to PyTorch

I have a Keras h5 file that I want to load into the same model but this one is created using PyTorch. Is ONXX a viable intermediary option? What else can I use?
0
votes
0answers
17 views

Dealing with varying number of units in the output dense layer?

I am using Keras to build my architecture. I want to assign the length of row of y_train as output unit to my output dense layer, i.e. I want output layer to have different number of neurons for ...
0
votes
1answer
32 views

Is this a valid way of training a model ? training loss in 1.1921e-07?

While training a keras model, i got this logs. Epoch 49/50 2/2 [==============================] - 2s 943ms/step - loss: 1.1921e-07 - acc: 1.0000 As per my ...
0
votes
0answers
40 views

Tensorflow + Keras: constructing the composition of two networks

I have loaded two networks using tensorflow and keras: ...
3
votes
0answers
33 views

How to use PCA in CNN for image recognition using Keras?

I created a CNN model for image classification and I want to use Principal Component Analysis (PCA) but when I run pca.fit() code, the code still running for hours ...
0
votes
1answer
7 views

SRGAN Generator Architecture: Why is it possible to do this elementwise sum?

Consider the first residual block. Its first convolution layer takes in inputs: THe PRELU's output 64 filters(64 outputs) each one being 3*3 with a stride of (1 ; 1) So I think that the output of ...
0
votes
0answers
18 views

How to deal with variable length sequences in keras for MLP?

I am using Keras for implementing my MLP neural network architecture. Suppose I have input_shape = (5000,8) for my architecture where columns 7 and 8 are simple integers (positive), but the problem ...
0
votes
1answer
24 views

Handling variable output units in MLP?

I am using Keras to build my architecture. The regression problem I am trying to solve has outputs different for different training samples. Suppose that I have very first two rows of ...
0
votes
0answers
9 views

LSTM training one time step at a time, and accessing prediction after each time step

I have been playing around a bit with keras LSTM but I have some confusion about it's potential applications and how to make use of it. I am new with RNNs so please correct me when I am wrong. Say ...
0
votes
1answer
36 views

How to make forecast in LSTM with specific/defined feature values

I am analyzing the avocado dataset to predict the future prices of avocado depending on the region and type (organic/conventional). I've trained my model which seems to be working. The test results ...
0
votes
1answer
21 views

Getting Value Error while training a model for binary classification

While training a sequential model using Keras, Im getting this error The model summary is shown below ...
0
votes
0answers
9 views

Multitask learning in Keras issue

I am implementing multitask regression model using code from the Keras API under the shared layers section. There are two data sets, Let's call them data_1 and <...
0
votes
0answers
16 views

How to implement N-Dimensional Convolution in TensorFlow / Keras? (with N > 3)

I had an idea for a model that requires multidimensional convolution (i.e. 4D or more). However, I can't find anything higher than 3D Conv on the TF 2.0 / Keras module. Is there a way to implement ...
1
vote
1answer
11 views

Keras: Misunderstanding what Keras does when invoking a Model, providing an Input?

In a class named Generator, I have defined a model with the below method define_model: ...
2
votes
2answers
36 views

Trying to understand encoder-decoder sequential models in Keras?

My understanding is that for some types of seq2seq models, you train an encoder and a decoder, and then you set aside the encoder and use only the decoder for the prediction step. For example this ...
0
votes
0answers
14 views

LSTM validation loss not improving

I'm a noob in the ML world and am currently building an LSTM to forecast the next page a user is going to visit on a website. My dataset is pretty much a mapping (with sliding window) from one page to ...
2
votes
1answer
28 views

Keras: Misunderstanding the Conv2D's param “filters”?

From https://keras.io/layers/convolutional/ (Conv2D): ...