ATLAS Offline Software
Loading...
Searching...
No Matches
TNeuralDataSet.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Author: Vassil Verguilov 11/05/2006
6
7#ifndef __NEURALDATASET_
8#define __NEURALDATASET_
9
10//______________________________________________________________________________
11//
12// TNeuralData
13//
14// This class is the base class for Neural Network Input/Output patterns
15// It contains methods for manupulating the data such as Randomize(),
16// Normalize(), Shuffle() and others.
17//
18//______________________________________________________________________________
19//
20
21#include "TMatrixD.h"
22#include "TVectorD.h"
23
24
26{
27 public:
28 TNeuralDataSet( Int_t aNumberOfPatterns = 0, Int_t aNumberOfUnits = 0 );
29 virtual ~TNeuralDataSet( void );
30 TNeuralDataSet(const TNeuralDataSet &) = delete;
32
33 // Returns the number of the patterns in set
34 Int_t GetPatternsCount( void ){ return mpData->GetNrows(); };
35 // Returns the number of the units in pattern
36 Int_t GetUnitsCount( void ){ return mpData->GetNcols(); };
37 // Returns the data in cell defined by pattern number and unit index in the pattern
38 Double_t GetData( const Int_t aPattern, const Int_t aIndex );
39 // Change the data in cell defined by pattern number and unit index in the pattern
40 void SetData( const Int_t aPattern, const Int_t aIndex, Double_t aValue );
41
42 Double_t GetEventWeight( const Int_t aPattern );
43 void SetEventWeight( const Int_t aPattern, Double_t aValue );
44
45 // Normalize all data
46 void Normalize( void );
47 // Randomizes the data
48 void Randomize( void );
49 // Shuffles the patterns
50 void Shuffle( Int_t aSeed = 0 );
51
52 private:
53
54 //data matrix
55 TMatrixD * mpData;
56
57 //vector (dim= entries)
58 TVectorD * mpWeights;
59
60 //vector (dim=variables)
61 TVectorD * mpNormFactors;
62 TVectorD * mpShiftFactors;
63
64 ClassDef( TNeuralDataSet, 1 )
65
66};
67
68inline Double_t TNeuralDataSet::GetData( const Int_t aPattern, const Int_t aIndex )
69{
70 // Returns the value of cell in the set specified by Pattern number and Unit index
71 return mpData->operator() ( aPattern, aIndex );
72}
73//______________________________________________________________________________
74inline Double_t TNeuralDataSet::GetEventWeight( const Int_t aPattern )
75{
76 return mpWeights->operator() ( aPattern );
77}
78//______________________________________________________________________________
79
80
81
82#endif
void SetEventWeight(const Int_t aPattern, Double_t aValue)
TVectorD * mpShiftFactors
Int_t GetUnitsCount(void)
TMatrixD * mpData
void SetData(const Int_t aPattern, const Int_t aIndex, Double_t aValue)
TVectorD * mpWeights
TNeuralDataSet(const TNeuralDataSet &)=delete
TVectorD * mpNormFactors
Double_t GetData(const Int_t aPattern, const Int_t aIndex)
Int_t GetPatternsCount(void)
void Normalize(void)
void Shuffle(Int_t aSeed=0)
TNeuralDataSet & operator=(const TNeuralDataSet &)=delete
void Randomize(void)
Double_t GetEventWeight(const Int_t aPattern)
virtual ~TNeuralDataSet(void)
TNeuralDataSet(Int_t aNumberOfPatterns=0, Int_t aNumberOfUnits=0)