v0lta / Complex-gated-recurrent-neural-networks

Complex domain recurrent neural network gating and Stiefel-manifold optimization in TensorFlow, Neural Information Processing Systems (NeurIPS) 2018.
Apache License 2.0
49 stars 10 forks source link

TypeError: complex_matmul() got an unexpected keyword argument 'bias_init_c' #3

Closed SongRb closed 5 years ago

SongRb commented 5 years ago

I have git cloned the repo and run python bonn_eval_gate_diff.py, but following error produced:

Traceback (most recent call last):
  File "bonn_eval_gate_diff.py", line 83, in <module>
    single_gate)
  File "/home/tang/Code/A20/Complex-gated-recurrent-neural-networks/synthetic_experiments.py", line 157, in main
    y_hat = tf.nn.dynamic_rnn(cell, x, dtype=tf.float32)
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 324, in new_func
    return func(*args, **kwargs)
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/rnn.py", line 707, in dynamic_rnn
    dtype=dtype)
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/rnn.py", line 916, in _dynamic_rnn_loop
    swap_memory=swap_memory)
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3501, in while_loop
    return_same_structure)
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3012, in BuildLoop
    pred, body, original_loop_vars, loop_vars, shape_invariants)
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2937, in _BuildLoop
    body_result = body(*packed_vars_for_body)
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3456, in <lambda>
    body = lambda i, lv: (i + 1, orig_body(*lv))
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/rnn.py", line 884, in _time_step
    (output, new_state) = call_cell()
  File "/home/tang/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/rnn.py", line 870, in <lambda>
    call_cell = lambda: cell(input_t, state)
  File "/home/tang/Code/A20/Complex-gated-recurrent-neural-networks/custom_cells.py", line 930, in __call__
    bias_init=bias_init)
  File "/home/tang/Code/A20/Complex-gated-recurrent-neural-networks/custom_cells.py", line 859, in double_memory_gate
    bias_init_r=bias_init)
TypeError: complex_matmul() got an unexpected keyword argument 'bias_init_c'
v0lta commented 5 years ago

Dear Song, thanks a lot for your feedback. It looks like you found a bug. Could you please try changing the keyword argument 'bias_init_c' into 'bias_init_i' ? I changed the header of the complex matmul function at some point and must have forgotten to update the double gating function.

v0lta commented 5 years ago

Dear Song, i have pushed a fix. It should run now. Should you have any further trouble reproducing results please let me know.

SongRb commented 5 years ago

Thanks for your response!