python_code
stringlengths
0
4.04M
repo_name
stringlengths
7
58
file_path
stringlengths
5
147
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import dataclasses import hydra import torch.cuda from hydra.core.config_store import ConfigStore from rlhive.rl_envs import RoboHiveEnv f...
agenthive-dev
scripts/redq/redq.py
""" This is a job script for running policy gradient algorithms on gym tasks. Separate job scripts are provided to run few other algorithms - For DAPG see here: https://github.com/aravindr93/hand_dapg/tree/master/dapg/examples - For model-based NPG see here: https://github.com/aravindr93/mjrl/tree/master/mjrl/algos/mod...
agenthive-dev
baselines/mjrl/mjrl_job_script.py
""" This is a launcher script for launching mjrl training using hydra """ import os import time as timer import hydra from omegaconf import DictConfig, OmegaConf from mjrl_job_script import train_loop # =============================================================================== # Process Inputs and configure job ...
agenthive-dev
baselines/mjrl/hydra_mjrl_launcher.py
import robohive import click DESC=""" Script to render trajectories embeded in the env" """ @click.command(help=DESC) @click.option('-s', '--suite', type=str, help='environment suite to train', default="arms") @click.option('-l', '--launcher', type=click.Choice(['', None, "local", "slurm"]), default='') @click.option...
agenthive-dev
baselines/mjrl/get_trian_cmd.py
#!/usr/bin/env python """ MIT License Copyright (c) 2017 Guillaume Papin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,...
agenthive-dev
.circleci/unittest/linux/scripts/run-clang-format.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from setuptools import setup, find_packages setup( name="psvi", version="0.1.0", description="Setting up a py...
Blackbox-Coresets-VI-main
setup.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree.
Blackbox-Coresets-VI-main
psvi/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. r""" Experiment execution script: Users can specify the dataset, the statistical model and the inference methods, and this...
Blackbox-Coresets-VI-main
psvi/experiments/flow_psvi.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree.
Blackbox-Coresets-VI-main
psvi/experiments/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ ADAPTATION OF flow_psvi FOR MULTI-GPU PLATFORMS """ r""" Experiment execution script: Users can specify the dataset, ...
Blackbox-Coresets-VI-main
psvi/experiments/flow-psvi-parallel.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import contextlib import os import requests import urllib.request import zipfile from collections import namedtuple from i...
Blackbox-Coresets-VI-main
psvi/experiments/experiments_utils.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree.
Blackbox-Coresets-VI-main
psvi/models/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import operator as op from functools import reduce import numpy as np import torch import torch.distributions as dist imp...
Blackbox-Coresets-VI-main
psvi/models/neural_net.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import numpy as np import stan import torch from torch.distributions.normal import Normal def logreg_forward(thetas, x):...
Blackbox-Coresets-VI-main
psvi/models/logreg.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All Rights Reserved. """from https://github.com/lrjconan/RBP/blob/9c6e68d1a7e61b1f4c06414fae04aeb43c8527cb/utils/model_helper.py""" import torch def cg(Ax, b, max_iter=100, epsilon=1.0e-5): """Conjugate Gradient Args: Ax: function, takes list of t...
Blackbox-Coresets-VI-main
psvi/hypergrad/CG_torch.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All Rights Reserved. from itertools import repeat import torch class DifferentiableOptimizer: def __init__(self, loss_f, dim_mult, data_or_iter=None): """ Args: loss_f: callable with signature (params, hparams, [data optional]) ...
Blackbox-Coresets-VI-main
psvi/hypergrad/diff_optimizers.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All Rights Reserved. from .hypergradients import * from .diff_optimizers import *
Blackbox-Coresets-VI-main
psvi/hypergrad/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All Rights Reserved. from typing import Callable, List import torch from torch import Tensor from torch.autograd import grad as torch_grad from . import CG_torch # noinspection PyUnusedLocal def reverse_unroll( params: List[Tensor], hparams: List[Tenso...
Blackbox-Coresets-VI-main
psvi/hypergrad/hypergradients.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import random import time import numpy as np import torch import torch.distributions as dist from torch.distributions.no...
Blackbox-Coresets-VI-main
psvi/inference/baselines.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree.
Blackbox-Coresets-VI-main
psvi/inference/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. r""" Black-box PSVI parent and children classes accessing the dataset via pytorch dataloaders. """ import time import ran...
Blackbox-Coresets-VI-main
psvi/inference/psvi_classes.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch import torch.distributions as dist from psvi.models.neural_net import VILinear from torch.utils.data import D...
Blackbox-Coresets-VI-main
psvi/inference/utils.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. r""" Incremental variational coreset utilising the PSVI objective """ import time import numpy as np import torch im...
Blackbox-Coresets-VI-main
psvi/inference/sparsebbvi.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All Rights Reserved. # # Copyright (c) Facebook, Inc. and its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
Blackbox-Coresets-VI-main
psvi/robust_higher/patch.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All Rights Reserved. # # Copyright (c) Facebook, Inc. and its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
Blackbox-Coresets-VI-main
psvi/robust_higher/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All Rights Reserved. # # Copyright (c) Facebook, Inc. and its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
Blackbox-Coresets-VI-main
psvi/robust_higher/utils.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All Rights Reserved. # # Copyright (c) Facebook, Inc. and its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
Blackbox-Coresets-VI-main
psvi/robust_higher/optim.py
#!/usr/bin/env python # a facade package to expose some useful things from __future__ import absolute_import, print_function, unicode_literals from ddlib.util import tsj_extractor,tsv_extractor,over,returns from collections import OrderedDict
deepdive-master
ddlib/deepdive.py
#! /usr/bin/env python # # This file contains the generic features library that is included with ddlib. # # The three functions that a user should want to use are load_dictionary, # get_generic_features_mention, and get_generic_features_relation. # All the rest should be considered more or less private, except perhaps ...
deepdive-master
ddlib/ddlib/gen_feats.py
from collections import namedtuple,OrderedDict import re import sys from inspect import isgeneratorfunction,getargspec import csv from io import StringIO from datetime import datetime import json def print_error(err_string): """Function to write to stderr""" sys.stderr.write("ERROR[UDF]: " + str(err_string) + "\n"...
deepdive-master
ddlib/ddlib/util.py
from .dd import * from .gen_feats import * from .util import *
deepdive-master
ddlib/ddlib/__init__.py
import sys import collections Word = collections.namedtuple('Word', ['begin_char_offset', 'end_char_offset', 'word', 'lemma', 'pos', 'ner', 'dep_par', 'dep_label']) Span = collections.namedtuple('Span', ['begin_word_id', 'length']) Sequence = collections.namedtuple('Sequence', ['is_inversed', 'elements']) DepEdge = co...
deepdive-master
ddlib/ddlib/dd.py
#!/usr/bin/env python # an identity UDF for Nasty TSJ input/output # for testing @tsj_extractor parser and formatter from deepdive import * def identity_for_nasty_tsj( v1 = "text", v2 = "float", v3 = "boolean", v4 = "boolean", v5 = "text", v6 = "text", v7 = "text...
deepdive-master
ddlib/test/tsj_extractor_identity_udf.py
#! /usr/bin/env python # File: udf/ext_has_spouse_features.py import sys, json import ddlib def my_dep_format_parser(s): parent, label, child = s.split('\t') return (int(parent)-1, label, int(child)-1) for row in sys.stdin: obj = json.loads(row) words = list(ddlib.unpack_words(obj,...
deepdive-master
ddlib/test/test_dep.py
#!/usr/bin/env python # an identity UDF for Nasty TSV input/output # for testing @tsv_extractor parser and formatter from __future__ import print_function from deepdive import * def identity_for_nasty_tsv( v1 = "text", v2 = "float", v3 = "boolean", v4 = "boolean", v5 = "text", ...
deepdive-master
ddlib/test/tsv_extractor_identity_udf.py
#! /usr/bin/env python import unittest import ddlib as dd class TestDDLib(unittest.TestCase): def setUp(self): self.words = ["Tanja", "married", "Jake", "five", "years", "ago"] self.lemma = ["Tanja", "marry", "Jake", "five", "years", "ago"] def test_materialize_span(self): span1 = dd.Span(0, 3) ...
deepdive-master
ddlib/test/test.py
#! /usr/bin/env python # File: udf/ext_has_spouse_features.py import sys, json import ddlib # For each input tuple # TODO: Sample Data and the input schema. # sample json for row in sys.stdin: # Unpack input into tuples. # obj = json.loads(row) words, lemmas = obj["words"], obj["lemma"] span1 = ddlib.Span(...
deepdive-master
ddlib/test/with_ddlib.py
#! /usr/bin/env python # File: udf/ext_has_spouse_features.py import sys, json # For each input tuple # TODO: Sample Data and the input schema. # sample json for row in sys.stdin: obj = json.loads(row) # Library/DSL??? This is a span, it should be an object. p1_start = obj["p1.start_position"] p1_length = o...
deepdive-master
ddlib/test/without_ddlib.py
#! /usr/bin/env python # Usage: calibration.py [target/calibration_data_file.csv] [output_file.png] import sys import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec CALIBRATION_FILE = sys.argv[1] OUT_IMG_FILE = sys.argv[2] labels = [] counts = [] prec = [] counts_train = [] for ...
deepdive-master
util/calibration.py
#!/usr/bin/env python from deepdive import * @tsv_extractor @returns(lambda column1 = "text", column2 = "int", column3 = "float", :[]) def my_udf( column1 = "text", column2 = "int", column3 = "float", ): yield [ column1, column2, column3, ...
deepdive-master
examples/template/udf/extractor_template.py
import os,sys # needed by most import random # random import yaml # yaml parsing import pprint # pretty print if __name__ == "__main__": inpath = 'f52-c3-m1011/' outpath = '' # ... if len(sys.argv) == 3: inpath = sys.argv[1] num = int(sys.argv[2]) else: print 'Usage:',sys.argv[0],'<pat...
deepdive-master
examples/ocr/input/raw/real2bool-feature.py
#!/usr/bin/python # -*- coding: utf-8 -*- import os,sys # needed by most import random # random import yaml # yaml parsing import pprint # pretty print dirbase = 'boolean-f52-c3-m620/' ids = [f.rstrip('.features.txt') for f in os.listdir(dirbase) if f.endswith('.features.txt')] print 'Process files:', ids ...
deepdive-master
examples/ocr/input/raw/gen_feature_table.py
#!/usr/bin/env python from deepdive import * import ddlib @tsj_extractor @returns(lambda p1_id = "text", p2_id = "text", feature = "text", :[]) def extract( p1_id = "text", p2_id = "text", p1_begin_index = "int", p1_end_index = "int", ...
deepdive-master
examples/spouse/udf/extract_spouse_features.py
#!/usr/bin/env python from deepdive import * # for python 3 compatibility try: xrange except NameError: xrange = range @tsj_extractor @returns(lambda mention_id = "text", mention_text = "text", doc_id = "text", sentence_index = "int", begin_index ...
deepdive-master
examples/spouse/udf/map_person_mention.py
#!/usr/bin/env python from deepdive import * import random from collections import namedtuple SpouseLabel = namedtuple('SpouseLabel', 'p1_id, p2_id, label, type') @tsj_extractor @returns(lambda p1_id = "text", p2_id = "text", label = "int", rule_id = "text", :[]) # heuristic ...
deepdive-master
examples/spouse/udf/supervise_spouse.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # The script to randomly split a dataset for hyperparameter tunning import os from absl import app from absl import flags import pdb from datasets import load_dataset, concatenate_datasets FLAGS = flags.FLAGS flags.DEFINE_string("input", "", "Inp...
CompGenRep_MLRC2022-main
split_dataset_for_hp.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # This file include utility functions to compute stats given a dataset import re import os import csv import pdb from prettytable import PrettyTable from torchaudio.functional import edit_distance from transformers import AutoTokenizer from utils...
CompGenRep_MLRC2022-main
utils/dataset_stat.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved import os BASE_DIR = os.environ.get('BASE_DIR') MODEL_DIR = os.path.join(BASE_DIR, 'trained_models/') TMCD_MODEL_DIR = os.path.join(BASE_DIR, 'baseline_replication/TMCD/trained_models/') DATA_DIR = os.path.join(BASE_DIR, 'data/') TMCD_DATA_DIR =...
CompGenRep_MLRC2022-main
utils/constants.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved import os import json from constants import TMCD_DATASETS, TMCD_MODEL_DIR, MODEL_DIR def load_training_curve_info(model_name, dataset, split, checkpoint=None): """ Returns steps [list], ems [list], best_em float """ ems = [] s...
CompGenRep_MLRC2022-main
utils/analysis_utils.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved import os import re from datasets import load_dataset base_dir = os.environ['BASE_DIR'] def load_dataset_with_name(dataset_name, split): """ Take a dataset name and split name, load the dataset. Returns a huggingface dataset dict. ...
CompGenRep_MLRC2022-main
utils/helper_utils/helper_methods.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved import logging import os import re import sys import json import torch from dataclasses import dataclass, field from typing import List, Optional, Tuple import pdb import datasets from datasets import load_dataset, load_metric from ast import lite...
CompGenRep_MLRC2022-main
hf_training/fine_tune_t5.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use...
CompGenRep_MLRC2022-main
hf_training/trainer_seq2seq_sp.py
#!/usr/bin496/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved import sys import os import time import argparse import json import random import shutil import copy import pickle import torch from torch import cuda import numpy as np import time import logging from tokenizer import To...
CompGenRep_MLRC2022-main
baseline_replication/neural-qcfg/train_scan.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved ### Convert tsv data to csv format for transformers training import re from absl import app from absl import flags FLAGS = flags.FLAGS flags.DEFINE_string("tsv", "", "Input tsv file.") flags.DEFINE_string("output", "", "Output tsv file.") def...
CompGenRep_MLRC2022-main
baseline_replication/COGS/convert_to_nqg_format.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved ### Convert tsv data to csv format for transformers training import re from absl import app from absl import flags FLAGS = flags.FLAGS flags.DEFINE_string("tsv", "", "Input tsv file.") flags.DEFINE_string("csv", "", "Output csv file.") def ma...
CompGenRep_MLRC2022-main
baseline_replication/COGS/convert_to_csv.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved ### Convert tsv data to csv format for transformers training import re from absl import app from absl import flags FLAGS = flags.FLAGS flags.DEFINE_string("tsv", "", "Input tsv file.") flags.DEFINE_string("csv", "", "Output csv file.") def ma...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/convert_to_csv.py
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/__init__.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/strip_targets.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/split_dataset.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/tsv_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/scan/convert_to_tsv.py
# coding=utf-8 # Copyright 2022 The Google Research Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ht...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/scan/preprocess_main.py
# coding=utf-8 # Copyright 2022 The Google Research Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ht...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/scan/preprocess.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/scan/join_txt_to_tsv.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/sql_parser_main.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/nqg_preprocess.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved ################################ # val: number(float)/string(str)/sql(dict) # col_unit: (agg_id, col_id, isDistinct(bool)) # val_unit: (unit_op, col_unit1, col_unit2) # table_unit: (table_type, col_unit/sql) # cond_unit: (not_op, op_id, val_unit, v...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/evaluation.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/restore_oov.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/write_dataset.py
# Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved ################################ # Assumptions: # 1. sql is correct # 2. only table name has alias # 3. only one intersect/union/except # # val: number(float)/string(str)/sql(dict) # col_unit: (agg_id, col_id, isDistinct(bool)) # val_unit: (u...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/process_sql.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/nqg_tokenization.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/sql_tokenizer.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/append_schema.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/generate_gold.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/spider/database_constants.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/geobase_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/gen_template_split.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/tmcd_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/measure_unseen_atoms.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/write_dataset.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/xml_file_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/measure_compound_divergence.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/entity_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/funql_normalization.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/tasks/geoquery/gen_tmcd_split.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/common/cky/cfg_parser.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/common/cky/cky_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/common/cky/cfg_rule.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/common/cky/trie_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/test_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/nqg_model.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/config_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/training/train_model.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/training/forest_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/training/training_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/training/input_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/inference/inference_parser.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/inference/generate_predictions.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/inference/inference_wrapper.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) Meta Platforms, Inc. and affiliates All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
CompGenRep_MLRC2022-main
baseline_replication/TMCD/model/parser/inference/eval_model.py