Definition at line 11 of file WaveformRecogTf_tool.cc.
Definition at line 26 of file WaveformRecogTf_tool.cc.
References tf::Graph::create(), fNNetModelFilePath, fNNetOutputPattern, fUseBundle, g, fhicl::ParameterSet::get(), and art::errors::Unknown.
31 pset.
get<std::vector<std::string>>(
"NNetOutputPattern", {
"cnn_output",
"dense_3"});
38 mf::LogInfo(
"WaveformRecogTf") <<
"TF model loaded.";
44 mf::LogInfo(
"WaveformRecogTf") <<
"TF model loaded.";
47 mf::LogError(
"WaveformRecogTf") <<
"File name extension not supported.";
50 setupWaveRecRoiParams(pset);
static std::unique_ptr< Graph > create(const char *graph_file_name, const std::vector< std::string > &outputs={}, bool use_bundle=false, int ninputs=1, int noutputs=1)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
T get(std::string const &key) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::vector< std::vector< float > > wavrec_tool::WaveformRecogTf::predictWaveformType |
( |
const std::vector< std::vector< float >> & |
waveforms | ) |
const |
|
override |
Definition at line 54 of file WaveformRecogTf_tool.cc.
References DEFINE_ART_CLASS_TOOL, and g.
57 if (waveforms.empty() || waveforms.front().empty()) {
58 return std::vector<std::vector<float>>();
61 long long int samples = waveforms.size(), numtcks = waveforms.front().size();
64 std::vector<tensorflow::Tensor> _x;
66 tensorflow::Tensor(tensorflow::DT_FLOAT, tensorflow::TensorShape({samples, numtcks, 1})));
67 auto input_map = _x[0].tensor<float, 3>();
68 for (
long long int s = 0; s < samples; ++s) {
69 const auto& wvfrm = waveforms[s];
70 for (
long long int t = 0; t < numtcks; ++t) {
71 input_map(s, t, 0) = wvfrm[t];
std::string wavrec_tool::WaveformRecogTf::fNNetModelFilePath |
|
private |
std::vector<std::string> wavrec_tool::WaveformRecogTf::fNNetOutputPattern |
|
private |
bool wavrec_tool::WaveformRecogTf::fUseBundle |
|
private |
std::unique_ptr<tf::Graph> wavrec_tool::WaveformRecogTf::g |
|
private |
The documentation for this class was generated from the following file: