Closed
Description
The way we implement complex RNN (used in DCCRN) is wrong since the layers are computed independently for the real and imaginary components, and the real and imaginary results are merged only once.
What we want (n_layers=2):
rr1 = real_lstm(input.real)
ir1 = real_lstm(input.imag)
ii1 = imag_lstm(input.imag)
ri1 = imag_lstm(input.real)
r1 = rr1 - ii1
i1 = ir1 + ri1
out1 = from_reim(r1, i1)
rr2 = real_lstm(out1.real)
ir2 = real_lstm(out1.imag)
ii2 = imag_lstm(out1.imag)
ri2 = imag_lstm(out1.real)
r2 = rr2 - ii2
i2 = ir2 + ri2
out2 = from_reim(r2, i2)
What I think we have (n_layers=2):
rr2 = real_lstm(real_lstm(input.real))
ir2 = real_lstm(real_lstm(input.imag))
ii2 = imag_lstm(imag_lstm(input.imag))
ri2 = imag_lstm(imag_lstm(input.real))
r2 = rr2 - ii2
i2 = ir2 + ri2
out2 = from_reim(r2, i2)