#include <Stack.h>
|
| | LSTMLayer (const ActivationConfig &activation, const ActivationConfig &inner_activation, const MatrixXd &W_i, const MatrixXd &U_i, const VectorXd &b_i, const MatrixXd &W_f, const MatrixXd &U_f, const VectorXd &b_f, const MatrixXd &W_o, const MatrixXd &U_o, const VectorXd &b_o, const MatrixXd &W_c, const MatrixXd &U_c, const VectorXd &b_c, bool go_backwards, bool return_sequence) |
| virtual | ~LSTMLayer () |
| virtual MatrixXd | scan (const MatrixXd &) const override |
| void | step (const VectorXd &input, LSTMState &) const |
Definition at line 236 of file Stack.h.
◆ LSTMLayer()
| lwtDev::LSTMLayer::LSTMLayer |
( |
const ActivationConfig & | activation, |
|
|
const ActivationConfig & | inner_activation, |
|
|
const MatrixXd & | W_i, |
|
|
const MatrixXd & | U_i, |
|
|
const VectorXd & | b_i, |
|
|
const MatrixXd & | W_f, |
|
|
const MatrixXd & | U_f, |
|
|
const VectorXd & | b_f, |
|
|
const MatrixXd & | W_o, |
|
|
const MatrixXd & | U_o, |
|
|
const VectorXd & | b_o, |
|
|
const MatrixXd & | W_c, |
|
|
const MatrixXd & | U_c, |
|
|
const VectorXd & | b_c, |
|
|
bool | go_backwards, |
|
|
bool | return_sequence ) |
Definition at line 473 of file Stack.cxx.
480 :
493 {
495
500 }
std::function< double(double)> m_inner_activation_fun
std::function< double(double)> m_activation_fun
std::function< double(double)> get_activation(lwtDev::ActivationConfig act)
◆ ~LSTMLayer()
| virtual lwtDev::LSTMLayer::~LSTMLayer |
( |
| ) |
|
|
inlinevirtual |
◆ scan()
| MatrixXd lwtDev::LSTMLayer::scan |
( |
const MatrixXd & | x | ) |
const |
|
overridevirtual |
Implements lwtDev::IRecurrentLayer.
Definition at line 535 of file Stack.cxx.
535 {
537
538 for(state.time = 0; state.time <
x.cols(); state.time++) {
540 step(
x.col(
x.cols() -1 - state.time ), state );
541 else
542 step(
x.col( state.time ), state );
543 }
544
545 return state.h_t;
546 }
void step(const VectorXd &input, LSTMState &) const
◆ step()
| void lwtDev::LSTMLayer::step |
( |
const VectorXd & | input, |
|
|
LSTMState & | s ) const |
Definition at line 516 of file Stack.cxx.
516 {
517
518
521
522 int tm1 =
s.time == 0 ? 0 :
s.time - 1;
523 VectorXd h_tm1 =
s.h_t.col(tm1);
524 VectorXd C_tm1 =
s.C_t.col(tm1);
525
530
531 s.C_t.col(
s.time) =
f.cwiseProduct(C_tm1) +
i.cwiseProduct(ct);
532 s.h_t.col(
s.time) = o.cwiseProduct(
s.C_t.col(
s.time).unaryExpr(act_fun));
533 }
◆ m_activation_fun
| std::function<double(double)> lwtDev::LSTMLayer::m_activation_fun |
|
private |
◆ m_b_c
| VectorXd lwtDev::LSTMLayer::m_b_c |
|
private |
◆ m_b_f
| VectorXd lwtDev::LSTMLayer::m_b_f |
|
private |
◆ m_b_i
| VectorXd lwtDev::LSTMLayer::m_b_i |
|
private |
◆ m_b_o
| VectorXd lwtDev::LSTMLayer::m_b_o |
|
private |
◆ m_go_backwards
| bool lwtDev::IRecurrentLayer::m_go_backwards = false |
|
inherited |
◆ m_inner_activation_fun
| std::function<double(double)> lwtDev::LSTMLayer::m_inner_activation_fun |
|
private |
◆ m_n_outputs
| int lwtDev::LSTMLayer::m_n_outputs |
|
private |
◆ m_return_sequence
| bool lwtDev::IRecurrentLayer::m_return_sequence = false |
|
inherited |
◆ m_U_c
| MatrixXd lwtDev::LSTMLayer::m_U_c |
|
private |
◆ m_U_f
| MatrixXd lwtDev::LSTMLayer::m_U_f |
|
private |
◆ m_U_i
| MatrixXd lwtDev::LSTMLayer::m_U_i |
|
private |
◆ m_U_o
| MatrixXd lwtDev::LSTMLayer::m_U_o |
|
private |
◆ m_W_c
| MatrixXd lwtDev::LSTMLayer::m_W_c |
|
private |
◆ m_W_f
| MatrixXd lwtDev::LSTMLayer::m_W_f |
|
private |
◆ m_W_i
| MatrixXd lwtDev::LSTMLayer::m_W_i |
|
private |
◆ m_W_o
| MatrixXd lwtDev::LSTMLayer::m_W_o |
|
private |
The documentation for this class was generated from the following files: