python_code
stringlengths
0
4.04M
repo_name
stringlengths
8
58
file_path
stringlengths
5
147
# 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 json import logging import math import sys from collections import defaultdict from pathlib import Path from typin...
atlas-main
src/util.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 copy import torch from src.modeling_bert import BertModel EMBEDDINGS_DIM: int = 768 class Contriever(BertMode...
atlas-main
src/retrievers.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 logging import string from collections import Counter from typing import Callable import numpy as np import regex...
atlas-main
src/evaluation.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 argparse import json import logging from src import dist_utils from src.index import DistributedFAISSIndex, Distr...
atlas-main
src/index_io.py
# Copyright (c) Facebook, Inc. and its 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 errno import logging import os from pathlib import Path from typing import Dict, List, Tuple, Union import torch im...
atlas-main
src/model_io.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 from torch.optim import adamw as _adamw AdamW = _adamw.AdamW adamw = _adamw.F.adamw class AdamWFP32Copy(A...
atlas-main
src/AdamWFP32Copy.py
# coding=utf-8 # Copyright 2018 Mesh TensorFlow authors, T5 Authors and HuggingFace Inc. team. # # 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://www.apache.org/licenses/LICENSE-2...
atlas-main
src/modeling_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. # # 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 cop...
atlas-main
src/modeling_bert.py
# coding=utf-8 # Copyright 2018 Mesh TensorFlow authors, T5 Authors and HuggingFace Inc. team. # # 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://www.apache.org/licenses/LICENSE-2...
atlas-main
src/fid.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 copy import logging import math import time from functools import reduce from typing import List, Optional, Union ...
atlas-main
src/atlas.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 datetime import os import subprocess from logging import getLogger import torch logger = getLogger() def init_d...
atlas-main
src/torchrun_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. import torch import torch.distributed as dist from src import slurm class Gather(torch.autograd.Function): @static...
atlas-main
src/dist_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. import copy import itertools import string import torch from transformers.tokenization_utils_base import PreTrainedToken...
atlas-main
src/tasks/multiple_choice.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 src.evaluation import exact_match_score from src.tasks.base import BaseTask class Task(BaseTask): metrics = ["...
atlas-main
src/tasks/fever.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 from transformers.tokenization_utils_base import PreTrainedTokenizerBase from src.evaluation import exact...
atlas-main
src/tasks/mlm.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 . import base, fever, kilt, lm, mlm, multiple_choice, qa, section AVAILABLE_TASKS = {m.__name__.split(".")[-1]: m f...
atlas-main
src/tasks/__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 logging from src.evaluation import exact_match_score, f1_score, rouge_score from src.options import Options from ...
atlas-main
src/tasks/section.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 from typing import List from src.evaluation import exact_match_score, f1_score, normalize_answer from src....
atlas-main
src/tasks/kilt.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 logging import random import re from src.evaluation import exact_match_score, f1_score, rouge_score from src.opti...
atlas-main
src/tasks/lm.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 json import logging import random from collections import defaultdict from src.evaluation import exact_match_scor...
atlas-main
src/tasks/base.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 from src.evaluation import exact_match_score, f1_score, normalize_answer from src.options import Options f...
atlas-main
src/tasks/qa.py
#!/usr/bin/python # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # 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 __future__ import absolute_import from __future__ import division from __future...
deepfloat-main
bitstream/build_xml.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # 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 argparse import os import shutil import time import glob import subprocess import sys import ma...
deepfloat-main
py/run_fpga_resnet.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # 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 argparse import os import shutil import time import glob import subprocess import sys import ma...
deepfloat-main
py/examine_resnet.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # 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 argparse import os import shutil import time import glob import subprocess import sys import ma...
deepfloat-main
py/fpga.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # 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 math from torch.utils.cpp_extension import CppExtension, BuildExtension def inspe...
deepfloat-main
py/fpga_resnet.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # 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 argparse import os import shutil import time import glob import subprocess import sys import ma...
deepfloat-main
py/validate.py
#!/usr/bin/python3 # Simple Python Fixed-Point Module (SPFPM) # (C)Copyright 2006-2018, RW Penney # This file is (C)Copyright 2006-2018, RW Penney # and is released under the Python-2.4.2 license # (see http://www.python.org/psf/license), # it therefore comes with NO WARRANTY, and NO CLAIMS OF FITNESS FOR ANY PURPOSE...
deepfloat-main
rtl/log/luts/FixedPoint.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # 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 FixedPoint import math import argparse import io parser = argparse.ArgumentParser( descript...
deepfloat-main
rtl/log/luts/gen_tables.py
AutoCTR-main
utils/__init__.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import numpy as np import...
AutoCTR-main
utils/viz_utils.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import os import sys sys.path.append('ge...
AutoCTR-main
utils/search_utils.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import sys sys.path.append('gen-py') imp...
AutoCTR-main
utils/data.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging from copy import deepcopy ...
AutoCTR-main
models/nas_modules.py
AutoCTR-main
models/__init__.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import sys sys.path.append('gen-py') imp...
AutoCTR-main
models/builder.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import torch import torch...
AutoCTR-main
models/utils.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging from copy import deepcopy ...
AutoCTR-main
models/base_net.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import math import numpy ...
AutoCTR-main
nasrec/evolutionary_controller.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging from copy import deepcopy ...
AutoCTR-main
nasrec/base_searcher.py
AutoCTR-main
nasrec/__init__.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import torch from config...
AutoCTR-main
nasrec/builder.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import numpy as np from ...
AutoCTR-main
nasrec/random_controller.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import numpy as np import...
AutoCTR-main
nasrec/utils.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging from copy import deepcopy ...
AutoCTR-main
nasrec/blocks.py
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated #
AutoCTR-main
gen-py/__init__.py
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated # from __future__ import absolute_import import six from thrift.util.Recursive import fix_spec from thrift.Thrift import * from thrift.protocol.TProtocol import TProtocolException import block_config.ttypes...
AutoCTR-main
gen-py/config/constants.py
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated # __all__ = ['ttypes', 'constants']
AutoCTR-main
gen-py/config/__init__.py
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated # from __future__ import absolute_import import six from thrift.util.Recursive import fix_spec from thrift.Thrift import * from thrift.protocol.TProtocol import TProtocolException import block_config.ttypes...
AutoCTR-main
gen-py/config/ttypes.py
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated # from __future__ import absolute_import import six from thrift.util.Recursive import fix_spec from thrift.Thrift import * from thrift.protocol.TProtocol import TProtocolException from .ttypes import *
AutoCTR-main
gen-py/block_config/constants.py
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated # __all__ = ['ttypes', 'constants']
AutoCTR-main
gen-py/block_config/__init__.py
# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated # from __future__ import absolute_import import six from thrift.util.Recursive import fix_spec from thrift.Thrift import * from thrift.protocol.TProtocol import TProtocolException import pprint import warn...
AutoCTR-main
gen-py/block_config/ttypes.py
AutoCTR-main
trainers/__init__.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import torch from config...
AutoCTR-main
trainers/loss.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import re import time imp...
AutoCTR-main
trainers/utils.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import time import numpy ...
AutoCTR-main
trainers/simple_final.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging import time import numpy ...
AutoCTR-main
trainers/simple.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import sys sys.path.append('gen-py') im...
AutoCTR-main
scripts/final_fit.py
# Copyright (c) Facebook, Inc. and its 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 argparse import os import pandas as pd import math import numpy as np from sklearn.model_selection import StratifiedK...
AutoCTR-main
scripts/preprocess.py
AutoCTR-main
scripts/__init__.py
# Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import sys sys.path.append('gen-py') im...
AutoCTR-main
scripts/search.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE_CC-BY-NC4.0 file in the root directory of this source tree. import argparse import glob, json, os, re import tarfile, zipfile import urllib.request import xml.etree.Eleme...
belebele-main
assemble_training_set.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 os from setuptools import find_packages, setup REQUIRES = [ "matplotlib", "torch", ...
aepsych-main
setup.py
#!/usr/bin/env python3 # Copyright 2004-present Facebook. 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 os import path from setuptools import find_packages, setup this_directory = path.abspath(path.dirname(__file__))...
aepsych-main
clients/python/setup.py
aepsych-main
clients/python/tests/__init__.py
#!/usr/bin/env python3 # Copyright 2004-present Facebook. 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 json import unittest import uuid from unittest.mock import MagicMock, patch import torch from aepsych.acquisiti...
aepsych-main
clients/python/tests/test_client.py
#!/usr/bin/env python3 # Copyright 2004-present Facebook. 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 json import socket import warnings from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union if TYPE_C...
aepsych-main
clients/python/aepsych_client/client.py
#!/usr/bin/env python3 # Copyright 2004-present Facebook. 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 .client import AEPsychClient __all__ = ["AEPsychClient"]
aepsych-main
clients/python/aepsych_client/__init__.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 abc import ast import configparser import json import warnings from types import ModuleType fro...
aepsych-main
aepsych/config.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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. __version__ = "0.4.0"
aepsych-main
aepsych/version.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 warnings from typing import Callable, Iterable, List, Optional, Union import matplotlib.pyplo...
aepsych-main
aepsych/plotting.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 sys from gpytorch.likelihoods import BernoulliLikelihood, GaussianLikelihood from . import a...
aepsych-main
aepsych/__init__.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import annotations import time import warnings from copy import copy from typing im...
aepsych-main
aepsych/strategy.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 logging import logging.config import os logger = logging.getLogger() def getLogger(level=lo...
aepsych-main
aepsych/utils_logging.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 collections.abc import Iterable from configparser import NoOptionError from typing import Dict, ...
aepsych-main
aepsych/utils.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import annotations import itertools import time from random import shuffle from typi...
aepsych-main
aepsych/benchmark/benchmark.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 itertools import logging import time import traceback from copy import deepcopy from pathlib i...
aepsych-main
aepsych/benchmark/pathos_benchmark.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 .benchmark import Benchmark, DerivedValue from .pathos_benchmark import PathosBenchmark, run_ben...
aepsych-main
aepsych/benchmark/__init__.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 functools import cached_property from typing import Any, Dict, Union import aepsych import nump...
aepsych-main
aepsych/benchmark/problem.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 io import math from typing import Callable import numpy as np import pandas as pd from scipy....
aepsych-main
aepsych/benchmark/test_functions.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 datetime import logging import os import uuid from contextlib import contextmanager from pathl...
aepsych-main
aepsych/database/db.py
aepsych-main
aepsych/database/__init__.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import absolute_import, division, print_function, unicode_literals import logging im...
aepsych-main
aepsych/database/tables.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import annotations from typing import Any import torch from gpytorch.kernels.rbf_ke...
aepsych-main
aepsych/kernels/rbf_partial_grad.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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.
aepsych-main
aepsych/kernels/__init__.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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""" """ from __future__ import annotations from typing import Optional import torch from aepsych....
aepsych-main
aepsych/acquisition/mutual_information.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 typing import Optional, Union import torch from aepsych.acquisition.objective import ProbitObje...
aepsych-main
aepsych/acquisition/lse.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 typing import Any, Dict, Optional, Tuple import torch from botorch.acquisition.objective impor...
aepsych-main
aepsych/acquisition/lookahead_utils.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import annotations import torch from botorch.posteriors import Posterior from botorc...
aepsych-main
aepsych/acquisition/rejection_sampler.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 sys from ..config import Config from .lookahead import ApproxGlobalSUR, EAVC, GlobalMI, Globa...
aepsych-main
aepsych/acquisition/__init__.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 typing import Optional import torch from aepsych.acquisition.monotonic_rejection import Monoton...
aepsych-main
aepsych/acquisition/mc_posterior_variance.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 math import pi as _pi import torch inv_2pi = 1 / (2 * _pi) _neg_inv_sqrt2 = -1 / (2**0.5) d...
aepsych-main
aepsych/acquisition/bvn.py
#!/usr/bin/env python3 # 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. from __future__ import annotations from typing import Optional, Tuple from ax.models.torch.botorch_modular.acquisit...
aepsych-main
aepsych/acquisition/acquisition.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 typing import Optional, Tuple, cast import numpy as np import torch from aepsych.utils import m...
aepsych-main
aepsych/acquisition/lookahead.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import annotations from typing import Optional import torch from botorch.acquisitio...
aepsych-main
aepsych/acquisition/monotonic_rejection.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import annotations from typing import Optional import torch from botorch.acquisitio...
aepsych-main
aepsych/acquisition/objective/objective.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import annotations from typing import Optional import torch from aepsych.config imp...
aepsych-main
aepsych/acquisition/objective/semi_p.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 sys from ...config import Config from .objective import ( AEPsychObjective, FloorGumb...
aepsych-main
aepsych/acquisition/objective/__init__.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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.
aepsych-main
aepsych/means/__init__.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its 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 __future__ import annotations import torch from gpytorch.means.constant_mean import ConstantMea...
aepsych-main
aepsych/means/constant_partial_grad.py