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
0 answers
8 views

For a CNN Neural Network, why do we need to specify the number of nodes in the Conv2D function in Keras? [closed]

As I understand, in CNN, we are only doing dot product calculation on the image in the convolution layer. Below is an example of convolution code. ...
user avatar
0 votes
0 answers
18 views

is it good to have 100% accuracy on validation?

i'm still new in machine learning. currently i'm creating an anomaly detection for flight data. it is a multivariate time series data that include timestamp, latitude, longitude, velocity and altitude ...
user avatar
1 vote
1 answer
21 views

Correct loss function and metric for regression of count data in neural network

I am using a convolutional neural network to predict the number of occurrences of a certain pattern in time series data. Since there might be potentially any count of such patterns in a time series, I ...
user avatar
2 votes
1 answer
31 views

Restrict output range of a neuron based on output of other neurons

I have a neural network with three output neurons $X_1$, $X_2$ and $X_3$ with output range in [-1, 1]. I have many training data split in 80:20 ratio between training & testing sets. While ...
user avatar
  • 363
0 votes
0 answers
27 views

How to calculate Cosine Similarity from Keras model?

I'm trying to make hybrid recommender system that recommends movies to users from Movielens dataset. Its Content part is based on Doc2Vec model from gensim library and its Collaborative Filtering part ...
user avatar
0 votes
0 answers
4 views

Question about understanding Weights of Keras LSTM model

I am implementing Federated Learning (FL) using Keras LSTM. Starting with the simple example where multiple models are trained at different clients. Each client shares their model weights with the ...
user avatar
  • 382
0 votes
0 answers
24 views

Evaluation for LSTM model

I have created a model for text generation using LSTM. I am having chess sequences learned, reporting only the pieces moved during the moves. So when I move a pawn on my game there will be "p&...
user avatar
0 votes
0 answers
13 views

How to predict a mathematical progression with keras

I try the following model for a many-to-many recurrent network: ...
user avatar
1 vote
0 answers
12 views

Tensorflow - calling a model inside a GradientTape scope VS calling it inside a loss function

Is there a difference in the gradient computation between the two code snippets ... Code 1: ...
user avatar
0 votes
0 answers
11 views

Predict gaps in time-series using LSTM

I have the number of timeseries with missing values (gaps). I want to train the LSTM NN for the prediction gaps task. Each time-series have the different numbers of gaps. Now, I use the mean value ...
user avatar
1 vote
1 answer
15 views

Train a Final Machine Learning Model with Tensorflow

Based on a previous question and on this article, it is suggested that you split the data between train and test (or train/validate/test). But once you have control of your model, you should retrain ...
user avatar
  • 127
0 votes
2 answers
10 views

Do value and key of additive attention need to have the same dimension?

For the documented tensorflow-keras implementation of additive attention, it is stated that the input tensors are: query: Query Tensor of shape ...
user avatar
  • 101
0 votes
0 answers
6 views

Is RoI Pooling appropriate to retrieve fine details from objects of varying sizes?

I’m using a RoI Pooling after a CNN that extract features from images of varying sizes, containing defects I want to classify. The images and defects sizes range from a couple of pixels to ~100 pixels....
user avatar
0 votes
1 answer
25 views

Keras LSTM: how is stated maintained within a single batch?

Assuming Keras LSTM will reset internal state after each batch, I want to understand how internal state is maintained within a single batch. Suppose then, batch_size=4, timesteps=3 and num_features=1. ...
user avatar
  • 23
2 votes
0 answers
28 views

Is regularization in Keras equivalent to a standard Ridge or Lasso problem?

With the python package Keras, you can use $\ell_2$ or $\ell_1$ regularization but you have to use the option on each layer. But I definitely cannot tell if using ...
user avatar
0 votes
0 answers
44 views

Choosing the 'best' epoch to stop the training of neural network. Top accuracy not improving, but average is

I'm familiar with concepts like early stopping, and detection of plateau and so on. Tensorflow CNN training has a possibility of saving only best model too, according to model's accuracy metric (for ...
user avatar
0 votes
0 answers
16 views

Loss Jumps while Train a Fully Connected MLP

i am currently trying to train a Fully Connected MLP with vibration data from a machine aggregate for classification. During training, the loss jumps up abruptly in each epoch. Here is an excerpt of ...
user avatar
0 votes
0 answers
7 views

Return_State parameter in LSTM (Keras)

I'm a bit new to NLP, I've read multiple posts but couldn't find the intuitive purpose of setting return_state=True/False. I got answers like setting return_state will return cell output as well, this ...
user avatar
  • 101
0 votes
0 answers
31 views

Do I need linear output in a neural netework?

I tried to solve the XOR problem with 2 almost identical neural networks, see R Keras code below. What differs between the NN is that in the second network, I have ...
user avatar
  • 111
2 votes
0 answers
52 views

Using `relu` as activation function for regression with only positive values

I'm building a deep learning model to predict times of arrival. By definition, the time of arrival is always positive. I'm wondering if I can use a relu as the ...
user avatar
  • 31
1 vote
0 answers
79 views

What's the difference between stacked LSTM and encoder-decoder LSTM

I wanted to learn about encoder-decoder LSTM and after some digging around I get that the first LSTM layer in an encoder-decoder-LSTM outputs its hidden state and then the next LSTM layer uses that ...
user avatar
1 vote
1 answer
70 views

Choosing a model for machine learning problem

Update: See bottom of question for insight into the real application which this small example is attempting to simplify. Questin: In the different machine learning libraries, what kind of model suits ...
user avatar
  • 121
1 vote
0 answers
25 views

Training accuracy growing way faster than validation accuracy?

i've been trying to solve this classification problem using a convolutional neural network for some days but no matter what I do I can't seem to find the correct hyperparameters and configuration to ...
user avatar
1 vote
1 answer
110 views

How to get the probability a prediction is correct from a binary classifier

I have an image binary classifier that where class a = 0 and class b = 1 When I receive a prediction of a single image, is working out the probability that the prediction is correct as simple as: a: ...
user avatar
  • 11
2 votes
0 answers
54 views

Good performance on both training set and validation set, but poor performance on the test set

I'm building a CNN to classify the American Sing Language fingerprints. During training and validation it works very well, with accuracy going up to 95% and loss down to 10% on both. However, when it ...
user avatar
1 vote
1 answer
177 views

Multiple time series forecasting: How to split the data for training of a neural network

Use case: I have sales of 90 products during the first 180 days since the product launch. I want to train an LSTM network to predict sales 4 weeks ahead given the last 7 days of sales. The model ...
user avatar
1 vote
0 answers
39 views

TensorFlow/keras conversation score prediction

First the question: I'm new to machine learning and have made a first attempt at predicting scores (see problem below). I'm now looking for the right way to set up the model (layers, activations, ...
user avatar
  • 121
1 vote
0 answers
35 views

the value of accuracy and loss change by the order of the training

https://colab.research.google.com/drive/13wMNCXxKs_uqFVzuJqE2zxhsxWK8Ya4k?usp=sharing Hello guys I’m having a hard time trying to figure out what I am doing wrong here. I used 4 pretrained models from ...
user avatar
1 vote
0 answers
18 views

Best way to represent size classes features in neural network

I have features representing a some specific size category, where a data sample has assigned one out of 110 possible size classes. What it is important that these classes are sorted from smallest to ...
user avatar
1 vote
0 answers
14 views

Linear Regression vs Keras [duplicate]

I created a dummy dataset and compared the performance of SKLearn LinearRegression and Keras. Why is Keras producing horrible results compared to Linear Regression? Code: ...
user avatar
0 votes
1 answer
95 views

Why my training Precision and Recall is higher than Validation Precision and Recall?

I am training a deep learning model for binary image classification using Keras and TensorFlow. My model gave the highest ...
user avatar
1 vote
0 answers
18 views

Why my training Precision and Recall is higher than Validation Precision and Recall? [duplicate]

I am training a deep learning model for binary image classification using Keras and TensorFlow. My model gave the highest ...
user avatar
6 votes
3 answers
1k views

Impose a condition on neural network

I am building a neural network model with TensorFlow and Keras in python. My model is performing well on unseen data in the way I desire and everything is fine. but the problem that I don't have any ...
user avatar
1 vote
0 answers
77 views

How to apply Keras Conv1D over 3D dimensional input?

Context: I'm predicting whether a machine will break down within 1 hour, and I have sensors located at 4 different parts of the machine, which give me historical readings of different metrics. ...
user avatar
1 vote
1 answer
33 views

Why are my classification outputs sometimes saturating? [closed]

I have built a binary classifier (FWIW - using Keras) but the output values saturate at a value considerably < 1 (see plot). Is this likely to be implementation problem? Is it because the model is ...
user avatar
  • 125
2 votes
1 answer
62 views

What is a good binary_crossentropy or categorical_crossentropy?

I am training a binary classification model using LSTM and the training binary_crossentropy loss went from 0.84 to 0.83. I want to know what is a good binary_crossentropy loss value? There seems to be ...
user avatar
1 vote
0 answers
83 views

LSTM RNN always predict the same class

I have following code ...
user avatar
  • 11
0 votes
0 answers
23 views

Can Grad-CAM be used for CNNs with a flatten layer?

I would like to visualize CNNs with a flatten layer. I looked into Grad-CAM, which is one of the most popular visualization methods for CNNs, but I thought it could only be used for CNNs with a global ...
user avatar
  • 1
0 votes
0 answers
59 views

Why applying Grad-CAM to the input layer is not common?

Grad-CAM is a popular tool that could be applied to the last convolutional layer to understand the inner structure of the deep neural network. It is general to apply Grad-CAM onto the last ...
user avatar
0 votes
0 answers
18 views

How to determine the number of hidden layers a model needs? [duplicate]

I built a multi-layer perception model, from online tutorials. They are very good tutorials. However, when I come down to build my own model, with 32 variables(input layer), one output(regression ...
user avatar
0 votes
0 answers
75 views

Many-to-many time-series prediction problem

I would like some advice on how to implement an RNN or LSTM for my problem. I am working in Keras Tensorflow. My data describes the moisture % histogram of a sample of material. There are 42 features ...
user avatar
0 votes
1 answer
36 views

Interpretation of plots from neural network

I am working on a Keras and TensorFlow in R and I trying to make good predictions for a regression problem. Below you can see how is look like plots two plots one for loss function and second for mean ...
user avatar
1 vote
0 answers
165 views

How to deal with zeros in neural network? [closed]

I am working on a Keras and TensorFlow in R and I try to make good predictions for a regression problem (not classification). In my dataset there are several features and my target variable has a lot ...
user avatar
1 vote
0 answers
51 views

Should Skip Connections be Fed through Activation?

I'm creating a genetic algorithm to evolve the architecture of Convolutional Neural Networks, which includes skip connections. I have two questions: Where should skip connections start? - after ...
user avatar
  • 111
0 votes
0 answers
94 views

Are convolutional autoencoders required to have symmetric encoders and decoders?

I am a newer to deep learning. Recently I am studying the convolutional autoencoder (CAE). I found the architectures built with keras and matlab are a little different. In particular, the architecture ...
user avatar
1 vote
0 answers
13 views

Strange behaviour of training accuracy and loss function

Firstly, I want to mention that I am not looking for suggestions to improve the training accuracy of my NN. The only purpose of this question is to know what might be causing the peculiar behaviour ...
user avatar
  • 111
0 votes
0 answers
16 views

Categorical variable converted to embeddings using Embedding layer visual depiction

Say I have a dataset with 3 features 1) Date 2) dayOfWeek with values Sunday to Saturday 3) Number_of_customers If I use One-hot-encoding to convert "dayOfWeek" feature to numeric ...
user avatar
  • 1
0 votes
0 answers
12 views

How to deal with the input lack of multi-model fusion in machine learning?

For a target value Y,I want to construct machine learning models to regress.And For my Input,I have Input1,and Input2,Note both of them is related to Y,We can build model M1(Input1,Y),and can build M2(...
user avatar
2 votes
1 answer
394 views

How to train a neural network to minimize two loss functions?

For TF/Keras (or in general), what is the best way to define a multidimensional y target? Should this even be done? The problem: Any sample x tries to predict several "values of interest". ...
user avatar
  • 23
0 votes
0 answers
16 views

Is Validation Set always necessary for chatbot if I have Admin to update the datasets?

I'm creating a chatbot and I only have 480 inputs. The Training Model is about 0.97 percent and the loss is about 10 percent. Unfortunately, the validation accuracy and loss is low. The val_loss is ...
user avatar

1
2 3 4 5
14