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
1
vote
1answer
18 views

Adding a vector of values to encoder output in autoencoder (keras)

I am experimenting with autoencoders for a very specific application, but cannot unfortunately go into the specific details of what I am doing yet (fingers crossed I can do so after I make some ...
1
vote
0answers
22 views

ML Methods for Multi-Class Classification with Categorical Inputs and Outputs

Suppose we have $K$ features and a target that can take on integral values between $1$ and $M$. These are nominal and thus converted into categorical (dummy) variables via one-hot-encoding. More ...
0
votes
0answers
10 views

Keras returns nan with power equation [closed]

I'm trying training the simple model at the bottom: A dense layer and then a custom function(tf.pow(net, self.n)) forward pass gives a results but training returns ...
1
vote
0answers
18 views

My validation loss and binary accuracy has overshoots

I have built MLP network using 10 hidden layers I am seeing a lot of overshoots in the validation for loss and accuracy. Does anyone know why this is happening? I have 66 input variables and each ...
0
votes
0answers
14 views

Time series forecasting: very low loss but prediction is totally off [closed]

I just started ML learning using time-series forecasting with LSTM. I am training the model using a dataset of shape (1, 100, 1) (1 batch, 100 steps, univariate timeseries) over and over again (in ...
0
votes
0answers
16 views

Why is a MLP not converging on the fashion MNIST dataset, when the features are not scaled? [duplicate]

I build an MLP to classify instances of the fashion MNIST dataset. You can run/modify the code in this Google Colab Notebook. Why exactly is the model not converging when ...
1
vote
1answer
32 views

How does the batch size affect the Stochastic Gradient Descent optimizer? (Example using Keras)

First of all, I know that there are lots of questions and answers about the topic throughout the site $-$ such as here, here or here (and I've probably read them all). However, I am still confused. ...
-1
votes
0answers
38 views

Custom activation, problem loading keras model [closed]

I have added a custom activation to my keras model by running: ...
0
votes
0answers
21 views

It is possible train a neural network for soccer players prediction?

I have a large number of players stats, such as goals, assist, meters run, passes, etc.. of 3 seasons. I would like to know if I can feed the Neural Network with the data and it will return the best ...
0
votes
0answers
30 views

Stratified K fold same index present in both test and valid set

I am trying to do a stratified k fold cross validation for my dataset and want to keep an isolated 10% test set from the dataset and use the remaining for training and validation. Below is the code ...
1
vote
0answers
17 views

Use LSTM to predict the proportion of steps with nonzero feature values

I am trying to do a simple regression for sequences. Each input $X_i$ is a $n=2000$ by 1 matrix, formatted as $n_i$ 0-s followed by $(n-n_i)$ 1-s. The output $y_i$ should be $n_i/n$, i.e. the ...
0
votes
1answer
17 views

Is there a Fastai vision's unet_learner equivalent in keras?

I have implemented Fastai vision's unet_learner successfully to get results. However, due to hardware compatibility issues, I have been forced to shift to TensorFlow, on reading equivalent for Fastai ...
1
vote
1answer
30 views

Is the number of cells in a keras LSTM or RNN layer equal to the number of time steps?

Say I have the following code to create a LSTM layer: lstm_model = Sequential() lstm_model.add(LSTM(128, batch_input_shape=(BATCH_SIZE, TIME_STEPS, FEATURES)) ...
0
votes
0answers
18 views

validation accuracy is fluctuating in a neural network?

Network architecture is as follows: dataset features(input_expansion) are expanded by using chebshy polynomial then i got(Exp_layer), split the dataset into train and test and applied back ...
0
votes
0answers
43 views

What should i do when my recurrent neural network doesn't improve? [duplicate]

I am training an LSTM network using Tensorflow 2, is there a way to debug it to see if its learning or to know what areas should be adjusted ? Is there a way to debug to know if its the data, the ...
0
votes
0answers
10 views

How to pass this mock one-hot-encoded data through keras LSTM layer?

As (I think) I understand in Keras, LSTM layers expect input data to have 3-dimensions: (batch_size, timesteps, input_dim). However, I'm really struggling to ...
1
vote
0answers
28 views

Cross validation with Early Stopping

I would like to use EarlyStopping in k-fold cross-validation framework but not to find the optimal number of epochs, but only to reduce overfitting during the trainings runs. However, I would like to ...
0
votes
0answers
13 views

Calculating the Accuracy of a Keras Neural Network in Python [duplicate]

I have created a Keras neural network. The neural network was trained during eight epochs, and it outputs this loss value and accuracy: ...
-2
votes
0answers
28 views

What is the meaning of the coefficients returned by a neural network

Say I define the following neural network in Python ...
0
votes
0answers
6 views

Sudden Changes in validation loss

I am training a CNN with following configuration Conv1: Filter Size 3*3 # filters 16 Pool1: Filter size 2*2 strides = 2 Conv2: Filter Size 3*3 # filters 32 Pool2: Filter size 2*2 strides = 2 Dropout ...
0
votes
1answer
23 views

Using Lime on a binary classification neural network

I would like to use Lime to interpret a neural network model. For the sake of this question, I made a simple Dense model using this dataset: https://raw.githubusercontent.com/jbrownlee/Datasets/...
0
votes
1answer
43 views

Difference between TimeDistributed and convLSTM2D layer in Keras? [closed]

I am working on RNN(CLSTM) and in examples i see somewhere layers.convLSTM2D() and somewhere i see ...
1
vote
1answer
30 views

CNN filters with different size using Keras

CNN can have multiple number of filters on raw input data. Normally I specify the number of filters needed as 'filters= 250 ' and the size of the filter as 'kernel_size= 3'. (This means I will make ...
0
votes
0answers
16 views

Keras - Preparing the Embedding layer with Word2Vec

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 ...
0
votes
0answers
46 views

encoding categorical time series data with missing value

I am trying to pre-process (encode / normalize / standardize) my time series data where values are categorical and there exist, two types of nan values ...
0
votes
0answers
18 views

Adding binary variable to sequence predicting y?

I would like to predict the relationship between two independent variables and a dependent one (model1): x1 + x2 = y Now, x1 is a sequence of vectors (a document composed of a sequence-of-sentences)...
0
votes
0answers
16 views

How can i define a range of correct answers for an neural network, that predicts a continous value?

Take for example a NN that predicts the height of an animal. If the NN predicts a height within +/- 1 cm of the actual height the answer would be correct. I can not find options for this in e.g. Keras....
0
votes
1answer
51 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 ...
0
votes
0answers
14 views

Neural net (feedforward) does not converge on solution for linear regression [duplicate]

I'm trying to fit a linear regression model, using a neural network developed in Keras. The following figure (1) shows 10 different realisations of the regression line. Some lines line up nicely, ...
3
votes
1answer
129 views

Learning a simple majority-vote model with a neural network

I've been learning about neural networks with the idea of applying them to analyze a psychology experiment. I thought I had a handle on them when I got reasonable performance on previous toy datasets, ...
0
votes
1answer
23 views

What does it mean to save optimizer states in deep learning libraries?

I was recently going through the Keras documentation on saving models. I am aware that saving a model involves saving the learned weights and biases after training. However, the doc also mentioned ...
1
vote
0answers
14 views

Tensorboard: Why does validation loss get evaluated after training loss stops?

When I monitor my model through Tensorboard, I notice that Tensorboard stops plotting the training loss but not the validation loss. Since the early stopping module, as I set it up below, is ...
0
votes
1answer
19 views

LSTM - Who are the inputs for those hidden cells?

I'm learning RNN and I'm understanding, but I have a specific question that I can not find answer: What is the x input for the cells (pointed in yellow) for the ...
1
vote
1answer
35 views

Training a neural network, I can't figure out my learning curves [closed]

I am cross validating a model, splitted in 5. Then I plotted for each split, the loss and the val_loss by epochs. I get something like that: I found this plot disturbing. Only the first one seems "...
0
votes
0answers
14 views

Using label encoder on a categorical feature that we want to embed

I have a dataset with feature that have very high cardinality, doing one-hot encoding is not an option because of memory limitations, so I am currently label encoding this feature and then I feed that ...
1
vote
1answer
50 views

How does Keras work with probabilities and Sigmoid function? [closed]

I am trying to clasify a text by the main sentiment, positive or negative, with Keras. However, even though the code works, i don't completely understand two things. 1.How does the Dense layer with ...
0
votes
0answers
14 views

video normalization using skvideo

I'm building a model that would take as input a video of 25 frames and would (ideally) output the next 25 frames. My question is when we use images we usually normalize by dividing the X by 255. ...
1
vote
1answer
41 views

Choosing activation and loss functions in autoencoder

I am following this keras tutorial to create an autoencoder using the MNIST dataset. Here is the tutorial: https://blog.keras.io/building-autoencoders-in-keras.html. However, I am confused with the ...
0
votes
0answers
22 views

grid search with early stopping - influence of validation data to grid search results?

I would like to combine grid search with early stopping by passing a separate validation data set (used for early stopping) to grid search. However, I wonder when I use during the entire grid search ...
1
vote
0answers
17 views

How to accelerate CNN training using fit generator [closed]

I have a dataset of 60000 images which I split in train and validation set (80/20) and I use ImageDataGenerator to get the images from disk as batches of size 32. I ...
3
votes
2answers
189 views

Dense vs Sequential Layers in Keras

What is the difference between and a Dense and a Sequential Layer in Keras? They seem to be both just another layer in a neural network.
1
vote
0answers
30 views

Tensorflow - simple multilayer perceptron not stabilizing around mean of normally distributed y-values

I'm building an FX trading model where I'm trying to predict the +/- movement of a currency pair 5 minutes into the future. I've had some promising results adapting the model as a classifier (i.e., ...
1
vote
1answer
30 views

How to feed multivariate spatio-temporal data into cnn?

After trying to find an example for quite a while, I finally came to ask my question here: What I have: I have a temporal sequence of 2d spatial data with 100 cells(or pixels) in longitude and 30 ...
1
vote
1answer
24 views

Linear Regression coefficients through ANN

I am struggling to get ANN to estimate constant and coefficients of a linear regression problem. Unfortunately my results are way off from the expected. Kindy take a look at the reproducible code ...
0
votes
0answers
9 views

tf sumpooling layer 1d vs 2d

I am currently working on a paper by Sturm et al. (2016) published in the Journal of Neuroscience trying to replicate their results using python and TensorFlow, Keras libraries. I have strong doubts ...
0
votes
1answer
71 views

Conv2D Kernel size for audio-related tasks

So I've been working on this audio-rec task for a while now, and I've had some good luck using 2D convolutions on the spectrogram of audio (I've also tried Mel-spectrograms, the difference is minor in ...
1
vote
1answer
101 views

Why can't this autoencoder reach zero loss?

I'm building an autoencoder and was wondering why the loss didn't converge to zero after 500 iterations. So I created this "illustrative" autoencoder with encoding dimension equals to the input ...
0
votes
0answers
21 views

Accuracy metric in LSTM not considers time offset for multivariate time-series classification?

So this is a kind of complex question, so I hope I formulate it good enough. I have a human activity detection task that binary classifies if a user does a specific action or not. For me, it is ...
0
votes
1answer
17 views

Keras--variational auto-encoder in R studio, which part is defined as Encoder?

This is the example given on VAE, the circle part is something I do not understand. It defined the encoder part as from (X to Z_mean), but my understanding is from(x to Z). Or it just simply does not ...
0
votes
0answers
8 views

How are Filters values in keras decided

When we use CNN in keras, we only specify kernel size for filter in Convlayer. Let's say I chose 3x3 64 filters. But then, How would all these 64 filters have values? how is it automatically given ...

1 2 3 4 5 10