src/models/utils.py
def _init_directory(self):
        """Initialize empty checkpoint directory and record commit SHA
        in it. Extend this method to do more fancy things at start of
        experiment, for example saving hyper-parameters as a YAML file.
        """

        self.ckpt_dirpath.mkdir(parents=True, exist_ok=True)
        # Save the config file
        with open(self.ckpt_dirpath / 'config.yaml', 'w') as f:
            yaml.dump(self.config,
                      f,
                      default_flow_style=False,
                      sort_keys=False)
        f.close()

        # Save time also
        time_stamp = datetime.now().strftime("%Y_%b_%d_%H_%M")
        with open(self.ckpt_dirpath / 'time.txt', "a") as f:
            f.write(time_stamp + '\n')
        f.close()
        return None
Initialize empty checkpoint directory and record commit SHA
        in it. Extend this method to do more fancy things at start of
        experiment, for example saving hyper-parameters as a YAML file.
        
Initialize empty checkpoint directory and record commit SHA
in it. Extend this method to do more fancy things at start of
experiment, for example saving hyper-parameters as a YAML file.
Initialize empty checkpoint directory and record commit SHA in it . Extend this method to do more fancy things at start of experiment for example saving hyper - parameters as a YAML file .
def _init_directory(self):
        self.ckpt_dirpath.mkdir(parents=True, exist_ok=True)
        with open(self.ckpt_dirpath / 'config.yaml', 'w') as f:
            yaml.dump(self.config,
                      f,
                      default_flow_style=False,
                      sort_keys=False)
        f.close()
        time_stamp = datetime.now().strftime("%Y_%b_%d_%H_%M")
        with open(self.ckpt_dirpath / 'time.txt', "a") as f:
            f.write(time_stamp + '\n')
        f.close()
        return None
def _init_directory ( self ) : self . ckpt_dirpath . mkdir ( parents = True , exist_ok = True ) with open ( self . ckpt_dirpath / 'config.yaml' , 'w' ) as f : yaml . dump ( self . config , f , default_flow_style = False , sort_keys = False ) f . close ( ) time_stamp = datetime . now ( ) . strftime ( "%Y_%b_%d_%H_%M" ) with open ( self . ckpt_dirpath / 'time.txt' , "a" ) as f : f . write ( time_stamp + '\n' ) f . close ( ) return None
Initialize empty checkpoint directory and record commit SHA
in it.
Initialize empty checkpoint directory and record commit SHA in it .
"""Initialize empty checkpoint directory and record commit SHA
        in it. Extend this method to do more fancy things at start of
        experiment, for example saving hyper-parameters as a YAML file.
        """ # Save the config file # Save time also
self