From b8701f5cbc15711c791bfeb60eca0bd4bbcd1612 Mon Sep 17 00:00:00 2001 From: svkeerthy Date: Mon, 7 Oct 2024 23:14:11 +0530 Subject: [PATCH] Fixing formatting issues --- seed_embeddings/OpenKE/analogy.py | 15 ++-- seed_embeddings/OpenKE/config/Trainer.py | 20 +++--- .../OpenKE/generate_embedding_ray.py | 61 ++++++++--------- src/IR2Vec.cpp | 3 +- src/generate_vocabulary.py | 68 ++++++++++++------- src/include/IR2Vec.h | 4 +- vocabulary/seedEmbeddingVocab100D.txt | 2 +- vocabulary/seedEmbeddingVocab75D.txt | 2 +- 8 files changed, 99 insertions(+), 76 deletions(-) diff --git a/seed_embeddings/OpenKE/analogy.py b/seed_embeddings/OpenKE/analogy.py index 3ce05533..effa3cce 100644 --- a/seed_embeddings/OpenKE/analogy.py +++ b/seed_embeddings/OpenKE/analogy.py @@ -6,13 +6,14 @@ import numpy as np from sklearn.metrics.pairwise import euclidean_distances + class AnalogyScorer: def __init__(self, analogy_file="analogies.txt"): self.entity_dict = {} self.analogies = self._load_analogies(analogy_file) def _load_analogies(self, file_path): - with open(file_path, 'r') as f: + with open(file_path, "r") as f: return [tuple(line.strip().split()) for line in f if line.strip()] def find_vec(self, str1): @@ -22,12 +23,12 @@ def gen_similarity_table(self, vec): keys = list(self.entity_dict.keys()) entity_matrix = np.array(list(self.entity_dict.values())) vec = vec.reshape(1, -1) - + # Calculate distances using euclidean_distances distances = euclidean_distances(vec, entity_matrix)[0] - + return dict(zip(keys, distances)) - + def findTopk(self, dict1, k, values): sortedByVal = dict(sorted(dict1.items(), key=lambda x: x[1])) del sortedByVal[values[0].upper()] @@ -35,11 +36,11 @@ def findTopk(self, dict1, k, values): del sortedByVal[values[2].upper()] return {k: sortedByVal[k] for k in list(sortedByVal)[:k]} - def get_analogy_score(self, entity_dict): + def get_analogy_score(self, entity_dict): self.entity_dict = entity_dict total_count = len(self.analogies) correct_count = 0 - + for values in self.analogies: vecA = self.find_vec(values[0]) vecB = self.find_vec(values[1]) @@ -56,4 +57,4 @@ def get_analogy_score(self, entity_dict): if values[3].upper() in top_k_dict: correct_count += 1 - return correct_count \ No newline at end of file + return correct_count diff --git a/seed_embeddings/OpenKE/config/Trainer.py b/seed_embeddings/OpenKE/config/Trainer.py index edc35671..c1552688 100755 --- a/seed_embeddings/OpenKE/config/Trainer.py +++ b/seed_embeddings/OpenKE/config/Trainer.py @@ -52,10 +52,10 @@ def __init__( self.save_steps = save_steps self.checkpoint_dir = checkpoint_dir # self.out_path = out_path - + self.entity_names = self.load_entity_names(index_dir) self.analogies = analogy.AnalogyScorer(analogy_file=analogy_file) - + def load_entity_names(self, index_dir): with open(os.path.join(index_dir, "entity2id.txt")) as fEntity: content = fEntity.read() @@ -93,7 +93,7 @@ def getEntityDict(self, ent_embeddings): mapping entity names to their corresponding embeddings. """ entity_dict = {} - + for i, entity_name in enumerate(self.entity_names): entity_dict[entity_name] = ent_embeddings[i].tolist() @@ -180,25 +180,27 @@ def run( # self.model => Negative Sampling object # self.mode.model => Transe model - ent_embeddings = self.model.model.ent_embeddings.weight.data.cpu().numpy() + ent_embeddings = ( + self.model.model.ent_embeddings.weight.data.cpu().numpy() + ) entity_dict = self.getEntityDict(ent_embeddings) analogy_score = self.analogies.get_analogy_score(entity_dict) metrics.update({"AnalogiesScore": analogy_score}) print("Analogy Score completed") - + del entity_dict - + if best_metric_val <= analogy_score: best_metric_val = analogy_score save_ckpt = True - else: # loss + else: # loss if best_metric_val >= res: best_metric_val = res save_ckpt = True - + with tempfile.TemporaryDirectory() as temp_checkpoint_dir: - # Save the checkpoint... + # Save the checkpoint... checkpoint = None if save_ckpt: self.model.save_checkpoint( diff --git a/seed_embeddings/OpenKE/generate_embedding_ray.py b/seed_embeddings/OpenKE/generate_embedding_ray.py index 615371f2..8eb70a73 100644 --- a/seed_embeddings/OpenKE/generate_embedding_ray.py +++ b/seed_embeddings/OpenKE/generate_embedding_ray.py @@ -28,6 +28,7 @@ os.environ["CUDA_VISIBLE_DEVICES"] = "0,1" + def test_files(index_dir): entities = os.path.join(index_dir, "entity2id.txt") relations = os.path.join(index_dir, "relation2id.txt") @@ -41,6 +42,7 @@ def test_files(index_dir): if not os.path.exists(train): raise Exception("train2id.txt not found") + def train(config, args=None): # dataloader for training train_dataloader = TrainDataLoader( @@ -110,37 +112,37 @@ def findRep(src, index_dir, src_type="json"): for i in range(1, int(entities[0])): toTxt += entities[i].split("\t")[0] + ":" + str(rep[i - 1]) + ",\n" toTxt += ( - entities[int(entities[0])].split("\t")[0] - + ":" - + str(rep[int(entities[0]) - 1]) + entities[int(entities[0])].split("\t")[0] + ":" + str(rep[int(entities[0]) - 1]) ) return toTxt + def reformat_embeddings(input_str): # Split the string by '],' to isolate each object - entries = input_str.split('],') - + entries = input_str.split("],") + formatted_entries = [] - + for entry in entries: # Remove any newline characters - cleaned_entry = entry.replace('\n', ' ') - + cleaned_entry = entry.replace("\n", " ") + # Split the object name from the values part - obj_name, values = cleaned_entry.split(':[') - + obj_name, values = cleaned_entry.split(":[") + # Remove extra spaces and replace multiple spaces with a single one using regex - values = re.sub(r'\s+', ' ', values.split(']')[0].strip()) - + values = re.sub(r"\s+", " ", values.split("]")[0].strip()) + # Replace spaces between numbers with commas and add the closing bracket - formatted_values = values.replace(' ', ', ') + ']' - + formatted_values = values.replace(" ", ", ") + "]" + # Recombine the object name with the formatted values formatted_entry = f"{obj_name.strip()}:[{formatted_values}" formatted_entries.append(formatted_entry) - + # Join all entries back into one string, separated by newline - return '\n'.join(formatted_entries) + return "\n".join(formatted_entries) + if __name__ == "__main__": ray.init() @@ -220,10 +222,10 @@ def reformat_embeddings(input_str): type=str, default="./analogies.txt", ) - + arg_conf = parser.parse_args() arg_conf.index_dir = arg_conf.index_dir + "/" - + try: test_files(arg_conf.index_dir) print("Files are OK") @@ -239,7 +241,7 @@ def reformat_embeddings(input_str): # "neg_ent": tune.randint(1, 30), # "neg_rel": tune.randint(1, 30), # "bern": tune.randint(0, 2), - "opt_method": "Adam", #tune.choice(["SGD", "Adam"]), + "opt_method": "Adam", # tune.choice(["SGD", "Adam"]), } try: @@ -258,7 +260,7 @@ def reformat_embeddings(input_str): else: metric = "loss" mode = "min" - + scheduler = ASHAScheduler( time_attr="training_iteration", max_t=arg_conf.epoch, @@ -271,13 +273,12 @@ def reformat_embeddings(input_str): if arg_conf.use_gpu: train_with_resources = tune.with_resources( - tune.with_parameters(train, args = arg_conf), - resources={"cpu": 8, "gpu": 0.15} + tune.with_parameters(train, args=arg_conf), + resources={"cpu": 8, "gpu": 0.15}, ) else: train_with_resources = tune.with_resources( - tune.with_parameters(train, args = arg_conf), - resources={"cpu": 10, "gpu": 0} + tune.with_parameters(train, args=arg_conf), resources={"cpu": 10, "gpu": 0} ) tuner = tune.Tuner( @@ -296,7 +297,7 @@ def reformat_embeddings(input_str): # *Best* checkpoints are determined by these params: checkpoint_score_attribute=metric, checkpoint_score_order=mode, - ) + ), ), ) results = tuner.fit() @@ -304,9 +305,7 @@ def reformat_embeddings(input_str): # Write the best result to a file, best_result.txt fin_res = results.get_best_result(metric=metric, mode=mode) with open(os.path.join(arg_conf.index_dir, "best_result.txt"), "a") as f: - f.write( - "\n" + str(fin_res) - ) + f.write("\n" + str(fin_res)) if arg_conf.is_analogy: print( @@ -323,7 +322,7 @@ def reformat_embeddings(input_str): "Best Config Based on Loss : ", fin_res, ) - + # Get the best configuration best_config = fin_res.config print("best_config: ", best_config) @@ -366,10 +365,10 @@ def reformat_embeddings(input_str): margin, ), ) - + data = findRep(outfile, index_dir, src_type="ckpt") formatted_data = reformat_embeddings(data) - + # Write the embeddings to outfile embeddings_path = embeddings_path.replace(".ckpt", ".txt") print("embeddings_path: ", embeddings_path) diff --git a/src/IR2Vec.cpp b/src/IR2Vec.cpp index 3e328320..6fe0b3a9 100644 --- a/src/IR2Vec.cpp +++ b/src/IR2Vec.cpp @@ -38,7 +38,8 @@ cl::opt cl_collectIR( cl::opt cl_iname(cl::Positional, cl::desc("Input file path"), cl::Required, cl::cat(category)); cl::opt cl_dim("dim", cl::Optional, cl::init(300), - cl::desc("Dimension of the embeddings"), cl::cat(category)); + cl::desc("Dimension of the embeddings"), + cl::cat(category)); cl::opt cl_oname("o", cl::Required, cl::desc("Output file path"), cl::cat(category)); // for on demand generation of embeddings taking function name diff --git a/src/generate_vocabulary.py b/src/generate_vocabulary.py index fbbef6cc..80068717 100644 --- a/src/generate_vocabulary.py +++ b/src/generate_vocabulary.py @@ -10,20 +10,22 @@ import sys import os + class VocabularyError(Exception): """Custom exception for vocabulary errors.""" + pass + # Common header strings HEADER_GENERATED = "// Generated by IR2Vec. DO NOT EDIT!\n" -HEADER_VOCABULARY_BASE = ( - "// This file defines the base class for vocabulary and the factory \n// for creating vocabulary instances used by IR2Vec.\n" -) +HEADER_VOCABULARY_BASE = "// This file defines the base class for vocabulary and the factory \n// for creating vocabulary instances used by IR2Vec.\n" HEADER_VOCABULARY_CLASS = ( "// This file defines the {class_name} vocabulary class used by IR2Vec.\n" ) HEADER_CLANG_FORMAT_OFF = "// clang-format off\n" + def write_file(file_path, content): try: with open(file_path, "w") as fw: @@ -44,7 +46,6 @@ def generate_base_vocabulary_header(): "#include \n" "#include \n" "#include // For std::invalid_argument\n" - "namespace IR2Vec {\n\n" "using Vector = std::vector;\n\n" "class VocabularyBase {\n" @@ -59,7 +60,8 @@ def generate_base_vocabulary_header(): "} // namespace IR2Vec\n\n" "#endif // __VOCABULARY_H__\n" ) - + + def generate_vocabulary_class(vocab_file, class_name): class_header = ( f"{HEADER_GENERATED}" @@ -70,7 +72,7 @@ def generate_vocabulary_class(vocab_file, class_name): f"#include \n" f"#include \n" f"#include \n" - f"#include \"Vocabulary.h\" // Include the base class\n\n" + f'#include "Vocabulary.h" // Include the base class\n\n' f"namespace IR2Vec {{\n\n" f"class {class_name} : public VocabularyBase {{\n" f"public:\n" @@ -82,7 +84,9 @@ def generate_vocabulary_class(vocab_file, class_name): f"}};\n" ) - opening = f"\nconst std::map {class_name}::vocabulary = {{\n" + opening = ( + f"\nconst std::map {class_name}::vocabulary = {{\n" + ) closing = """\ }; } // namespace IR2Vec @@ -95,7 +99,9 @@ def generate_vocabulary_class(vocab_file, class_name): for line in fr.readlines(): key, val = line.strip().split(":") e = val.find("]") - vector_definitions += f"const IR2Vec::Vector {key}_vector_{dim} = {{ {val[1:e]} }};\n" + vector_definitions += ( + f"const IR2Vec::Vector {key}_vector_{dim} = {{ {val[1:e]} }};\n" + ) vocabulary_entries = "" with open(vocab_file, "r") as fr: @@ -105,18 +111,19 @@ def generate_vocabulary_class(vocab_file, class_name): return class_header + vector_definitions + opening + vocabulary_entries + closing + def generate_vocabulary_factory(class_names): factory_header = ( f"{HEADER_GENERATED}" f"{HEADER_VOCABULARY_BASE}" f"{HEADER_CLANG_FORMAT_OFF}\n" "#include \n" # For std::unique_ptr - "#include \"Vocabulary.h\"\n\n" + '#include "Vocabulary.h"\n\n' ) # Include headers for each vocabulary class for class_name in class_names: - factory_header += f"#include \"{class_name}.h\"\n" + factory_header += f'#include "{class_name}.h"\n' factory_header += "\nnamespace IR2Vec {\n\n" @@ -130,52 +137,65 @@ def generate_vocabulary_factory(class_names): dim = class_name.replace("Vocabulary", "").replace("D", "") factory_cases += f" case {dim}:\n return std::make_unique<{class_name}>();\n" - factory_footer = ( - """\ + factory_footer = """\ default: throw std::invalid_argument("Invalid dimension for vocabulary creation."); } } } // namespace IR2Vec\n """ - ) return factory_header + factory_function + factory_cases + factory_footer + def main(): - parser = argparse.ArgumentParser(description="Generate vocabulary and factory files.") - parser.add_argument('type', choices=['vocab', 'base'], help="Type of files to generate.") - parser.add_argument('input', help="Input vocabulary text file or dimensions as a comma-separated list.") - parser.add_argument('output', help="Output file path.") + parser = argparse.ArgumentParser( + description="Generate vocabulary and factory files." + ) + parser.add_argument( + "type", choices=["vocab", "base"], help="Type of files to generate." + ) + parser.add_argument( + "input", + help="Input vocabulary text file or dimensions as a comma-separated list.", + ) + parser.add_argument("output", help="Output file path.") args = parser.parse_args() if args.type is None or args.input is None or args.output is None: raise VocabularyError("Type, input, or output not provided.") - if args.type == 'vocab': + if args.type == "vocab": # Generate vocabulary class based on input file vocab_file = args.input - + # Extract dimension from the file name - dim = os.path.splitext(os.path.basename(vocab_file))[0].split("D")[0].split("Vocab")[-1] + dim = ( + os.path.splitext(os.path.basename(vocab_file))[0] + .split("D")[0] + .split("Vocab")[-1] + ) class_name = f"Vocabulary{dim}D" vocab_class_code = generate_vocabulary_class(vocab_file, class_name) output_file = os.path.join(args.output, f"{class_name}.h") write_file(output_file, vocab_class_code) - elif args.type == 'base': + elif args.type == "base": # Generate base vocabulary header and factory implementation base_header_code = generate_base_vocabulary_header() output_file = os.path.join(args.output, "Vocabulary.h") write_file(output_file, base_header_code) # Parse the dimensions from the input and generate class names - dimensions = args.input.split(',') - class_names = [f"Vocabulary{dim}D" for dim in dimensions] # Create class names based on dimensions - + dimensions = args.input.split(",") + class_names = [ + f"Vocabulary{dim}D" for dim in dimensions + ] # Create class names based on dimensions + factory_code = generate_vocabulary_factory(class_names) output_file = os.path.join(args.output, "VocabularyFactory.cpp") write_file(output_file, factory_code) + if __name__ == "__main__": try: main() diff --git a/src/include/IR2Vec.h b/src/include/IR2Vec.h index 53c4d8a2..b67d7a0c 100644 --- a/src/include/IR2Vec.h +++ b/src/include/IR2Vec.h @@ -42,8 +42,8 @@ class Embeddings { // file. Analogous to the command line options that are being used in IR2Vec // binary. Embeddings(llvm::Module &M, IR2VecMode mode, char level, std::ostream *o, - unsigned dim = 300, std::string funcName = "", - float WO = 1, float WA = 0.2, float WT = 0.5) { + unsigned dim = 300, std::string funcName = "", float WO = 1, + float WA = 0.2, float WT = 0.5) { vocabulary = VocabularyFactory::createVocabulary(dim)->getVocabulary(); generateEncodings(M, mode, level, funcName, dim, o, -1, WO, WA, WT); } diff --git a/vocabulary/seedEmbeddingVocab100D.txt b/vocabulary/seedEmbeddingVocab100D.txt index 9bc6b11a..f026c576 100644 --- a/vocabulary/seedEmbeddingVocab100D.txt +++ b/vocabulary/seedEmbeddingVocab100D.txt @@ -60,4 +60,4 @@ variable:[-0.04745717, -0.08637991, 0.1639285, 0.05114051, 0.03557682, -0.129909 vectorTy:[0.09214257, -0.04254282, -0.2082744, 0.1489835, 0.16765025, 0.12442486, -0.06085881, -0.02866303, 0.18554689, -0.08484387, 0.16206563, -0.01242073, 0.17323564, 0.06107936, -0.09174694, -0.0495562, -0.01831215, 0.04182582, -0.03232431, 0.08220705, 0.01549849, -0.1049181, -0.14759736, -0.03965862, 0.0188947, -0.10498622, -0.1803732, 0.16405664, 0.14511505, -0.10143329, -0.06956764, 0.05751402, 0.02792842, 0.14136231, 0.03651895, -0.11449363, 0.07786072, 0.12971582, 0.20839804, 0.20588775, 0.12468194, 0.00039439, 0.01450426, 0.15445328, 0.01187558, -0.07902222, -0.06411007, -0.05476548, 0.20955466, 0.15925792, 0.14728937, -0.00367325, -0.12067425, -0.11644303, -0.21257977, 0.21884163, -0.01551571, 0.06547339, -0.03973668, -0.09633668, -0.24208052, 0.11933044, -0.16694735, 0.04643975, -0.09887692, 0.05033477, -0.12200441, 0.1662296, -0.01365205, 0.01528752, -0.10588146, -0.08806136, -0.20088676, 0.05208419, -0.03125093, -0.06816924, -0.08123421, 0.0129625, -0.08165248, -0.14954782, -0.08383283, -0.0757656, -0.05523998, -0.13218589, 0.15462421, 0.02526899, -0.02197613, 0.06456108, -0.08720388, 0.10372602, -0.01931399, -0.13187875, 0.08807088, 0.02672064, 0.00975798, -0.11998563, 0.10483557, 0.08746739, 0.13014027, -0.13334289] voidTy:[1.39123395e-01, -6.82682246e-02, -1.56617016e-01, -7.60084465e-02, 1.00919925e-01, 1.74035922e-01, -1.56080678e-01, -5.35190031e-02, 1.09261021e-01, -1.35638222e-01, 1.68325156e-01, 1.35690197e-01, -9.90925804e-02, -1.13364339e-01, -1.50621478e-02, 3.74432206e-02, -5.21973036e-02, 2.96468586e-02, 6.75825961e-03, -4.00914066e-02, 6.65328428e-02, 1.53036490e-01, 9.56951156e-02, 9.35865939e-02, 2.17673816e-02, 1.03012696e-01, -1.14968633e-02, -8.92200693e-02, 2.22642094e-01, -1.38613293e-02, -5.15563693e-03, 9.23900530e-02, -1.27655804e-01, 3.78469527e-02, 3.11730765e-02, -1.27757015e-02, 1.26724884e-01, 2.15029139e-02, 1.60096169e-01, 3.17343101e-02, -1.03545554e-01, -1.24611840e-01, -4.03355211e-02, -7.08277300e-02, 8.45108777e-02, -1.04451224e-01, 1.16720572e-01, 1.48278670e-02, 1.84134856e-01, -1.62828434e-02, -1.64145931e-05, -6.86618909e-02, -1.37460783e-01, 7.12566301e-02, 6.22349456e-02, -1.15113214e-01, -1.57700866e-01, 1.28431082e-01, -1.25484526e-01, -2.16529414e-01, -9.91288945e-02, -7.96836540e-02, 7.39990473e-02, -5.88596649e-02, -2.84298491e-02, -5.15003502e-02, 2.06307825e-02, -1.38278484e-01, 3.76871638e-02, -6.28824681e-02, 5.19816801e-02, -1.90032780e-01, -4.50734906e-02, -1.09323092e-01, 5.38111515e-02, 8.90467837e-02, 8.49439353e-02, -2.58022826e-02, -5.37883528e-02, -1.73901737e-01, 1.35274500e-01, -9.15873423e-02, -6.80732578e-02, -9.18437913e-02, 7.81169087e-02, 1.10999197e-01, -8.34695622e-02, -1.86496139e-01, -1.59131661e-01, -5.79612404e-02, -3.66159305e-02, 8.42922255e-02, 1.44578693e-02, 3.29559147e-02, 6.82946946e-03, -5.06191142e-02, 1.35032460e-01, 1.89761311e-01, -1.47584870e-01, -4.90086749e-02] xor:[-0.16921039, 0.12408639, -0.034145, 0.13137488, -0.04762559, -0.03108282, 0.11359347, 0.04723426, 0.08214669, -0.08919795, 0.08350056, 0.02434964, -0.0256896, 0.18628141, 0.09431785, 0.02161829, -0.17557403, 0.01662976, 0.15725583, 0.13712473, -0.00457354, 0.03745704, -0.03570157, 0.06576116, 0.06272607, 0.01721253, -0.01528889, 0.06864108, -0.03288332, 0.09796044, 0.09011626, -0.23149484, 0.08231667, 0.04841082, -0.13498706, -0.05696484, -0.05362453, -0.11720514, 0.00099914, -0.23637904, -0.06771386, 0.13900891, 0.19573559, 0.01353323, 0.09763495, 0.16432948, -0.08079959, 0.0538074, 0.07155547, 0.02535601, -0.16881762, -0.02021813, -0.12348865, 0.01615006, -0.05484886, 0.27608117, -0.17019226, -0.05588771, 0.14863412, -0.01168946, 0.22599666, -0.0703093, 0.15534535, -0.12977424, -0.25004354, -0.17313497, 0.13966106, -0.09113417, -0.01070651, -0.19820745, 0.09653766, -0.0886725, 0.04275795, 0.05763382, 0.08995168, -0.0497935, -0.14781837, 0.03620582, -0.16778147, 0.01618672, -0.23161617, 0.20526892, -0.03256932, 0.1128776, 0.05835852, -0.17659847, 0.19213665, 0.1507903, -0.23795094, -0.00641877, 0.10532196, -0.17336258, -0.18323651, 0.01772483, 0.14239813, 0.03483916, 0.12513739, -0.1615746, 0.01592221, 0.06976533] -zext:[-1.33044437e-01, -2.52875745e-01, 3.50738093e-02, -2.03829944e-01, -5.82297966e-02, -1.05092958e-01, 4.42118868e-02, 1.12847589e-01, -1.57210976e-02, 9.47973505e-02, 8.15101340e-02, 4.34930958e-02, -7.35153481e-02, 1.79205835e-01, 4.31320854e-02, 6.20642006e-02, 1.99731160e-02, -1.93929952e-03, -4.71815653e-02, 1.87836722e-01, -6.38541579e-02, 5.80772832e-02, 5.34959137e-02, -6.36336505e-02, -9.44561362e-02, -3.94840681e-05, 1.80340484e-02, 6.65806234e-02, 1.84422173e-02, 1.28611282e-01, 6.59179240e-02, -1.37597591e-01, 1.75117403e-01, -4.69908975e-02, 6.37586415e-02, -6.76920712e-02, -4.30216230e-02, -6.56124204e-02, -4.91032265e-02, -1.42709956e-01, -1.11875355e-01, -8.30171350e-03, 2.17935696e-01, 6.31718040e-02, 1.23638242e-01, 1.87138334e-01, -1.01252785e-02, 6.76815137e-02, -7.43541047e-02, -7.46816248e-02, -1.13281965e-01, 1.19622834e-01, 1.11896917e-02, 8.83216560e-02, 3.06905359e-02, 1.12930745e-01, -1.71396554e-01, -1.75105166e-02, -4.67790440e-02, 1.85718816e-02, -1.56841706e-02, 7.76569992e-02, 1.44308535e-02, -1.63253114e-01, 1.79000050e-02, 1.80133302e-02, 3.17333966e-01, -7.50223324e-02, -8.86120647e-02, 1.56262398e-01, 7.72838667e-02, -6.56765550e-02, -1.00097515e-01, -3.52685601e-02, -1.37866139e-01, 3.65538932e-02, 1.63608536e-01, -5.79393171e-02, 2.18970180e-02, -5.66484667e-02, -6.28089085e-02, 1.92560479e-01, 4.35242988e-02, 3.29817012e-02, 2.57029757e-02, -1.71366796e-01, 4.26483452e-02, 3.12984526e-01, -5.45212887e-02, -2.74304971e-02, 2.81224921e-02, -1.13750860e-01, -7.34276101e-02, 1.34958059e-01, 1.25591040e-01, 1.68564655e-02, -1.45978597e-03, 1.05855344e-02, -2.16981005e-02, -6.22510351e-02] \ No newline at end of file +zext:[-1.33044437e-01, -2.52875745e-01, 3.50738093e-02, -2.03829944e-01, -5.82297966e-02, -1.05092958e-01, 4.42118868e-02, 1.12847589e-01, -1.57210976e-02, 9.47973505e-02, 8.15101340e-02, 4.34930958e-02, -7.35153481e-02, 1.79205835e-01, 4.31320854e-02, 6.20642006e-02, 1.99731160e-02, -1.93929952e-03, -4.71815653e-02, 1.87836722e-01, -6.38541579e-02, 5.80772832e-02, 5.34959137e-02, -6.36336505e-02, -9.44561362e-02, -3.94840681e-05, 1.80340484e-02, 6.65806234e-02, 1.84422173e-02, 1.28611282e-01, 6.59179240e-02, -1.37597591e-01, 1.75117403e-01, -4.69908975e-02, 6.37586415e-02, -6.76920712e-02, -4.30216230e-02, -6.56124204e-02, -4.91032265e-02, -1.42709956e-01, -1.11875355e-01, -8.30171350e-03, 2.17935696e-01, 6.31718040e-02, 1.23638242e-01, 1.87138334e-01, -1.01252785e-02, 6.76815137e-02, -7.43541047e-02, -7.46816248e-02, -1.13281965e-01, 1.19622834e-01, 1.11896917e-02, 8.83216560e-02, 3.06905359e-02, 1.12930745e-01, -1.71396554e-01, -1.75105166e-02, -4.67790440e-02, 1.85718816e-02, -1.56841706e-02, 7.76569992e-02, 1.44308535e-02, -1.63253114e-01, 1.79000050e-02, 1.80133302e-02, 3.17333966e-01, -7.50223324e-02, -8.86120647e-02, 1.56262398e-01, 7.72838667e-02, -6.56765550e-02, -1.00097515e-01, -3.52685601e-02, -1.37866139e-01, 3.65538932e-02, 1.63608536e-01, -5.79393171e-02, 2.18970180e-02, -5.66484667e-02, -6.28089085e-02, 1.92560479e-01, 4.35242988e-02, 3.29817012e-02, 2.57029757e-02, -1.71366796e-01, 4.26483452e-02, 3.12984526e-01, -5.45212887e-02, -2.74304971e-02, 2.81224921e-02, -1.13750860e-01, -7.34276101e-02, 1.34958059e-01, 1.25591040e-01, 1.68564655e-02, -1.45978597e-03, 1.05855344e-02, -2.16981005e-02, -6.22510351e-02] diff --git a/vocabulary/seedEmbeddingVocab75D.txt b/vocabulary/seedEmbeddingVocab75D.txt index 08519c56..1db19858 100644 --- a/vocabulary/seedEmbeddingVocab75D.txt +++ b/vocabulary/seedEmbeddingVocab75D.txt @@ -60,4 +60,4 @@ variable:[-0.04416586, -0.06529783, 0.06804077, -0.17281267, 0.21564505, -0.1031 vectorTy:[0.06019246, -0.08325528, 0.06796158, -0.1322501, -0.05250492, -0.05546387, 0.00084803, -0.13031249, 0.10292219, 0.16610621, -0.10459585, 0.21548297, -0.26862848, 0.08505963, 0.07657417, 0.16639674, 0.06083921, -0.00245328, 0.01956977, 0.21975385, -0.16639455, 0.14512713, -0.15006405, -0.2066719, -0.18236274, 0.12637317, -0.09601986, 0.17929196, 0.15004157, -0.2437613, 0.11610509, -0.12576523, -0.13349846, 0.00924278, 0.05477205, 0.11079396, 0.0149577, 0.08251344, 0.02648669, 0.28141958, -0.16844293, 0.02850299, -0.1849258, -0.00724132, -0.19553263, 0.16303328, -0.09641571, -0.08541372, -0.01167152, -0.0498387, 0.13118263, 0.03702982, 0.16826656, -0.12130306, 0.05498985, 0.07180171, 0.01047648, 0.19805974, 0.1132893, 0.12827364, -0.15292895, -0.0969883, 0.15015276, 0.25131726, 0.03910673, -0.12237693, 0.12764196, 0.14949943, -0.11722989, -0.142063, 0.07540323, 0.00866951, -0.16423495, 0.1803801, 0.08819818] voidTy:[0.02707169, -0.1911424, 0.18000233, -0.10855684, -0.15720911, -0.16028677, 0.08442728, 0.14063193, 0.14310814, 0.15267418, 0.03571516, 0.17472863, -0.1096759, -0.04809512, 0.15041178, 0.1852203, -0.08891776, 0.06437854, 0.07771051, 0.17514206, -0.18457355, 0.17228611, 0.14382029, 0.17567936, -0.19985509, 0.14512071, 0.00597054, -0.0005212, 0.16043086, 0.01015274, 0.1932167, 0.10049, -0.18615878, -0.14139535, -0.07989334, 0.13810824, 0.00811669, 0.16482183, -0.0484471, 0.05603446, -0.19822212, 0.21622814, -0.13391475, -0.07386104, -0.01220543, -0.17700416, 0.02550385, -0.04609942, 0.19161303, -0.08407282, 0.17597687, 0.01678882, 0.17494556, -0.15565564, 0.18086468, 0.01991182, -0.07939529, -0.04929006, 0.17783763, 0.18024826, -0.14163949, 0.18041377, 0.11955009, 0.00620418, 0.1386835, -0.18642457, 0.09366929, 0.16274834, -0.12151442, -0.19673795, 0.0550727, 0.10491449, 0.14478931, -0.02286906, 0.05187593] xor:[-0.14333177, 0.17120288, -0.11569388, -0.22889645, 0.0944928, 0.13705893, -0.1748709, -0.27198055, -0.20403583, -0.00204914, 0.16587155, 0.03005969, 0.03635887, 0.12084309, -0.17170708, 0.01672503, 0.2855867, -0.13425359, 0.2921407, 0.0620962, 0.00266978, -0.0903588, -0.06116274, -0.08814006, -0.04630399, -0.18787035, -0.1754261, -0.20075771, -0.18573092, -0.11999942, -0.14531347, -0.171928, 0.04110451, -0.10397294, -0.03485578, -0.17938605, 0.08046042, -0.19675075, -0.14346175, -0.15566549, -0.0307311, -0.14872791, -0.03878547, -0.00254308, 0.1565295, 0.08097854, 0.16432391, 0.04949491, -0.17471117, 0.2079512, -0.17290911, 0.10197662, 0.01110592, 0.09702181, -0.21049088, -0.05485036, 0.16571115, 0.13224575, -0.00631514, -0.0666507, 0.10324501, 0.04556064, -0.0946413, 0.1366175, -0.14613271, 0.1439316, 0.01403525, -0.06756077, 0.15449193, 0.01570368, 0.00935933, -0.07182793, -0.05895546, 0.05251422, 0.00088228] -zext:[0.14294301, 0.16004492, -0.133936, 0.17041178, 0.10354671, 0.14033805, -0.18445012, -0.25389433, -0.18157399, -0.06085023, 0.15627292, 0.05945444, 0.0152561, 0.11567469, -0.12275951, 0.01612445, 0.2721165, -0.12822908, 0.29646817, 0.06210494, -0.00723742, -0.1003171, -0.06575806, -0.05716129, -0.04435528, -0.16020222, -0.23530036, -0.18981609, -0.14945146, -0.11926567, -0.08064298, -0.2043876, 0.04202923, -0.10597136, -0.03096929, -0.17040831, 0.0771085, -0.18618186, 0.16527407, -0.14749476, -0.02966438, -0.14139591, 0.0018809, -0.02142575, 0.14795087, 0.07683742, -0.01349613, 0.04579562, -0.17163049, 0.02995836, -0.17292565, 0.11137506, 0.01039091, 0.13139422, -0.19006667, -0.09951284, 0.15722732, 0.12452687, -0.00450555, -0.02189622, 0.13461596, 0.06696767, -0.04037055, -0.13414587, -0.1399019, 0.1544194, 0.01091198, -0.0665535, 0.11422376, 0.00154535, -0.13661395, -0.04903502, -0.05472786, 0.05032588, 0.00220357] \ No newline at end of file +zext:[0.14294301, 0.16004492, -0.133936, 0.17041178, 0.10354671, 0.14033805, -0.18445012, -0.25389433, -0.18157399, -0.06085023, 0.15627292, 0.05945444, 0.0152561, 0.11567469, -0.12275951, 0.01612445, 0.2721165, -0.12822908, 0.29646817, 0.06210494, -0.00723742, -0.1003171, -0.06575806, -0.05716129, -0.04435528, -0.16020222, -0.23530036, -0.18981609, -0.14945146, -0.11926567, -0.08064298, -0.2043876, 0.04202923, -0.10597136, -0.03096929, -0.17040831, 0.0771085, -0.18618186, 0.16527407, -0.14749476, -0.02966438, -0.14139591, 0.0018809, -0.02142575, 0.14795087, 0.07683742, -0.01349613, 0.04579562, -0.17163049, 0.02995836, -0.17292565, 0.11137506, 0.01039091, 0.13139422, -0.19006667, -0.09951284, 0.15722732, 0.12452687, -0.00450555, -0.02189622, 0.13461596, 0.06696767, -0.04037055, -0.13414587, -0.1399019, 0.1544194, 0.01091198, -0.0665535, 0.11422376, 0.00154535, -0.13661395, -0.04903502, -0.05472786, 0.05032588, 0.00220357]