Created by: qingqing01
fix #4629 (closed) fix #4675 (closed)
- Finish the implementation kernel, but the code style will be refined later.
- Finish the forward implementation and the unit testing.
- Support reversed LSTM.
- Support peephole connections by default.
- TODO in next PR:
- Backward implementation and it's unit testing.
- Improve code about the kernel implementation in
math/detail
. - Support to disable peephole connections.
- Enable initial hidden state and initial cell state.
- Now use a
SequenceToBatch
functor to reorganize and sort the input sequence, I'll try to useTensorArray
in the future.
Directory structure:
├── lstm_op.cc
├── lstm_op.cu
├── lstm_op.h
├── math
│ ├── lstm_compute.cc
│ ├── lstm_compute.cu
│ ├── lstm_compute.h [One batch computing functor for lstm.]
│ ├── sequence2batch.cc
│ ├── sequence2batch.cu
│ ├── sequence2batch.h [Reorganize and sort the input sequence, try to use `TensorArray` in the future.]
│ ├── detail [The code in this directory will be refined later.]
│ │ ├── CMakeLists.txt
│ │ ├── hl_activation_functions.h
│ │ ├── hl_avx_functions.cc
│ │ ├── hl_avx_functions.h
│ │ ├── hl_cpu_functions.cc
│ │ ├── hl_functions.h [Activations for cpu, gpu and avx]
│ │ ├── hl_gpu_functions.h
│ │ ├── lstm_cpu_kernel.h [CPU implenmentation kernel for one batch and one sequence.]
│ │ ├── lstm_gpu_kernel.h [GPU implenmentation kernel for one batch.]
│ │ └── lstm_kernel.h