OpLSTMCustom

class OpLSTMCustom.LSTMCustomOpGrad(fun_name, inplace, recurrent_transform)[source]
make_node(Y, H, c, y0, i, freq, Dd, DY, W_re, *args)[source]
c_support_code()[source]
c_code(node, name, input_names, output_names, sub)[source]
class OpLSTMCustom.LSTMCustomOp(fun_name, inplace, recurrent_transform)[source]
make_node(Z, c, y0, i, freq, W_re, *args)[source]
Parameters:
  • Z – {input,output,forget} gate + cell state. 3d (time,batch,dim*4)
  • c – initial cell state. 2d (batch,dim)
  • y0 – output of t = -1 (for recursion at t = 0). 2d (batch,dim)
  • i – index. 2d (time,batch) -> 0 or 1
  • W_re – recurrent matrix. 2d (dim,dim*4)
  • freq – call frequency to custom function. int
  • args – custom_inputs + initial_state_vars: other inputs for the custom function
c_support_code()[source]
c_code(node, name, input_names, output_names, sub)[source]
grad(inputs, output_grads)[source]
OpLSTMCustom.register_func(recurrent_transform)[source]