batch_first: true for io(batch, seq, feature) else io(seq, batch, feature)
| 14 | |
| 15 | //batch_first: true for io(batch, seq, feature) else io(seq, batch, feature) |
| 16 | class LSTM: public torch::nn::Module{ |
| 17 | public: |
| 18 | LSTM(int in_features, int hidden_layer_size, int out_size, int num_layers, bool batch_first); |
| 19 | torch::Tensor forward(torch::Tensor x); |
| 20 | private: |
| 21 | torch::nn::LSTM lstm{nullptr}; |
| 22 | torch::nn::Linear ln{nullptr}; |
| 23 | std::tuple<torch::Tensor, torch::Tensor> hidden_cell; |
| 24 | }; |