(self, params)
Takes the argument options to save into a json file.
Takes the argument options to save into a json file.
Takes the argument options to save into a json file .
def _log_params(self, params):
        """
        Takes the argument options to save into a json file.
        """
        params_file = os.path.join(self.log_dir, 'params.json')

        # Check for discrepancy with previous training config.
        if os.path.exists(params_file):
            check = common.load_from_json(params_file)

            if params != check:
                diffs = []
                for k in params:
                    if k in check and params[k] != check[k]:
                        diffs.append('{}: Expected {} but got {}.'.format(
                            k, check[k], params[k]))

                diff_string = '\n'.join(diffs)
                raise ValueError(
                    "Current hyperparameter configuration is different from previously:\n{}"
                    .format(diff_string))

        common.write_to_json(params, params_file)
def _log_params ( self , params ) : params_file = os . path . join ( self . log_dir , 'params.json' ) # Check for discrepancy with previous training config. if os . path . exists ( params_file ) : check = common . load_from_json ( params_file ) if params != check : diffs = [ ] for k in params : if k in check and params [ k ] != check [ k ] : diffs . append ( '{}: Expected {} but got {}.' . format ( k , check [ k ] , params [ k ] ) ) diff_string = '\n' . join ( diffs ) raise ValueError ( "Current hyperparameter configuration is different from previously:\n{}" . format ( diff_string ) ) common . write_to_json ( params , params_file )