Class for handling the parameters for the neural-network PID.
More...
#include <PIDNeuralNetworkParameters.h>
|
| PIDNeuralNetworkParameters () |
| Constructor.
|
|
| PIDNeuralNetworkParameters (const std::string &description, const std::vector< std::string > &inputNames, const std::string &modelDefinition, const std::vector< int > &outputSpeciesPdg, const std::vector< float > &meanValues, const std::vector< float > &standardDeviations, const PIDNNMissingInputs &handleMissingInputs, const PIDNNInputsToCut &inputsToCut) |
| Construct with individual neural-network parameters.
|
|
int | pdg2OutputIndex (const int pdg, const bool throwException=true) const |
| Convert pdg code to the index of the neural-network output that represents the corresponding probability. More...
|
|
bool | hasPdgCode (const int pdg, const bool throwException=false) const |
|
const std::string & | getModelDefinition () const |
| Get the neural network model-definition string for frugally-deep. More...
|
|
const std::vector< float > & | getMeanValues () const |
| Get the mean values of the inputs for normalization. More...
|
|
const std::vector< float > & | getStandardDeviations () const |
| Get the standard deviations of the inputs for normalization. More...
|
|
const PIDNNMissingInputs & | getHandleMissingInputs () const |
| Get vector of input indices and corresponding values that are set if the corresponding input is NaN. More...
|
|
const PIDNNInputsToCut & | getInputsToCut () const |
| Get vector of input indices, whose values are overwritten if other input variables are in a certain range. More...
|
|
size_t | getInputSize () const |
| Get number of inputs. More...
|
|
const std::vector< std::string > & | getInputNames () const |
| Get input names. More...
|
|
size_t | getInputIndex (const std::string &name) const |
| Get input index for input name. More...
|
|
const std::string & | getDescription () const |
| Get neural network description. More...
|
|
const std::vector< int > & | getOutputSpeciesPdg () const |
| Get the list of pdg codes of species hypotheses, for which the network predicts the probability in the order defined by the network output layer. More...
|
|
Class for handling the parameters for the neural-network PID.
Definition at line 45 of file PIDNeuralNetworkParameters.h.
◆ getDescription()
const std::string& getDescription |
( |
| ) |
const |
|
inline |
Get neural network description.
- Returns
- const std::string& neural network description
Definition at line 135 of file PIDNeuralNetworkParameters.h.
std::string m_description
description of neural network parameters
◆ getHandleMissingInputs()
Get vector of input indices and corresponding values that are set if the corresponding input is NaN.
- Returns
- const PIDNNMissingInputs& missing input handnling information
Definition at line 108 of file PIDNeuralNetworkParameters.h.
◆ getInputIndex()
size_t getInputIndex |
( |
const std::string & |
name | ) |
const |
Get input index for input name.
- Parameters
-
name | Input name that should be matched to a index |
- Returns
- size_t input index, -1 if
name
not in inputs
Definition at line 32 of file PIDNeuralNetworkParameters.cc.
35 if (itr ==
m_inputNames.end()) B2FATAL(
"Invalid input name: " << name);
std::vector< std::string > m_inputNames
list of input names
◆ getInputNames()
const std::vector<std::string>& getInputNames |
( |
| ) |
const |
|
inline |
◆ getInputSize()
size_t getInputSize |
( |
| ) |
const |
|
inline |
◆ getInputsToCut()
Get vector of input indices, whose values are overwritten if other input variables are in a certain range.
- Returns
- const PIDNNInputsToCut& overwrite inputs information
Definition at line 113 of file PIDNeuralNetworkParameters.h.
◆ getMeanValues()
const std::vector<float>& getMeanValues |
( |
| ) |
const |
|
inline |
Get the mean values of the inputs for normalization.
- Returns
- const std::vector<float>& input mean values
Definition at line 98 of file PIDNeuralNetworkParameters.h.
◆ getModelDefinition()
const std::string& getModelDefinition |
( |
| ) |
const |
|
inline |
Get the neural network model-definition string for frugally-deep.
- Returns
- const std::string& model-definition string
Definition at line 93 of file PIDNeuralNetworkParameters.h.
◆ getOutputSpeciesPdg()
const std::vector<int>& getOutputSpeciesPdg |
( |
| ) |
const |
|
inline |
Get the list of pdg codes of species hypotheses, for which the network predicts the probability in the order defined by the network output layer.
- Returns
- const std::vector<int>& list of pdg codes of hypotheses predicted by the network
Definition at line 142 of file PIDNeuralNetworkParameters.h.
◆ getStandardDeviations()
const std::vector<float>& getStandardDeviations |
( |
| ) |
const |
|
inline |
Get the standard deviations of the inputs for normalization.
- Returns
- const std::vector<float>& input standard deviations
Definition at line 103 of file PIDNeuralNetworkParameters.h.
◆ hasPdgCode()
bool hasPdgCode |
( |
const int |
pdg, |
|
|
const bool |
throwException = false |
|
) |
| const |
|
inline |
- Parameters
-
pdg | pdg code of hypothesis |
throwException | throw exception if pdg code is not predicted |
- Returns
- true if neural network predicts probability for the given hypothesis
-
false if neural network does not predict probability for the given hypothesis
Definition at line 87 of file PIDNeuralNetworkParameters.h.
◆ pdg2OutputIndex()
int pdg2OutputIndex |
( |
const int |
pdg, |
|
|
const bool |
throwException = true |
|
) |
| const |
Convert pdg code to the index of the neural-network output that represents the corresponding probability.
- Parameters
-
pdg | PDG code for particle-species hypothesis |
throwException | throw exception if pdg code is not predicted |
- Returns
- int Index of neural-network output. -1 if pdg code not predicted by neural network
Definition at line 19 of file PIDNeuralNetworkParameters.cc.
The documentation for this class was generated from the following files: