def set_debug_info(self, pca_weights, patch_sz, debug_path, prefix): make_dir(debug_path) self.__pca_weights = pca_weights self.__patch_sz = patch_sz self.__debug_path = debug_path self.__prefix = '' if prefix == None else prefix self.output_debug = True
def set_debug_info(self, pca_weights, patch_sz, debug_path, prefix): make_dir(join(debug_path, 'filters')) make_dir(join(debug_path, 'histograms')) self.__pca_weights = pca_weights self.__patch_sz = patch_sz self.__debug_path = debug_path self.__prefix = '' if prefix == None else prefix self.output_debug = True
def export(self, path): """ Export parameters shared variables to npy files. Files are named according of the "name" argument of the shared variable Parameters ---------- path: string path for which to export parameter files """ make_dir(path) for param in self.__params.values(): fn = os.path.join(path, "{}.npy".format(str(param))) np.save(fn, param.get_value(borrow=True))
def debug_call(self): if self.output_debug: # For readability W = self.__params.encoder_weights.get_value() pca = self.__pca_weights patch_sz = self.__patch_sz debug_path = self.__debug_path prefix = self.__prefix make_dir(debug_path) filterstoimg(np.dot(pca, W), patch_sz, fn=join( debug_path, '{}{}_encoder_weights.tif'.format( prefix, self.layer_id)))
def export(self, path): make_dir(path) for param in self.encoder_params: fn = os.path.join(path, "{}.npy".format(str(param))) np.save(fn, param.get_value(borrow=True))
def _set_debug_info(self, patch_sz, debug_path): make_dir(debug_path) self.debug_enabled = True self.patch_sz = patch_sz self.debug_path = debug_path
def _set_debug_info(self, pca_weights, patch_sz, debug_path): make_dir(debug_path) self.pca_weights = pca_weights self.debug = True self.patch_sz = patch_sz self.debug_path = debug_path