11 #include <analysis/dbobjects/PIDNeuralNetworkParameters.h>
12 #include <framework/database/DBObjPtr.h>
13 #include <framework/logging/Logger.h>
15 #include <framework/gearbox/Const.h>
17 #define FDEEP_FLOAT_TYPE float
18 #include <fdeep/fdeep.hpp>
73 std::map<int, double>
predict(std::vector<float> inputs)
const;
79 size_t getInputSize()
const {
return (*m_pidNeuralNetworkParametersDB)->getInputSize(); }
85 size_t getInputIndex(
const std::string& name)
const {
return (*m_pidNeuralNetworkParametersDB)->getInputIndex(name); }
91 const std::vector<std::string>&
getInputNames()
const {
return (*m_pidNeuralNetworkParametersDB)->getInputNames(); }
98 const std::vector<int>&
getOutputSpeciesPdg()
const {
return (*m_pidNeuralNetworkParametersDB)->getOutputSpeciesPdg();}
112 bool hasPdgCode(
const int pdg,
const bool throwException =
false)
const {
return (*m_pidNeuralNetworkParametersDB)->hasPdgCode(pdg, throwException);}
122 std::unique_ptr<DBObjPtr<PIDNeuralNetworkParameters>>
Class to call PID neural network.
PIDNeuralNetwork(const std::string ¶meterName)
Constructor with given paramenter-set name.
size_t getInputSize() const
Get number of inputs.
PIDNeuralNetwork()
Constructor with default paramenter-set name.
size_t getInputIndex(const std::string &name) const
Get input names.
std::string m_pidNeuralNetworkParametersName
name of the parameter set
void loadParametersFromDB()
Load neural-network parameters with name m_pidNeuralNetworkParametersName from the conditions data ba...
std::map< int, double > predict(std::vector< float > inputs) const
Predict neural-network output for all implemented hypotheses using the given inputs.
const std::vector< int > & getOutputSpeciesPdg() const
Get the list of pdg codes of species hypotheses, for which the network predicts the probability in th...
bool hasPdgCode(const int pdg, const bool throwException=false) const
const std::string & getPIDNeuralNetworkParametersName() const
Get the name of the used neural network.
std::unique_ptr< const fdeep::model > m_model
frugally-deep neural network
const std::vector< std::string > & getInputNames() const
Get input names.
PIDNeuralNetwork(PIDNeuralNetwork &&other)
Move constructor.
std::unique_ptr< DBObjPtr< PIDNeuralNetworkParameters > > m_pidNeuralNetworkParametersDB
db object for the parameter set
Abstract base class for different kinds of events.