TFRegNetHandler.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file TFRegNetHandler.h
3 /// \brief TFRegNetHandler for RegCNN modified from TFNetHandler.h
4 /// \author Ilsoo Seong - iseong@uci.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef REGCNN_TFNETHANDLER_H
8 #define REGCNN_TFNETHANDLER_H
9 
10 #include <vector>
11 #include <memory>
12 
15 #include "fhiclcpp/ParameterSet.h"
17 //#include "larreco/RecoAlg/ImagePatternAlgs/Tensorflow/TF/tf_graph.h"
18 
19 namespace cnn
20 {
21 
22  /// Wrapper for caffe::Net which handles construction and prediction
24  {
25  public:
26 
27  /// Constructor which takes a pset with DeployProto and ModelFile fields
29 
30  /// Return prediction arrays for RegPixelMap
31  std::vector<float> Predict(const RegPixelMap& pm);
32  std::vector<float> Predict(const RegPixelMap& pm, const std::vector<float> cm_list);
33 
34  std::vector<float> PredictNuEEnergy(const RegPixelMap& pm);
35 
36  private:
37 
38  std::string fLibPath; ///< Library path (typically dune_pardata...)
39  std::string fTFProtoBuf; ///< location of the tf .pb file in the above path
40  unsigned int fInputs; ///< Number of tdcs for the network to classify
41  std::vector<std::string> fOutputName;
42  std::vector<bool> fReverseViews; ///< Do we need to reverse any views?
43  std::unique_ptr<tf::RegCNNGraph> fTFGraph; ///< Tensorflow graph
44 
45  };
46 
47 }
48 
49 #endif // REGCNN_TFNETHANDLER_H
std::string string
Definition: nybbler.cc:12
RegPixelMap, basic input to CNN neural net.
Definition: RegPixelMap.h:22
std::vector< float > PredictNuEEnergy(const RegPixelMap &pm)
unsigned int fInputs
Number of tdcs for the network to classify.
std::string fLibPath
Library path (typically dune_pardata...)
std::vector< bool > fReverseViews
Do we need to reverse any views?
std::vector< float > Predict(const RegPixelMap &pm)
Return prediction arrays for RegPixelMap.
RegPixelMap3D for RegCNN modified from PixelMap.h.
Wrapper for caffe::Net which handles construction and prediction.
Defines an enumeration for cellhit classification.
TFRegNetHandler(const fhicl::ParameterSet &pset)
Constructor which takes a pset with DeployProto and ModelFile fields.
std::vector< std::string > fOutputName
RegPixelMap for RegCNN modified from PixelMap.h.
std::unique_ptr< tf::RegCNNGraph > fTFGraph
Tensorflow graph.
std::string fTFProtoBuf
location of the tf .pb file in the above path