18#include "output_transform.hxx"
36 printf(
" Rmem = %8.3f MB, Vmem = %8.f3 MB \n",
37 p.fMemResident /1024.,
40 return p.fMemResident / 1024.;
46 std::cout <<
" shape : " <<
ConvertShapeToString(t.GetShape()) <<
" size : " << t.GetSize() <<
"\n";
47 auto & shape = t.GetShape();
49 size_t nrows = (shape.size() > 1) ? shape[0] : 1;
50 size_t ncols = (shape.size() > 1) ? t.GetStrides()[0] : shape[0];
51 for (
size_t i = 0; i <
nrows; i++) {
54 if (
j>10) std::cout <<
"... ";
55 std::cout << *
p << std::endl;
58 std::cout << *
p <<
", ";
62 std::cout << std::endl;
65 if (!
txt.empty()) std::cout << std::endl <<
txt << std::endl;
66 std::cout <<
"node data:"; PrintTensor(
d.node_data);
67 std::cout <<
"edge data:"; PrintTensor(
d.edge_data);
68 std::cout <<
"global data:"; PrintTensor(
d.global_data);
69 std::cout <<
"edge index:"; PrintTensor(
d.edge_index);
74 TMVA_SOFIE_encoder::Session
encoder;
75 TMVA_SOFIE_core::Session
core;
76 TMVA_SOFIE_decoder::Session
decoder;
88 for (
int i = 0; i <
nsteps; i++) {
118 for (
int i = 0; i <
nevts; i++) {
130 auto genValue = [&]() {
return r.Rndm()*10 -5; };
131 auto genLink = [&] () {
return r.Integer(num_nodes);};
152 for (
int i = 0; i <
nevts; i++) {
154 auto &
n = (*(
ndata.GetPtr()))[i];
156 auto &
e = (*(
edata.GetPtr()))[i];
158 auto &
g = (*(
gdata.GetPtr()))[i];
163 auto &
r = (*(
rdata.GetPtr()))[i];
164 auto & s = (*(
sdata.GetPtr()))[i];
166 std::copy(
r.begin(),
r.end(),
gd.edge_index.GetData());
167 std::copy(s.begin(), s.end(),
gd.edge_index.GetData()+num_edges);
170 if (i < 1 && verbose)
Print(
dataSet[i],
"Input for Event" + std::to_string(i));
183 const int seed = 111;
192 std::cout <<
"reading data\n";
199 auto h1 =
new TH1D(
"h1",
"SOFIE Node data",40,1,0);
200 auto h2 =
new TH1D(
"h2",
"SOFIE Edge data",40,1,0);
201 auto h3 =
new TH1D(
"h3",
"SOFIE Global data",40,1,0);
202 std::cout <<
"doing inference...\n";
207 for (
int i = 0; i <
nevts; i++) {
211 if (i < 1 && verbose)
Print(
lr,
"Output for Event" + std::to_string(i));
219 auto c1 =
new TCanvas(
"c1",
"SOFIE Results");
222 c1->cd(2); h2->Draw();
223 c1->cd(3);
h3->Draw();
227 auto c2 =
new TCanvas(
"c2",
"Reference Results");
229 auto o1 = file->Get(
"h1");
230 auto o2 = file->Get(
"h2");
231 auto o3 = file->Get(
"h3");
233 c2->cd(1);
o1->Draw();
234 c2->cd(2);
o2->Draw();
235 c2->cd(3);
o3->Draw();
#define R__ADD_INCLUDE_PATH(PATH)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
R__EXTERN TSystem * gSystem
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
const_iterator begin() const
const_iterator end() const
A "std::vector"-like collection of values implementing handy operation to analyse them.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
1-D histogram with a double per channel (see TH1 documentation)
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
Random number generator class based on M.
virtual int GetProcInfo(ProcInfo_t *info) const
Returns cpu and memory used by this process into the ProcInfo_t structure.
RVec< Common_t > Concatenate(const RVec< T0 > &v0, const RVec< T1 > &v1)
Return the concatenation of two RVecs.
void Copy(void *source, void *dest)
void Print(std::ostream &os, const OptionType &opt)
std::string ConvertShapeToString(const std::vector< size_t > &shape)
Double_t Mean(Long64_t n, const T *a, const Double_t *w=nullptr)
Returns the weighted mean of an array a with length n.