void Base::RunTrainer() { INFO0; if (Exists(Tagger().WeightFileName())) return; PrepareFiles(Stage::trainer); std::ofstream cout_file(Tagger().FolderName() + ".txt"); auto cout = std::cout.rdbuf(); std::cout.rdbuf(cout_file.rdbuf()); Trainer trainer(Tagger()); std::cout.rdbuf(cout); }
void OpenSMOKE_ICEM::Solve() { double timeStart, timeEnd; BzzVector xMin; BzzVector xMax; BzzVector xInitial; PrepareFiles(); ODE_ICEM_Object.assignICEM(this); // 1.A if (iTwoEquationModel == false) { ChangeDimensions(NC+1, &xMin); xMin=ZERO; xMin[NC+1] = 250.; ChangeDimensions(NC+1, &xMax); xMax=ONE; xMax[NC+1] = 6000.; xInitial = omega; xInitial.Append(T); } // 1.B if (iTwoEquationModel == true) { soot2EModel->initial_values(rho); indexTwoEquations = NC+2; ChangeDimensions(NC+3, &xMin); xMin=ZERO; xMin[NC+1] = 250.; ChangeDimensions(NC+3, &xMax); xMax=ONE; xMax[NC+1] = 6000.; xInitial = omega; xInitial.Append(T); xInitial.Append(soot2EModel->phiNStart); xInitial.Append(soot2EModel->phiMStart); } o(xInitial, 0., &ODE_ICEM_Object); o.MyStepPrint(); o.SetMinimumConstraints(xMin); o.SetMaximumConstraints(xMax); if (iRelativeTolerance == true) o.SetTolRel(MachEpsFloat()*relativeTolerance); if (iAbsoluteTolerance == true) o.SetTolAbs(absoluteTolerance); { countGlobalIterations = -1; // From -1 to avoid to store results from the first iteration timeStart = BzzGetCpuTime(); TauTotal = 2.*Constants::pi/rotation_rate * number_of_cycles; o(TauTotal,TauTotal); timeEnd = BzzGetCpuTime(); } if (iVerbose == true) { cout << endl; cout << "Number of function for Jacobian: " << o.GetNumFunctionForJacobian() << endl; cout << "Numerical Jacobians: " << o.GetNumNumericalJacobian() << endl; cout << "Time DAE solution: " << timeEnd - timeStart << " s" << endl << endl; } if (iVerboseSensitivity == true) { } CloseFiles(); }