ATLAS Offline Software
lightweight_network_config.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LIGHTWEIGHT_NETWORK_CONFIG_HH_TAURECTOOLS
6 #define LIGHTWEIGHT_NETWORK_CONFIG_HH_TAURECTOOLS
7 
8 // NNLayerConfig is the "low level" configuration, which should
9 // contain everything needed to create a "Stack" or "Graph".
10 //
11 #include "NNLayerConfig.h"
12 
13 // The code below is to configure the "high level" interface. These
14 // structures are used to initalize the "LightweightNeuralNetwork" and
15 // "LightweightGraph".
16 
17 #include <map>
18 #include <string>
19 
20 namespace lwtDev {
21 
22  typedef std::map<std::string, std::vector<double> > VectorMap;
23 
24  struct Input
25  {
26  std::string name;
27  double offset;
28  double scale;
29  };
30 
31  // feed forward structure
32  //
33  // Note that this isn't technically JSON-dependant, the name is mostly
34  // historical
35  struct JSONConfig
36  {
37  std::vector<LayerConfig> layers;
38  std::vector<Input> inputs;
39  std::vector<std::string> outputs;
40  std::map<std::string, double> defaults;
41  std::map<std::string, std::string> miscellaneous;
42  };
43 
44  // graph structures
46  {
47  std::string name;
48  std::vector<Input> variables;
49  std::map<std::string, std::string> miscellaneous;
50  std::map<std::string, double> defaults;
51  };
53  {
54  std::vector<std::string> labels;
55  size_t node_index;
56  };
57  struct GraphConfig
58  {
59  std::vector<InputNodeConfig> inputs;
60  std::vector<InputNodeConfig> input_sequences;
61  std::vector<NodeConfig> nodes;
62  std::map<std::string, OutputNodeConfig> outputs;
63  std::vector<LayerConfig> layers;
64  };
65 
66 }
67 
68 #endif
lwtDev::InputNodeConfig
Definition: lightweight_network_config.h:46
lwtDev::JSONConfig::outputs
std::vector< std::string > outputs
Definition: lightweight_network_config.h:39
lwtDev::VectorMap
std::map< std::string, std::vector< double > > VectorMap
Definition: InputPreprocessor.h:24
lwtDev::Input::name
std::string name
Definition: lightweight_network_config.h:26
lwtDev::GraphConfig::input_sequences
std::vector< InputNodeConfig > input_sequences
Definition: lightweight_network_config.h:60
lwtDev::InputNodeConfig::variables
std::vector< Input > variables
Definition: lightweight_network_config.h:48
lwtDev::Input::offset
double offset
Definition: lightweight_network_config.h:27
lwtDev::GraphConfig::layers
std::vector< LayerConfig > layers
Definition: lightweight_network_config.h:63
lwtDev::JSONConfig::layers
std::vector< LayerConfig > layers
Definition: lightweight_network_config.h:37
lwtDev::Input
Definition: lightweight_network_config.h:25
lwtDev::GraphConfig::inputs
std::vector< InputNodeConfig > inputs
Definition: lightweight_network_config.h:59
lwtDev::JSONConfig::defaults
std::map< std::string, double > defaults
Definition: lightweight_network_config.h:40
lwtDev
Definition: Reconstruction/tauRecTools/Root/lwtnn/Exceptions.cxx:8
lwtDev::JSONConfig::miscellaneous
std::map< std::string, std::string > miscellaneous
Definition: lightweight_network_config.h:41
lwtDev::OutputNodeConfig::node_index
size_t node_index
Definition: lightweight_network_config.h:55
lwtDev::JSONConfig::inputs
std::vector< Input > inputs
Definition: lightweight_network_config.h:38
lwtDev::GraphConfig::nodes
std::vector< NodeConfig > nodes
Definition: lightweight_network_config.h:61
lwtDev::Input::scale
double scale
Definition: lightweight_network_config.h:28
lwtDev::OutputNodeConfig::labels
std::vector< std::string > labels
Definition: lightweight_network_config.h:54
lwtDev::GraphConfig::outputs
std::map< std::string, OutputNodeConfig > outputs
Definition: lightweight_network_config.h:62
lwtDev::InputNodeConfig::name
std::string name
Definition: lightweight_network_config.h:47
lwtDev::InputNodeConfig::miscellaneous
std::map< std::string, std::string > miscellaneous
Definition: lightweight_network_config.h:49
lwtDev::OutputNodeConfig
Definition: lightweight_network_config.h:53
lwtDev::GraphConfig
Definition: lightweight_network_config.h:58
lwtDev::JSONConfig
Definition: lightweight_network_config.h:36
NNLayerConfig.h
lwtDev::InputNodeConfig::defaults
std::map< std::string, double > defaults
Definition: lightweight_network_config.h:50