Belle II Software  release-08-01-10
GRLMLPData.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #ifndef GRLMLPDATA_H
10 #define GRLMLPDATA_H
11 
12 #include <TObject.h>
13 
14 namespace Belle2 {
20  class GRLMLPData : public TObject {
21  public:
26 
28  void addSample(const std::vector<float>& input, const std::vector<float>& target)
29  {
30  m_inputSamples.push_back(input);
31  m_targetSamples.push_back(target);
32  }
33 
35  unsigned getNumberOfSamples() const { return m_targetSamples.size(); }
37  const std::vector<float>& getInput(unsigned i) const { return m_inputSamples[i]; }
39  const std::vector<float>& getTarget(unsigned i) const { return m_targetSamples[i]; }
40 
41  private:
43  std::vector<std::vector<float>> m_inputSamples;
45  std::vector<std::vector<float>> m_targetSamples;
46 
49  };
51 }
52 #endif
Struct for training data of a single MLP for the neuro trigger.
Definition: GRLMLPData.h:20
std::vector< std::vector< float > > m_inputSamples
list of input vectors for network training.
Definition: GRLMLPData.h:43
GRLMLPData()
default constructor.
Definition: GRLMLPData.h:23
unsigned getNumberOfSamples() const
get number of samples (same for input and target)
Definition: GRLMLPData.h:35
std::vector< std::vector< float > > m_targetSamples
list of target values for network training.
Definition: GRLMLPData.h:45
ClassDef(GRLMLPData, 1)
Needed to make the ROOT object storable.
void addSample(const std::vector< float > &input, const std::vector< float > &target)
add a pair of input and target
Definition: GRLMLPData.h:28
const std::vector< float > & getInput(unsigned i) const
get input vector of sample i
Definition: GRLMLPData.h:37
~GRLMLPData()
destructor, empty because we don't allocate memory anywhere.
Definition: GRLMLPData.h:25
const std::vector< float > & getTarget(unsigned i) const
get target value of sample i
Definition: GRLMLPData.h:39
Abstract base class for different kinds of events.