Questions tagged [keras]

Open source high-level neural network library for Python and R. Is capable of using TensorFlow or Theano as backend.

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

What would a reversed Inception v3 block look like for a convolutional autoencoder, specifically in the decoder block?

(I've been using Keras but if this is possible in PyTorch I'd be willing to switch my project.) I've been working with convolutional autoencoders and they look promising for my use case. One thing ...
0
votes
0answers
6 views

loss not decreasing with convolutional nn [duplicate]

I have data with 1414 columns and 21 features (1414, 21). It is a regression problem and I am trying to use CNN as a model. In order to use a cnn, I reshaped my ...
0
votes
0answers
15 views

How to properly use batch normalization during inference

I am trying to manually implement calculations of the image classification process using pre-trained weights from the MobilenetV2 network. I know how to apply filter weights to channels, but do not ...
0
votes
0answers
6 views

Keras fit_generator doesn't make one-hot vector in multi class CNN segmentation (U-Net) [on hold]

I set up U-Net (CNN) model for multi class segmentation and let it train. But when I try to make one-hot vector predictions in order to make prediction segmented maps, it creates float numbers ...
0
votes
1answer
25 views

type of the neural network

I am developing a neural network for a binary classification task. I am using the following code: ...
0
votes
0answers
6 views

Changing the the input shape in Keras for pre-trained model

I have a pre-trained Keras model which takes input shape of $(100,20)$. The system uses fully convolutional network with Conv1D and the subsequent processings are independent of the first dimension (...
0
votes
1answer
23 views

How to prevent the keras convolutional neural network model to over-fit? [duplicate]

I want to build a convolutional neural network and train it to recognise whether the digit is 0 or 1. Example of my training data is a 800 * 600 gray scale image containing a digit one: I have 22 ...
0
votes
0answers
18 views

Setting seeds despite repeated training of CNNs?

I would like to compare the classification performance (like accuracy, precision, recall etc.) of different CNN architectures. I'm using Google Colab (GPU support), Tensorflow and Keras. Since it is ...
-1
votes
2answers
28 views

Multiple metrics in keras - why and when might we want to use it?

In the keras documentation an example for the usage of metrics is given when compiling the model: ...
0
votes
0answers
7 views

Time Distributed Loss

I am currently working on implementing a time series prediction task that will produce labels across a sequence (batch, steps, features) -> (batch, steps, classes). I have a TimeDistributed layer as ...
0
votes
0answers
19 views

Loss function in Text Generation using word-level approach

I'm trying to solve a problem of sequence prediction, which is in similar in spirit to Text Generation. I've seen several tutorials addressing a word-level approach, such as this one, resulting in a ...
0
votes
0answers
19 views

How can a Keras convolutional network be defined such that it outputs images of the same dimensions as the input?

I wanna train a convolutional neural network to convert an input image to an output image, where the input and output images are of the same dimensions (50 pixels wide, 300 pixels high and greyscale). ...
0
votes
0answers
5 views

input_9 to have shape (10,) but got array with shape (2,) error when latent dimension of VAE is changed from 2 to 10 using keras

I am trying to change the latent dimension in the following code: https://www.kaggle.com/rvislaywade/visualizing-mnist-using-a-variational-autoencoder but when I run the last step I get an error ...
0
votes
0answers
14 views

What Keras models would be best for output of lists of word vectors?

Imagine a regression model that is to be trained on data consisting of questions and answers expressed in text. The questions and answers are converted to lists of word vectors using some good word ...
1
vote
0answers
23 views

Autoencoder predictions for extremely simple task does not make intuitive sense

I am training a simple autoencoder in Keras. The input is of length two, where each element can either be 0 or 1. This gives four distinct input possibilities: [0, 0], [0, 1], [1, 0], [1, 1]. Since ...
1
vote
1answer
12 views

Accuracy converging to one in neural network (tensorflow.keras)

I was wondering if somebody would be able to shine a light on accuracy converging to 1 relatively quickly during training. I am working on some new data and this is the first time i have seen this. ...
1
vote
1answer
21 views

Is there any deep learning work using unit norm constraints?

I am currently trying to develop an architecture that could benefit from a unit norm constraint on the convolutional weights. I saw in keras docs, that this constraint was available. Therefore I ...
0
votes
1answer
18 views

l2 lambdas in Keras.regularizers [closed]

Is the value supplied to the shrinkage regularizers (l1 and l2) in Keras the inverse of the lambda coefficient? e.g. ...
2
votes
1answer
37 views

AutoEncoder Reconstruction error for Anomaly Detection

I'm building a convolutional autoencoder as a means of Anomaly Detection for semiconductor machine sensor data - so every wafer processed is treated like an image (rows are time series values, columns ...
1
vote
0answers
18 views

Using LSTM to find mode of a sequence [closed]

I trained an LSTM network to predict the mode of a sequence of real numbers. I found the performance to be poor. Initially, I thought this is a fairly easy objective and LSTM networks would perform ...
0
votes
0answers
23 views

Weight initialization in neural networks

Hi I am developing a neural network model using keras. code ...
0
votes
1answer
94 views

How to compare CNN models with non-reproducible results?

I try to compare different CNN models. I use Keras and for training, I use a GPU, Google Colab with Tensorflow backend. Unfortunately I'm not able to create the same initial conditions for the CNNs (...
1
vote
1answer
15 views

step size in the first epochs of adam are too large [closed]

When I train models in keras with keras.optimizers.Adam(learning_rate=0.001), I typically get a history of the training error over the training time in epochs like in the plot below. This looks like ...
0
votes
1answer
55 views

Normalization of data before NN batch-wise using batch normalization layer?

I am using a code I altered for sound event classification. The original code, first iterated through all training examples (large chunk), gathered the mean and standard deviation, then normalized all ...
2
votes
0answers
58 views

Custom RMSE loss not the same as taking the root of built-in Keras MSE loss [closed]

I have defined a custom RMSE loss function: def rmse(y_pred, y_true): return K.sqrt(K.mean(K.square(y_pred - y_true))) I was evaluating it against the mean ...
0
votes
0answers
60 views

Mathematics behind single input, multiple output regression

I have sought some help and trained a regression model that takes in a single dependent variable Y and gives the three independent variable R, B and G as output. This has been done in attempt to ...
0
votes
2answers
68 views

Obtaining VAE reconstruction probability

How does one calculate the reconstruction probability? Let's look at the keras example code from here. Is the reconstruction probability the output of a specific layer, or is it to be calculated ...
1
vote
0answers
29 views

How to make a custom activation function in keras with a learnable parameter?

The answer to this question is generally to implement it as a new layer and do layer = Dense(num_neurones)(previous_layer) out = TheActivationFunction()(layer) ...
1
vote
1answer
22 views

What does Keras Concatenate actually do? [closed]

A simple question, but what does Keras Concatenate actually do?. If I have two input layers with size 200 each and pass them through a concat layer what has actually happened? Does it just mean the ...
0
votes
0answers
9 views

CNN Feature Extraction Time

I have a dataset consist of 260 thousands images that are extracted from several videos. I want to extract features of these images and use them for frame retrieval. I used VGG16 (pretrained on ...
0
votes
1answer
20 views

Reconstruction error drops for an anomaly?

I have a convolutional Autoencoder being used as an anomaly detector, it works well. Today however I trained it on a new training/test data set and the anomalies were exposed as a drop in ...
3
votes
1answer
148 views

Loss function (and encoding?) for angles

I'm training a network to predict the angle of arrival of a signal. Labels are single values in the [-180, 180) interval. I'm seeing a discontinuity in predictions around ±180 degrees, which makes ...
1
vote
1answer
174 views

Why is it hard for a neural network to learn the identity function?

I wanted to see if a neural network could learn the identity function using the MNIST handwritten dataset. Here is the full code ...
0
votes
0answers
7 views

Can a neural network independently change its learning parameters while the error between what was predicted and what was not the most minimal in R

I performed script which create forecast of usd/btc pair. Data was taken form open source https://www.cryptodatadownload.com/apac/ https://www.cryptodatadownload.com/cdd/Binance_BTCUSDT_1h.csv Here ...
0
votes
1answer
142 views

no attribute '_inbound_nodes' error even when using Lambda layer in Keras [closed]

I have a (28,000 x 300) dimension matrix, let's call it label_embedding, which I want to do a dot product with the bottleneck layer of my model. I have created an architecture which gives a (...
0
votes
1answer
36 views

Why is my neural network giving unequal probabilities when predicting an image that isn't one of the given classes?

Let's say I had 5 different types of images I wanted to classify in my neural network and I trained it on 10,000 images. When it is done training, I give it an image that it has never seen before and ...
0
votes
0answers
31 views

Using both batches and buckets in neural network

I think I understand what batches serve for in neural network training, especially after reading this question. It has also clear correspondence in libraries like Keras: ...
0
votes
0answers
14 views

How to improve CNN image classification model? [duplicate]

I have trained my CNN (without transfer learning) model with 736 training and 256 test data and I created my confusion matrix and a class report but my model didn't good classify the images. How can I ...
0
votes
0answers
37 views

Deep Learning for small 1-dim Datasets

I am trying to find a neural network architecture for a dataset (150 instances) with 10 features (numerical). The features are not associated to each other, so 1d-convolutions are not an option. ...
0
votes
0answers
11 views

Loss magnitude showing 0 at first epoch yet predictions are completely off

I'm trying neural network for the first time. I'm getting a weird output - while loss magnitude is apporaching 0 at the first epoch itself, the predictions are trash! can some one explain what's going ...
4
votes
0answers
60 views

Time series predictions look suspiciously good [closed]

I am working on a time series forecasting problem. For this, I am training a recurrent neural network in Keras (mostly following the guidelines from this blog post by Jason Brownlee). My problem ...
1
vote
0answers
7 views

Needing 4th dimension for shape [closed]

I was working on a transfer learning solution to categorize between diseases in the eye. I was using the Xception model built into Keras and it uses a data set that I was able to accumulate. However ...
2
votes
3answers
43 views

How can I create a neural network that can recognize objects without having data for objects that aren't in the classification set?

I have a data set of 10,000 images of 5 different recycling items. The goal of my neural network is to tell me if an item is recyclable or not. The problem is that I only have data for the 5 different ...
1
vote
1answer
292 views

How to implement 1D Convolutional Autoencoder with multiple channels? [closed]

I want to build a 1D convolution autoencoder with 4 channels in Keras. Instead of images with RGB channels, I am working with triaxial sensor data + magnitude which calls for 4 channels. I haven't ...
0
votes
1answer
29 views

How do I fix this dimenion error in keras / tensorflow? [closed]

This is the code I am trying to run. X is an array of shape (1000,26) and Y is of shape (1000, 1). I am trying to fit a model that predicts a 1 or a 0 for each row of the X array. For whatever reason ...
0
votes
1answer
19 views

Increasing sample size increases no of trainable parameters

I was working with keras and tensorflow as backend on an NLP problem when I observed that increasing my training data size caused an increase in the number of trainable parameters even when batch size ...
0
votes
0answers
14 views

How can I iterate on the hidden activations in a neural network? - Lifetime and spatial sparsity in WTA Autoencoders

I've built a convolutional autoencoder and trained it on MNIST in keras and tensorflow. I wanted to make this autoencoder a WTA autoencoder as talked about in this paper. To do so, I need to add ...
2
votes
0answers
43 views

How to choose number of neurons and hidden layers? [duplicate]

I followed this guy's tutorial on YouTube. Following is the code that was used for classifying 0 to 9 handwritten digits from MNIST dataset. The dataset contains 70,000 images of 28 x 28. Here, 60,000 ...
0
votes
1answer
115 views

Distorted validation loss when using batch normalization in convolutional autoencoder

I have implemented an variational autoencoder with convolutional layers in Keras. I have around 40'000 training images and 4000 validation images. The images are heat maps. The encoder and decoder are ...