Esempio n. 1
0
File: lltm.py Progetto: Daiver/jff
 def backward(ctx, grad_h, grad_cell):
     outputs = lltm_cpp.backward(
         grad_h.contiguous(), grad_cell.contiguous(), *ctx.saved_variables)
     d_old_h, d_input, d_weights, d_bias, d_old_cell = outputs
     return d_input, d_weights, d_bias, d_old_h, d_old_cell
Esempio n. 2
0
 def backward(ctx, grad_h, grad_cell):
     outputs = lltm_cpp.backward(
         grad_h.contiguous(), grad_cell.contiguous(), *ctx.saved_variables)
     d_old_h, d_input, d_weights, d_bias, d_old_cell = outputs
     return d_input, d_weights, d_bias, d_old_h, d_old_cell
Esempio n. 3
0
 def backward(ctx, grad_h, grad_cell):
     d_old_h, d_input, d_weights, d_bias, d_old_cell = lltm_cpp.backward(
         grad_h, grad_cell, *ctx.saved_variables)
     return d_input, d_weights, d_bias, d_old_h, d_old_cell
Esempio n. 4
0
 def backward(ctx, grad_h, grad_cell):
     d_old_h, d_input, d_weights, d_bias, d_old_cell = lltm_cpp.backward(
         grad_h, grad_cell, *ctx.saved_variables)
     return d_input, d_weights, d_bias, d_old_h, d_old_cell
Esempio n. 5
0
 def backward(ctx, grad_out):
     d_input = lltm_cpp.backward(grad_out.contiguous(),
                                 *ctx.saved_variables, filename,
                                 function)
     return d_input[0]