jzilly / RecurrentHighwayNetworks

Recurrent Highway Networks - Implementations for Tensorflow, Torch7, Theano and Brainstorm
MIT License
403 stars 70 forks source link

RHNCell throws ValueError during application #18

Open tastyminerals opened 6 years ago

tastyminerals commented 6 years ago

When I attempt to use RHNCell it throws:

ValueError: Dimensions must be equal, but are 50 and 100 for 'Train/Model/recurrent_loop/recurrent_loop/multi_rnn_cell/cell_0/h_0/mul' (op: 'Mul') with input shapes: [32,50], [100]

The cell is initialized the following way.

hidden_size = 100
input_size=50
cell = RHNCell(hidden_size, input_size, is_training=True, depth=3, forget_bias=None)

and applied in a loop:

for batch in batches:
    # batch = [32, 50]
    output, state = cell(batch, state)

Both LSTMCell and GRUCell work with the above input and hidden sizes. Why doesn't RHNCell? Setting the input_size to 100 throws another error: ValueError: Linear is expecting 2D arguments: [[32, 100], [100]].