How to use the ergo.core.logic.Logic function in ergo

To help you get started, we’ve selected a few ergo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github evilsocket / ergo / ergo / project.py View on Github external
def __init__(self, path):
        # base info
        self.path  = os.path.abspath(path)
        self.logic = Logic(self.path)
        # model related data
        self.model          = None
        self.accu           = None
        self.model_path     = os.path.join(self.path, 'model.yml')
        self.weights_path   = os.path.join(self.path, 'model.h5')
        self.fdeep_path     = os.path.join(self.path, 'model.fdeep')
        # training related data
        self.dataset         = Dataset(self.path)
        self.txt_stats_path  = os.path.join(self.path, 'stats.txt')
        self.json_stats_path = os.path.join(self.path, 'stats.json')
        self.history_path    = os.path.join(self.path, 'history.json')
        self.classes_path    = os.path.join(self.path, 'classes.json')
        self.history         = None
        self.classes         = None
        self.what            = {
            'train' : "Training --------------------------------------------\n",
github evilsocket / ergo / ergo / core / logic.py View on Github external
def get_symbols(name, symbols):
        doer = Logic.get_doer(name)
        ret  = []
        for symbol in symbols:
            if symbol not in doer.__dict__:
                return None, "%s does not define a %s function" % (name, symbol)
            else:
                ret.append(doer.__dict__[symbol])
        return ret, None
github evilsocket / ergo / ergo / core / logic.py View on Github external
def load(self):
        preparers, err = Logic.get_symbols(self.preparer_path, ('prepare_dataset', 'prepare_input')) 
        if err is not None:
            return err
        else:
            self.dataset_preparer, self.input_preparer = preparers

        self.builder, err = Logic.get_symbol(self.builder_path, 'build_model')
        if err is not None:
            return err

        self.trainer, err = Logic.get_symbol(self.trainer_path, 'train_model')
        if err is not None:
            return err

        return None
github evilsocket / ergo / ergo / core / logic.py View on Github external
def load(self):
        preparers, err = Logic.get_symbols(self.preparer_path, ('prepare_dataset', 'prepare_input')) 
        if err is not None:
            return err
        else:
            self.dataset_preparer, self.input_preparer = preparers

        self.builder, err = Logic.get_symbol(self.builder_path, 'build_model')
        if err is not None:
            return err

        self.trainer, err = Logic.get_symbol(self.trainer_path, 'train_model')
        if err is not None:
            return err

        return None