ATLAS Offline Software
Loading...
Searching...
No Matches
NNLayerConfig.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef NN_LAYER_CONFIG_HH_TAURECTOOLS
6#define NN_LAYER_CONFIG_HH_TAURECTOOLS
7
8// Layer Configiruation for Lightweight Tagger
9//
10// The structures below are used to initalize
11// `LightweightNeuralNetwork` and the simpler `Stack`.
12//
13// Author: Dan Guest <dguest@cern.ch>
14
15#include <vector>
16#include <map>
17#include <string>
18
19namespace lwtDev {
24 // components (for LSTM, etc)
25 enum class Component {
26 I, O, C, F, // LSTM
27 Z, R, H, // GRU
28 T, CARRY}; // Highway
29
30 // structure for embedding layers
32 {
33 std::vector<double> weights;
34 int index;
35 int n_out;
36 };
37
43
44 // main layer configuration
46 {
47 // dense layer info
48 std::vector<double> weights;
49 std::vector<double> bias;
50 std::vector<double> U; // TODO: what is this thing called in LSTMs?
52 ActivationConfig inner_activation; // for LSTMs and GRUs
53 bool go_backwards = false; // for LSTMs and GRUs
54 bool return_sequence = false; // for LSTMs and GRUs
55 std::string merge_mode; // for Bidirectional
56
57
58 // additional info for sublayers
59 std::vector<LayerConfig> sublayers;
60 std::map<Component, LayerConfig> components;
61 std::vector<EmbeddingConfig> embedding;
62
63 // arch flag
65 };
66
67 // graph node configuration
69 {
74 std::vector<size_t> sources;
75 int index; // input node size, or layer number
76 };
77}
78
79#endif
Definition index.py:1
std::vector< double > weights
ActivationConfig inner_activation
std::string merge_mode
std::vector< double > U
std::vector< double > bias
std::vector< LayerConfig > sublayers
Architecture architecture
ActivationConfig activation
std::vector< EmbeddingConfig > embedding
std::map< Component, LayerConfig > components
std::vector< double > weights
std::vector< size_t > sources