def main(): version = 2 skipSize = 0 includeSize = 400000 dimensions = [25, 50, 100, 150, 200, 300] name = "Top{}K-Skip{}".format(round(includeSize / 1000), skipSize) gloveOutputFolder = DatasetManager.getVisualEmbeddingsFolderPath(version) + name ''' PerformPCA.performPCA(name, gloveOutputFolder, dimensions, includeSize, skipSize, version) # Convert into KeyedVectors for d in dimensions: folderPath = gloveOutputFolder + "-{}/".format(d) glovePath = folderPath + "VisualGlove-{}-{}.txt".format(name, d) keyPath = folderPath + "Keyed-VisualGlove-{}".format(d) GloveFormatter.createKeyedVectorsFromGloveFile(glovePath, keyPath) ''' # Concat with standard Glove sizes = [(100, 300), (50, 300)] ConcatKeyedVectors.concatToStandardGlove(gloveOutputFolder, name, sizeCombinations=sizes, version=version)
def getTopAndSkipKVisualOnly(top, skip, version=1): basePath = DatasetManager.getVisualEmbeddingsFolderPath(version) return [basePath + "Top{}K-Skip{}-{}/Keyed-VisualGlove-{}".format(top, skip, i, i) for i in [50, 100, 200, 300]]
def main(): glovePath = DatasetManager.getVisualEmbeddingsFolderPath( 2) + "/VisualGlove-2.0 Full.txt" GloveFormatter.createKeyedVectorsFromGloveFile( glovePath, "Keyed-VisualGlove-2.0-Full") '''
def getTop100KVisualOnly(): basePath = DatasetManager.getVisualEmbeddingsFolderPath() return [basePath + "Top-100K-{}/Keyed-VisualGlove-{}".format(i, i) for i in [50, 100, 200, 300]]