Пример #1
0
def make_predictions(): #We will make predictions for those experiments, which are already finished, but don't have the csv file with predictions
    experiments = projects.Project(Path(__file__).parent.parent).experiments()
    for exp in experiments:
        res_file = os.path.join(exp.path, exp.name() + '_result.csv')
        if exp.isCompleted() and not os.path.exists(res_file):
            preds = generic.parse(exp.path).predictions('test')
            preds.dump(res_file)
Пример #2
0
def basic_test(experiment_name: str):
    pr = projects.Project(os.path.join(fl, "../examples"))
    exp = pr.byName(experiment_name)
    tasks = exp.fit()
    executor = parralel.get_executor(1, 1)
    executor.execute(tasks)
    return exp.result(False, True)
 def test_basic_network(self):
     pr = projects.Project(os.path.join(fl, "project"))
     exp = pr.byName("exp01")
     tasks = exp.fit()
     executor = parralel.get_executor(1, 1)
     executor.execute(tasks)
     r = exp.result()
     self.assertGreaterEqual(r, 0, "Result should be greater then zero")
     self.assertTrue(isinstance(r, float), "result should be float")
     print(r)
     pass
Пример #4
0
def make_predictions():
    experiments = projects.Project(Path(__file__).parent.parent).experiments()
    for exp in experiments:
        if exp.isCompleted():
            file_path=os.path.join(context.get_current_project_data_path(),"rus.vocab")
            vocabulary=utils.load(file_path)            
            preds = generic.parse(exp.path).predictions('test')
            for item in preds:
                rootItem = item.rootItem()
                sentence = ''
                for indices in item.prediction:
                    sentence = sentence + " " + vocabulary.i2w[np.argmax(indices)]                    
                print(rootItem.x + " " +  sentence)
Пример #5
0
 def project(self, id):
     return projects.Project(os.path.join(self.root, id))
Пример #6
0
 def __init__(self, path):
     self.path = path
     self.project = projects.Project(path)
     self.project.get_visualizers()