def main(): try: params = UserInput.getUserInput('test') ExampleLoader.loadExamples(params) w = CacheObj.loadObject(params.modelFile) Performance.writePerformance(params, w, params.resultFile) Performance.printStrongAndWeakTrainError(params, w) utils.dumpCurrentLatentVariables(params, params.latentVariableFile) except Exception, e : import traceback traceback.print_exc(file=sys.stdout)
def main(): try: params = UserInput.getUserInput('train') ExampleLoader.loadExamples(params) CommonApp.setExampleCosts(params) w = None if params.initialModelFile: w = CacheObj.loadObject(params.initialModelFile) else: w = CommonApp.PsiObject(params,False) globalSPLVars = SPLSelector.SPLVar() if params.splParams.splMode != 'CCCP': SPLSelector.setupSPL(params) w = LSSVM.optimize(w, globalSPLVars, params) CacheObj.cacheObject(params.modelFile,w) Performance.printStrongAndWeakTrainError(params, w) except Exception, e : import traceback traceback.print_exc(file=sys.stdout)