Functions | Variables
allInOneTrainingPlots Namespace Reference

Functions

def extractTrainLoss (logPath)
 
def extractTestLoss (logPath)
 

Variables

 parser = argparse.ArgumentParser()
 
 type
 
 str
 
 required
 
 args = parser.parse_args()
 
 log1 = args.input
 
 df = extractTrainLoss(log1)
 
 tdf = extractTestLoss(log1)
 
 ax = df.plot("iteration", "loss", label="Train Loss")
 
 label
 
 loss
 
 window
 
 win_type
 
 accuracy
 
 trainLoss = TGraph()
 
 testLoss = TGraph()
 
 testAccuracy = TGraph()
 
int iPoint = 0
 
 c1 = TCanvas("c1","gerrors2")
 
 pad = TPad("pad","",0,0,1,1)
 
 hr = c1.DrawFrame(0,2.0,2000000,4.0)
 
 overlay = TPad("overlay","",0,0,1,1)
 
 xmin = pad.GetUxmin()
 
float ymin = 0.1
 
 xmax = pad.GetUxmax()
 
float ymax = 0.4
 
 hframe = overlay.DrawFrame(xmin,ymin,xmax,ymax)
 
 mylegend = TLegend(0.63,0.67,0.86,0.89)
 
 axis = TGaxis(xmax,ymin,xmax, ymax,ymin,ymax,510,"+L")
 
string outName = "learning_"
 

Function Documentation

def allInOneTrainingPlots.extractTestLoss (   logPath)

Definition at line 35 of file allInOneTrainingPlots.py.

References check_time_usage.float, makeTrainCVSamples.int, and open().

35 def extractTestLoss(logPath):
36  iterationPattern = r"Iteration (?P<iter_num>\d+), Testing net"
37  iterations = [int(r) for r
38  in re.findall(iterationPattern,
39  open(logPath, 'r').read())]
40 
41  testPattern = r"Test net output #0: loss3/loss3 = (?P<loss_val>[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?)"
42  tests = [float(r[0]) for r
43  in re.findall(testPattern, open(logPath, 'r').read())]
44 
45  accPattern = r" Test net output #1: loss3/top-1 = (?P<loss_val>[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?)"
46  accs = [float(r[0]) for r
47  in re.findall(accPattern, open(logPath, 'r').read())]
48  print len(iterations), len(tests), len(accs)
49 
50  return pd.DataFrame({"iteration":iterations, "loss":tests, "accuracy":accs})
51 
52 TGaxis.SetMaxDigits(8)
53 
procfile open("FD_BRL_v0.txt")
def allInOneTrainingPlots.extractTrainLoss (   logPath)

Definition at line 17 of file allInOneTrainingPlots.py.

References check_time_usage.float, makeTrainCVSamples.int, and open().

17 def extractTrainLoss(logPath):
18  lossPattern = r"Iteration (?P<iter_num>\d+) .*, loss = (?P<loss_val>[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?)"
19 
20  iterations = []
21  losses = []
22 
23  for pair in re.findall(lossPattern, open(logPath, 'r').read()):
24  iterations.append(int(pair[0]))
25  losses.append(float(pair[1]))
26 
27  return pd.DataFrame({"iteration":iterations, "loss":losses})
28 
procfile open("FD_BRL_v0.txt")

Variable Documentation

allInOneTrainingPlots.accuracy

Definition at line 68 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.args = parser.parse_args()

Definition at line 14 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.ax = df.plot("iteration", "loss", label="Train Loss")

Definition at line 58 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.axis = TGaxis(xmax,ymin,xmax, ymax,ymin,ymax,510,"+L")

Definition at line 159 of file allInOneTrainingPlots.py.

Referenced by accum_nue_numu_equivalent(), accum_nue_numu_equivalent_fhc(), accum_nue_numu_equivalent_rhc(), FDPredictionHandler.AddVar(), NDPredictionHandler.AddVar(), fnex::ShifterAndWeighter.CalcNearTrueEnergyRatioWeights(), containment_optimization(), datamc(), datamc_ND_numu_kinematics(), datamc_ND_numu_kinematics_FHC(), datamc_ND_numu_kinematics_FHC_REW(), datamc_ND_numu_kinematics_REW(), datamc_ND_numu_kinematics_RHC(), datamc_ND_numu_kinematics_RHC_REW(), Decomp.Decomp(), ana::AtmConstraint.Derivative(), Distribution.Distribution(), testbeam::BeamlineEventDisplay.DrawAnnotations(), FDDataMC(), ana::FDExtrap.FDExtrap_c(), fiducial_accounting(), fiducial_optimization(), FillSpectra(), beamlinereco::WCHitFinderAlg.findGoodHits(), ana::FluxMultiverseSyst.FluxMultiverseSyst(), genie_syst_make(), ana::GenieMultiverseSpectra.GenieMultiverseSpectra(), get_data_and_cosmic(), get_fdmc_spectra(), get_spectra_2dplots(), getCrossSectionAnalysis_Spectra(), getCrossSectionAnalysis_Spectra_systematics(), getCrossSectionAnalysisSpectra(), getFitTemplates(), getPredictions(), getSpectra_ForFitting(), evd::TZProjPad.GetWBoundCm(), evd::TZProjPad.GetWrangeCm(), evd::TZProjPad.GetZBoundCm(), evd::TZProjPad.GetZrangeCm(), make_extrap_figure_hists(), make_nue_xsec_pred(), MakeCovarSim(), MakeCutFlowSpectra(), MakeDecomp(), MakeKin2DSpectra(), MakeKinSpectra(), MakeMap(), MakeObservablesSpectra(), makePrediction(), MakeSystRatios(), MakeTruthSpectra(), genie::geometry::GeomVolSelectorFiducial.MakeZCylinder(), modularextrap_demo_nue(), modularextrap_demo_numu(), mrbrem_get_initial_spectra(), mrbrem_get_reweighted_spectra(), mre_example_test(), ana::ModularExtrapSterile.NCDisappearance(), ND_DataMC(), ND_predictionbyMC_usingbincontent(), NDDataMC(), ana::NDExtrap.NDExtrap_c(), ana::ModularExtrap.Nue(), nue_data_mc_validation(), nue_fd_mc_validation(), ana::ModularExtrap.NueBkgd(), ana::ModularExtrap.NueFlux(), ana::ModularExtrap.NueRHC(), ana::ModularExtrap.NueSignal(), ana::ModularExtrap.Numu(), NuMu2020_MakePIDPlots(), numu_data_mc_validation(), nus17_fiducial_accounting(), DiffHough.operator()(), DiffElastic.operator()(), genie::flux::GDk2NuFluxXMLHelper.ParseRotSeries(), genie::flux::GNuMIFluxXMLHelper.ParseRotSeries(), plot_with_zoom(), plotTrainTest(), ppfx_make_systs(), preselection_cutflow(), ana.ProfileQuantile(), geo.ProjectToBoxEdgeFromOutside(), evgen::IsoGen.projectToSurface(), resolution2018(), rock(), savePrediction_addExpt(), savePrediction_complete(), savePrediction_extrap(), savePrediction_simple(), savePrediction_systs(), saveSpectraForUnf(), sensitivity_plot(), ana::NusSystMaker.SetAxes(), ana::ICrossSectionAnalysis.SetAxis(), ana::ICrossSectionAnalysis.SetAxisNT(), genie::geometry::GeomVolSelectorFiducial.SetReverseFiducial(), evd::TZProjPad.SetWrangeCm(), evd::TZProjPad.SetZrangeCm(), test_genie_systs(), test_nuwro(), test_predictionscalecomp(), test_saloaders(), test_xsecanalysis(), ana::ModularExtrapSterile.TrivialExtrapNC(), wrong_sign_uncertainty(), and genie::flux::GDk2NuFluxXMLHelper.~GDk2NuFluxXMLHelper().

allInOneTrainingPlots.c1 = TCanvas("c1","gerrors2")

Definition at line 100 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.df = extractTrainLoss(log1)

Definition at line 29 of file allInOneTrainingPlots.py.

Referenced by daqdataformats::MicroSliceUnitTest.basicFieldGetAndSetChecks(), PandAna.reco_validation.prod5_pid_validation.main(), OnMonPlotMaker(), PandAna.reco_validation.prod5_pid_validation_data_mc.prod5_pid_data_mc(), daqdataformats::ConfigurationBlockUnitTest.~ConfigurationBlockUnitTest(), daqdataformats::ConfigurationHeaderUnitTest.~ConfigurationHeaderUnitTest(), daqdataformats::ConfigurationNameUnitTest.~ConfigurationNameUnitTest(), daqdataformats::ConfigurationSystemIDUnitTest.~ConfigurationSystemIDUnitTest(), daqdataformats::ConfigurationTailUnitTest.~ConfigurationTailUnitTest(), daqdataformats::DataBlockHeaderUnitTest.~DataBlockHeaderUnitTest(), daqdataformats::DataBlockUnitTest.~DataBlockUnitTest(), daqdataformats::EventHeaderUnitTest.~EventHeaderUnitTest(), daqdataformats::EventTailUnitTest.~EventTailUnitTest(), daqdataformats::EventUnitTest.~EventUnitTest(), daqdataformats::MicroBlockHeaderUnitTest.~MicroBlockHeaderUnitTest(), daqdataformats::MicroSliceHeaderUnitTest.~MicroSliceHeaderUnitTest(), daqdataformats::MilliSliceHeaderUnitTest.~MilliSliceHeaderUnitTest(), daqdataformats::NanoSliceHeaderUnitTest.~NanoSliceHeaderUnitTest(), daqdataformats::NanoSliceUnitTest.~NanoSliceUnitTest(), daqdataformats::RunHeaderUnitTest.~RunHeaderUnitTest(), daqdataformats::TimingMarkerUnitTest.~TimingMarkerUnitTest(), daqdataformats::TriggerHeaderUnitTest.~TriggerHeaderUnitTest(), daqdataformats::TriggerMaskUnitTest.~TriggerMaskUnitTest(), daqdataformats::TriggerRangeUnitTest.~TriggerRangeUnitTest(), daqdataformats::TriggerTimeUnitTest.~TriggerTimeUnitTest(), daqdataformats::TriggerTimingMarkerUnitTest.~TriggerTimingMarkerUnitTest(), and daqdataformats::TriggerUnitTest.~TriggerUnitTest().

allInOneTrainingPlots.hframe = overlay.DrawFrame(xmin,ymin,xmax,ymax)

Definition at line 141 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.hr = c1.DrawFrame(0,2.0,2000000,4.0)
int allInOneTrainingPlots.iPoint = 0

Definition at line 88 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.label

Definition at line 59 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.log1 = args.input

Definition at line 15 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.loss

Definition at line 61 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.mylegend = TLegend(0.63,0.67,0.86,0.89)
string allInOneTrainingPlots.outName = "learning_"

Definition at line 175 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.overlay = TPad("overlay","",0,0,1,1)

Definition at line 128 of file allInOneTrainingPlots.py.

Referenced by DrawSliceCanvas(), plotTrainTest(), and SliceLegend().

allInOneTrainingPlots.pad = TPad("pad","",0,0,1,1)
allInOneTrainingPlots.parser = argparse.ArgumentParser()

Definition at line 11 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.required

Definition at line 12 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.str

Definition at line 12 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.tdf = extractTestLoss(log1)

Definition at line 54 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.testAccuracy = TGraph()

Definition at line 77 of file allInOneTrainingPlots.py.

Referenced by plotTrainTest().

allInOneTrainingPlots.testLoss = TGraph()

Definition at line 74 of file allInOneTrainingPlots.py.

Referenced by plotTrainTest().

allInOneTrainingPlots.trainLoss = TGraph()

Definition at line 71 of file allInOneTrainingPlots.py.

Referenced by plotTrainTest().

allInOneTrainingPlots.type

Definition at line 12 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.win_type

Definition at line 61 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.window
allInOneTrainingPlots.xmax = pad.GetUxmax()

Definition at line 139 of file allInOneTrainingPlots.py.

allInOneTrainingPlots.xmin = pad.GetUxmin()

Definition at line 137 of file allInOneTrainingPlots.py.

float allInOneTrainingPlots.ymax = 0.4

Definition at line 140 of file allInOneTrainingPlots.py.

float allInOneTrainingPlots.ymin = 0.1

Definition at line 138 of file allInOneTrainingPlots.py.