forked from larryniven/nn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlstm-tensor-tree.h
59 lines (34 loc) · 1.44 KB
/
lstm-tensor-tree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef LSTM_TENSOR_TREE_H
#define LSTM_TENSOR_TREE_H
#include <memory>
#include "nn/tensor-tree.h"
namespace lstm {
struct lstm_tensor_tree_factory {
virtual ~lstm_tensor_tree_factory();
virtual std::shared_ptr<tensor_tree::vertex> operator()() const;
};
struct dyer_lstm_tensor_tree_factory
: public lstm_tensor_tree_factory {
virtual std::shared_ptr<tensor_tree::vertex> operator()() const;
};
struct multilayer_lstm_tensor_tree_factory
: public lstm_tensor_tree_factory {
std::shared_ptr<lstm_tensor_tree_factory> base_fac;
int layer;
multilayer_lstm_tensor_tree_factory(
std::shared_ptr<lstm_tensor_tree_factory> base_fac, int layer);
virtual std::shared_ptr<tensor_tree::vertex> operator()() const;
};
std::shared_ptr<tensor_tree::vertex> make_lstm_tensor_tree();
struct bi_lstm_tensor_tree_factory
: public lstm_tensor_tree_factory {
std::shared_ptr<lstm_tensor_tree_factory> base_fac;
bi_lstm_tensor_tree_factory();
bi_lstm_tensor_tree_factory(std::shared_ptr<lstm_tensor_tree_factory> base_fac);
virtual ~bi_lstm_tensor_tree_factory();
virtual std::shared_ptr<tensor_tree::vertex> operator()() const;
};
std::shared_ptr<tensor_tree::vertex> make_bi_lstm_tensor_tree();
std::shared_ptr<tensor_tree::vertex> make_stacked_bi_lstm_tensor_tree(int layer);
}
#endif