TensorflowHandler.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file TensorflowHandler.h
3 /// \brief TensorflowHandler for ShowerLID
4 /// \author Andrew Vold - voldx034@umn.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef ShowerLID_TENSORFLOWHANDLER_H
8 #define ShowerLID_TENSORFLOWHANDLER_H
9 
10 #include <array>
11 #include <vector>
12 #include <map>
13 #include "fhiclcpp/ParameterSet.h"
14 #include "ShowerLID/ShowerLID.h"
15 #include "RecoBase/Shower.h"
16 
17 namespace tensorflow
18 {
19  /// Wrapper for Tensorflow which handles construction and prediction
21  {
22  public:
23  /// Basic constructor, takes path to deploy model pb
25 
26  //Much of code written by Jim Fleming
27  //https://medium.com/jim-fleming/loading-a-tensorflow-graph-with-the-c-api-4caaff88463f
28  float Predict(float sliceE,std::map<int,std::vector<float>> featuremap,bool fRHC);
30  std::string fFHCModel; ///< location of model weights
31  std::string fRHCModel; ///< location of model weights
32  bool fRHC = false;
33  };
34 
35  /// This function just returns the thing you give it, but in the meanwhile
36  /// it sets the glog level to what you pass in.
37  /// It's a hokey thing to do, but I wanted to call it in the initializer
38  /// list for the class before the fNet was constructed.
39  int LogLevel(int level);
40 
41 }
42 
43 #endif // ShowerLID_TENSORFLOWHANDLER_H
TensorflowHandler(fhicl::ParameterSet const &pset)
Basic constructor, takes path to deploy model pb.
int LogLevel(int level)
Wrapper for Tensorflow which handles construction and prediction.
float Predict(float sliceE, std::map< int, std::vector< float >> featuremap, bool fRHC)
std::string fFHCModel
location of model weights
std::string fRHCModel
location of model weights
enum BeamMode string