Questions tagged [gated-recurrent-unit]

A Gated Recurrent Unit (GRU) is a type of unit in a recurrent neural network.

80 questions
2
votes
3 answers

Keras GRU model predicts only [-0., -0., -0., -0., -0.]

I'm trying to predict 5 periodic prices of cryptocurrency based on previous 50 inputs. >>> X_train.shape, X_test.shape, Y_train.shape, Y_test.shape ((291314, 50, 8), (72829, 50, 8), (291314, 5), (72829, 5)) Here I have 50 previous samples x 8…
Vassily
  • 5,263
  • 4
  • 33
  • 63
2
votes
0 answers

Tensorflow Stacked GRU Cell

I am trying to implement a stacked RNN with MultiRNNCell and GRUCell in tensorflow. From the default implementation of GRUCell, it can be seen that the "output" and the "state" of the GRUCell are the same: class GRUCell(RNNCell) ... def…
2
votes
1 answer

Tensorflow RNN input size

I am trying to use tensorflow to create a recurrent neural network. My code is something like this: import tensorflow as tf rnn_cell = tf.nn.rnn_cell.GRUCell(3) inputs = [tf.constant([[0, 1]], dtype=tf.float32), tf.constant([[2, 3]],…
2
votes
0 answers

how to train data with large differences between values

I'm currently working on recurrent neural networks for text-to-speech but I'm stuck at one point. I've some input files and they have characteristic features of text(phonemes etc.) with dimension 490. The output files are mgc(60-d), bap(25-d) and…
1
vote
1 answer

how to add unrelated training data with an embedding layer?

I am beginner in RNNs and would like to build a model gated recurrent unit GRU for predicting a user's action on an E-commerce website called google merchandize store that sells Google branded merchandise. We have 5 different actions: Add to…
1
vote
0 answers

Pytorch GRU Trained on one class to Predict Unlabelled Data

I am creating a GRU to predict if data derived from traffic packets from a device is considered safe or anomalous. I plan to do this by training a model only on safe/ normal operating data and then having it check what it considers new unseen…
1
vote
0 answers

GRU Failed to call ThenRnnForward with model config

I am working with a multi classification problem using GRU architecture. It seems to have a configuration error. Please help me to debug the model. Thanks in advance. Here I have provided the model: # build the network model =…
1
vote
0 answers

What is proper way to mimic keras timedistributed layer in pytorch?

I'm trying to mimic TimeDistributed in PyTorch just like keras TimeDistributed. please see below model class GRULinear(nn.Module): def __init__(self,input_size, hidden_size, num_layers, batch_first=False): super().__init__() …
1
vote
0 answers

PyTorch: GRU, one-to-many / many-to-one

I would like to implement a GRU able to encode a sequence of vectors to one vector (many-to-one), and then another GRU able to decode a vector to a sequence of vector (one-to-many). The size of the vectors wouldn't be changed. I would like to have…
1
vote
0 answers

Adapting an LSTM Encoder Decoder sequence prediction loop for GRUs

How do I resolve this error? ValueError: Layer model_101 expects 2 input(s), but it received 1 input tensors. Inputs received: [] I am following the guide from Jason Brownlee on how…
Simon
  • 101
  • 1
  • 6
1
vote
2 answers

RNN - RuntimeError: input must have 3 dimensions, got 2

I’m getting the following error: RuntimeError: input must have 3 dimensions, got 2 I have a single feature column that I am trying to feed into a GRU neural net. Below are my data loader and neural net. I have also included the output of my data…
1
vote
0 answers

Trigger Word Detection training giving wrong predictions

After completing the assignment on trigger word detection in Andrew ng s course. I made some training examples and tried the same model but eventhough the accuracy is .88(which is not great considering the skewness of the data) the model is doing…
AVA
  • 173
  • 1
  • 1
  • 6
1
vote
1 answer

What do W and U notate in a GRU?

I'm trying to figure out how to backpropagate a GRU Recurrent network, but I'm having trouble understanding the GRU architecture precisely. The image below shows a GRU cell with 3 neural networks, receiving the concatenated previous hidden state and…
1
vote
0 answers

Converting Keras Gru model to tf-lite

I am trying to convert my custom Keras model, with two bidirectional GRU layers, to tf-lite for use on mobile devices. I converted my model to the protobuff format and tried to convert it with the given code by TensorFlow: converter =…
1
vote
1 answer

RuntimeError: Expected hidden size (2, 24, 50), got (2, 30, 50)

I am trying to build a model for learning assigned scores (real numbers) to some sentences in a data set. I use RNNs (in PyTorch) for this purpose. I have defined a model: class RNNModel1(nn.Module): def forward(self, input ,hidden_0): …