示例#1
0
 def model(self, load_type='best'):
     if load_type == 'last':
         prefix = '_latest'
     else:
         prefix = ''
     return joinPath(self.Base, self.Dataset, 'models',
                     self.ModelName + f'_v.{self.Version}' + prefix)
示例#2
0
    def addRedoTrainTask(self, dataset, version, updated_configs=None, **kwargs):
        pm = PathManager(dataset=dataset,
                         version=version)
        # 直接读取已做过的实验的config,重新做一次
        pre_config = loadJson(joinPath(pm.doc(), 'train.json'))

        # 加载之前version的参数后,如果有需要更新的参数,则在之前参数的基础上进行更新
        if updated_configs is not None:
            self._setFields(pre_config, updated_configs)

        self.addTask('train', pre_config, **kwargs)
示例#3
0
 def apiSeqLen(self):
     if self.Subset == 'all':
         raise ValueError("[PathManager] 类型为all时无api序列长度数据文件")
     return joinPath(self.Base, self.Dataset, 'data', self.Subset,
                     'seq_length.json')
示例#4
0
 def subsetIdxClassMapping(self):
     if self.Subset == 'all':
         raise ValueError("[PathManager] 类型为all时无“下标-类”映射数据文件")
     return joinPath(self.Base, self.Dataset, 'data', self.Subset,
                     'idx_mapping.json')
示例#5
0
 def wordIndex(self):
     return joinPath(self.Base, self.Dataset, 'data/word_map.json')
示例#6
0
 def imgData(self):
     if self.Subset == 'all':
         raise ValueError("[PathManager] 类型为all时无pe数据文件")
     return joinPath(self.Base, self.Dataset, 'data', self.Subset,
                     'img.npy')
示例#7
0
 def imgDataFolder(self):
     return joinPath(self.Base,
                     self.Dataset,
                     self.Subset,
                     'img',
                     is_dir=True)
示例#8
0
 def wordEmbedding(self):
     return joinPath(self.Base, self.Dataset, 'data/matrix.npy')
示例#9
0
 def datasetBase(self):
     return joinPath(self.Base, self.Dataset, is_dir=True)
示例#10
0
 def apiDataFolder(self):
     return joinPath(self.Base,
                     self.Dataset,
                     self.Subset,
                     'api',
                     is_dir=True)
示例#11
0
 def rootBase(self):
     return joinPath(self.Base, is_dir=True)
示例#12
0
 def subDataBase(self):
     return joinPath(self.Base,
                     self.Dataset,
                     'data',
                     self.Subset,
                     is_dir=True)
示例#13
0
 def docBase(self):
     return joinPath(self.Base, self.Dataset, 'doc', is_dir=True)
示例#14
0
 def testStat(self):
     return joinPath(self.Base, self.Dataset, 'doc', str(self.Version),
                     "test_stat.json")
示例#15
0
 def doc(self):
     return joinPath(self.Base,
                     self.Dataset,
                     'doc',
                     str(self.Version),
                     is_dir=True)