Ejemplo n.º 1
0
 def log_setup(self) -> None:
     """
     Create the folders to store data.
     """
     run_name = self.__run_name
     if run_name is None:
         run_name = "c1_" + self.fid_func.__name__ + "_" + self.algorithm.__name__
     self.logdir = log_setup(self.__dir_path, run_name)
     self.logname = "open_loop.c3log"
     if isinstance(self.exp.created_by, str):
         shutil.copy2(self.exp.created_by, self.logdir)
     if isinstance(self.created_by, str):
         shutil.copy2(self.created_by, self.logdir)
Ejemplo n.º 2
0
    def log_setup(self, dir_path, run_name):
        """
        Create the folders to store data.

        Parameters
        ----------
        dir_path : str
            Filepath
        run_name : str
            User specified name for the run

        """
        self.dir_path = os.path.abspath(dir_path)
        if run_name is None:
            run_name = self.eval_func.__name__ + self.algorithm.__name__
        self.logdir = log_setup(self.dir_path, run_name)
        self.logname = 'calibration.log'
Ejemplo n.º 3
0
    def log_setup(self, dir_path, run_name):
        """
        Create the folders to store data.

        Parameters
        ----------
        dir_path : str
            Filepath
        run_name : str
            User specified name for the run

        """
        self.dir_path = os.path.abspath(dir_path)
        if run_name is None:
            run_name = ('c1_' + self.fid_func.__name__ + '_' +
                        self.algorithm.__name__)
        self.logdir = log_setup(self.dir_path, run_name)
        self.logname = 'open_loop.log'
Ejemplo n.º 4
0
    def log_setup(self) -> None:
        """
        Create the folders to store data.

        Parameters
        ----------
        dir_path : str
            Filepath
        run_name : str
            User specified name for the run

        """
        run_name = self.__run_name
        if run_name is None:
            run_name = "-".join([
                self.algorithm.__name__, self.sampling.__name__,
                self.fom.__name__
            ])
        self.logdir = log_setup(self.__dir_path, run_name)
Ejemplo n.º 5
0
    def log_setup(self, dir_path, run_name):
        """
        Create the folders to store data.

        Parameters
        ----------
        dir_path : str
            Filepath
        run_name : str
            User specified name for the run

        """
        self.dir_path = os.path.abspath(dir_path)
        if run_name is None:
            run_name = self.algorithm.__name__ + '-' \
                + self.sampling.__name__ + '-' \
                + self.fom.__name__
        self.logdir = log_setup(self.dir_path, run_name)
        self.logname = 'model_learn.log'
Ejemplo n.º 6
0
    def log_setup(self) -> None:
        """
        Create the folders to store data.

        Parameters
        ----------
        dir_path : str
            Filepath
        run_name : str
            User specified name for the run

        """
        dir_path = os.path.abspath(self.__dir_path)
        run_name = self.__run_name
        if run_name is None:
            run_name = self.eval_func.__name__ + self.algorithm.__name__
        self.logdir = log_setup(dir_path, run_name)
        self.logname = "calibration.log"
        shutil.copy2(self.eval_func, self.logdir)
        real_log = os.path.join(self.logdir, "real_model.hjson")
        self.exp_right.pmap.model.write_config(real_log)
Ejemplo n.º 7
0
    def log_setup(self):
        """
        Create the folders to store data.

        Parameters
        ----------
        dir_path : str
            Filepath
        run_name : str
            User specified name for the run

        """
        dir_path = os.path.abspath(self.__dir_path)
        run_name = self.__run_name
        if run_name is None:
            run_name = "-".join([
                self.algorithm.__name__, self.sampling.__name__,
                self.fom.__name__
            ])
        self.logdir = log_setup(dir_path, run_name)
        self.logname = "model_learn.log"
        shutil.copy2(self.__real_model_folder, self.logdir)
Ejemplo n.º 8
0
    def log_setup(self) -> None:
        """
        Create the folders to store data.

        Parameters
        ----------
        dir_path : str
            Filepath
        run_name : str
            User specified name for the run

        """
        dir_path = os.path.abspath(self.__dir_path)
        run_name = self.__run_name
        if run_name is None:
            run_name = "c1_" + self.fid_func.__name__ + "_" + self.algorithm.__name__
        self.logdir = log_setup(dir_path, run_name)
        self.logname = "open_loop.log"
        if isinstance(self.exp.created_by, str):
            shutil.copy2(self.exp.created_by, self.logdir)
        if isinstance(self.created_by, str):
            shutil.copy2(self.created_by, self.logdir)
Ejemplo n.º 9
0
    def log_setup(self) -> None:
        """
        Create the folders to store data.

        Parameters
        ----------
        dir_path : str
            Filepath
        run_name : str
            User specified name for the run

        """
        run_name = self.__run_name
        if run_name is None:
            run_name = self.eval_func.__name__ + self.algorithm.__name__
        self.logdir = log_setup(self.__dir_path, run_name)
        self.logname = "calibration.log"

        # We create a copy of the source code of the evaluation function in the log
        with open(os.path.join(self.logdir, "eval_func.py"),
                  "w") as eval_source:
            eval_source.write(inspect.getsource(self.eval_func))