python_code
stringlengths
0
4.04M
repo_name
stringlengths
8
58
file_path
stringlengths
5
147
# Copyright (c) OpenAI # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT # # This file is an extended version of # https://github.com/openai/gym/blob/master/gym/envs/box2d/car_raci...
dcd-main
envs/box2d/car_racing.py
# Copyright (c) OpenAI # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT # # This file is an extended version of # https://github.com/openai/gym/blob/master/gym/envs/box2d/car_raci...
dcd-main
envs/box2d/car_racing_bezier.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 .formula1 import * def get_track(name): if isinstance(name, str): return getattr(sys.modules[__name__], name, No...
dcd-main
envs/box2d/racetracks/__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 sys import pickle import os from .racetrack import RaceTrack # ====== Racetracks ====== Belgium = RaceTrack( n...
dcd-main
envs/box2d/racetracks/formula1.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. class RaceTrack(object): def __init__(self, name, xy, bounds, full_zoom=0.12, max_episode_s...
dcd-main
envs/box2d/racetracks/racetrack.py
dcd-main
teachDeepRL/__init__.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT import numpy as np import pickle import copy from teachDeepRL.teachers.algos.riac import RIAC f...
dcd-main
teachDeepRL/teachers/teacher_controller.py
dcd-main
teachDeepRL/teachers/__init__.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT def get_empty_env_ranges(): return {'roughness':None, 'stump_height':None, ...
dcd-main
teachDeepRL/teachers/utils/test_utils.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT # Modified version of dataset from https://github.com/flowersteam/explauto # Implements a buffe...
dcd-main
teachDeepRL/teachers/utils/dataset.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT # Plotting functions # WARNING ugly code, sorry import matplotlib.patches as patches from matp...
dcd-main
teachDeepRL/teachers/utils/plot_utils.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT import numpy as np from gym.spaces import Box from collections import deque import copy from tr...
dcd-main
teachDeepRL/teachers/algos/riac.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT from sklearn.mixture import GaussianMixture as GMM import numpy as np from gym.spaces import Bo...
dcd-main
teachDeepRL/teachers/algos/covar_gmm.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT from sklearn.mixture import GaussianMixture as GMM import numpy as np from gym.spaces import Bo...
dcd-main
teachDeepRL/teachers/algos/alp_gmm.py
dcd-main
teachDeepRL/teachers/algos/__init__.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT import numpy as np from gym.spaces import Box class RandomTeacher(): def __init__(self, mi...
dcd-main
teachDeepRL/teachers/algos/random_teacher.py
# Copyright (c) 2020 Flowers Team # # Licensed under the MIT License; # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/MIT import numpy as np from gym.spaces import Box from collections import deque class OracleTeache...
dcd-main
teachDeepRL/teachers/algos/oracle_teacher.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from setuptools import find_packages, setup """ Core library deps Version requirements * scipy<=1.9.2: Required by glmnet-python * pandas<=1.4.3: 1....
balance-main
setup.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging import balance import balance.testutil class Te...
balance-main
tests/test_logging.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import balance.testutil import numpy as np from balance.datasets import load_data class TestDatasets( balance.testutil.BalanceTestCase, ): ...
balance-main
tests/test_datasets.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import balance.testutil import numpy as np import pandas as pd im...
balance-main
tests/test_cbps.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import tempfile from copy import deepcopy import balance.testuti...
balance-main
tests/test_sample.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import random import balance import balance.testutil import num...
balance-main
tests/test_adjustment.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import balance.testutil import pandas as pd from balance.sample_c...
balance-main
tests/test_adjust_null.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import tempfile from copy import deepcopy import IPython.display...
balance-main
tests/test_balancedf.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from copy import deepcopy import balance.testutil import numpy as np import numpy.testing import pandas as pd # TODO: remove the use of balance_uti...
balance-main
tests/test_util.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import logging import sys import balance.testutil import numpy as np import pandas as pd class TestTestUtil( balance.testutil.BalanceTestCase,...
balance-main
tests/test_testutil.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals from unittest.mock import patch import balance.testutil import g...
balance-main
tests/test_ipw.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import balance.testutil import matplotlib import matplotlib.pyplo...
balance-main
tests/test_weighted_comparisons_plots.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import balance.testutil import numpy as np import pandas as pd f...
balance-main
tests/test_rake.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import os.path import tempfile import balance.testutil import numpy as np import pandas as pd from balance.cli import _float_or_none, BalanceCLI, m...
balance-main
tests/test_cli.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import balance.testutil import numpy as np import pandas as pd class TestBalance_weights_stats( balance.testutil.BalanceTestCase, ): def te...
balance-main
tests/test_stats_and_plots.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import balance.testutil import numpy as np import pandas as pd fr...
balance-main
tests/test_poststratify.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import logging from typing import Dict, List, Literal, Optional, Tuple, Union import numpy as np import pandas as pd import plotly.graph_objs as go f...
balance-main
balance/balancedf_class.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import collections.abc import copy import logging import tempfile import uuid import warnings from functools import reduce from itertools import comb...
balance-main
balance/util.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import logging from typing import Optional from balance.balancedf_class import ( # noqa BalanceCovarsDF, # noqa BalanceOutcomesDF, # noqa...
balance-main
balance/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import annotations import collections import inspect import logging from copy import deepcopy from typing import Callable, Dict, List...
balance-main
balance/sample_class.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import inspect import logging from argparse import ArgumentParser...
balance-main
balance/cli.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import io import re import sys import unittest from contextlib import contextmanager from typing import Any, Union import numpy as np import pandas ...
balance-main
balance/testutil.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # LICENSE file in the root directory of this source tree. from pathlib import Path from typing import AnyStr, IO, Union FilePathOrBuffer = Union[str...
balance-main
balance/typing.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging from typing import Callable, Dict, List, Literal, ...
balance-main
balance/adjustment.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import pathlib from typing import Literal, Optional, Tuple import numpy as np import pandas as pd # TODO: move the functions from datasets/__init__....
balance-main
balance/datasets/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from typing import Optional import pandas as pd def relative_response_rates( df: pd.DataFrame, df_target: Optional[pd.DataFrame] = None, ...
balance-main
balance/stats_and_plots/general_stats.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import collections import logging import re from typing import Lis...
balance-main
balance/stats_and_plots/weighted_comparisons_stats.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging import random from typing import Dict, List, Lite...
balance-main
balance/stats_and_plots/weighted_comparisons_plots.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2.
balance-main
balance/stats_and_plots/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging from typing import List, Literal, Optional, Tuple, ...
balance-main
balance/stats_and_plots/weighted_stats.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging from typing import Any, Dict, List, Tuple, Union i...
balance-main
balance/stats_and_plots/weights_stats.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging from typing import Any, cast, Dict, List, Optional...
balance-main
balance/weighting_methods/cbps.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging from typing import Dict, Union import pandas as pd...
balance-main
balance/weighting_methods/adjust_null.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging from typing import Dict, List, Optional, Union imp...
balance-main
balance/weighting_methods/poststratify.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2.
balance-main
balance/weighting_methods/__init__.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging import math from fractions import Fraction from f...
balance-main
balance/weighting_methods/rake.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. from __future__ import absolute_import, division, print_function, unicode_literals import logging from contextlib import contextmanager from typing ...
balance-main
balance/weighting_methods/ipw.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. import os import sys # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the docum...
balance-main
sphinx/conf.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 pickle from fig_1 import * def evaluate_function_in_polytope(): # Generate projection matrix np.random.seed(3)...
alebo-main
figs/fig_S4.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 numpy as np from fig_1 import * def hesbo_branin(X, mode): # In 2-D, HESBO has 3 possible embeddings: # Full r...
alebo-main
figs/fig_S1.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 matplotlib import pyplot as plt from matplotlib.lines import Line2D from matplotlib import rc import matplotlib rc('font', ...
alebo-main
figs/plot_config.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 numpy as np import pickle from plot_config import * def make_fig_S5(): with open('data/fig4_sim_output.pckl', 'rb'...
alebo-main
figs/fig_S5.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 pickle import time import torch import numpy as np import cvxpy as cp # 1.0.25 from plot_config import * def gen_A_re...
alebo-main
figs/fig_4.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 json import numpy as np from ax.storage.json_store.decoder import object_from_json from plot_config_nr import * def m...
alebo-main
figs/fig_5.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 json import numpy as np from ax.storage.json_store.decoder import object_from_json def table_S1_data(): with open(...
alebo-main
figs/table_S1.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 numpy as np from ax.utils.measurement.synthetic_functions import branin, hartmann6 from plot_config import * def bran...
alebo-main
figs/fig_1.py
import json import numpy as np from ax.storage.json_store.decoder import object_from_json from plot_config import * def make_nasbench_figure(): with open('../benchmarks/results/nasbench_aggregated_results.json', 'r') as fin: res = object_from_json(json.load(fin)) # A map from method idx in plot_met...
alebo-main
figs/fig_6.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 json import numpy as np from ax.storage.json_store.decoder import object_from_json from plot_config import * def extr...
alebo-main
figs/fig_S8.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 numpy as np from plot_config import * def make_fig_2(): # Run the simulation np.random.seed(1) Ds = [20, ...
alebo-main
figs/fig_2.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 os os.environ['OPENBLAS_NUM_THREADS'] = '1' os.environ['OMP_NUM_THREADS'] = '1' import time import numpy as np import to...
alebo-main
figs/fig_3.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 fig_S8 import * def make_fig_S9(): ys1, ys2 = extract_sensitivity_results() d_es = [2, 3, 4, 5, 6, 7, 8] mus...
alebo-main
figs/fig_S9.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 json import numpy as np from ax.storage.json_store.decoder import object_from_json from plot_config import * def extr...
alebo-main
figs/fig_S10.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 numpy as np import pickle from plot_config import * def make_fig_S2(): # Load in simulation results with open(...
alebo-main
figs/fig_S2.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 fig_4 import * def run_simulation(): t1 = time.time() nsamp = 1000 res = {'unitsphere': {}} for D in [50,...
alebo-main
figs/fig_S6.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 json import numpy as np from ax.storage.json_store.decoder import object_from_json from plot_config import * def make...
alebo-main
figs/fig_S7.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 math import pi from fig_3 import * def compute_ll(f, var, test_Y): return -0.5 * (torch.log(2 * pi * var) + ((test_Y...
alebo-main
figs/fig_S3.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. """ Run NASBench benchmarks """ import os os.environ['OPENBLAS_NUM_THREADS'] = '1' os.environ['OMP_NUM_THREADS'] = '1' import j...
alebo-main
benchmarks/run_nasbench.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 typing import Any, Callable, Dict, List, MutableMapping, Optional, Tuple, Union from ax.models.torch.botorch_defaults impo...
alebo-main
benchmarks/ablation_models.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. """ Run benchmarks for CMAES. Requires installing cma from pip. The experiments here used version 2.7.0. """ import os os.envir...
alebo-main
benchmarks/run_cmaes_benchmarks.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. """ Run benchmarks for SMAC. Requires installing smac from pip. The experiments here used version 2.7.0. """ import os os.envir...
alebo-main
benchmarks/run_smac_benchmarks.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. """ Run benchmarks for TuRBO. Requires installing turbo from https://github.com/uber-research/TuRBO. The experiments here used...
alebo-main
benchmarks/run_turbo_benchmarks.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. """ Compile all of the benchmark results from the different methods (potentially run in a distributed fashion) into a single Ben...
alebo-main
benchmarks/compile_benchmark_results.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 json import numpy as np from scipy.stats import special_ortho_group from typing import List, Optional from ax.benchmark....
alebo-main
benchmarks/benchmark_problems.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. """ Run benchmarks for Add-GP-UCB. Requires installing dragonfly-opt from pip. The experiments here used version 0.1.4. """ imp...
alebo-main
benchmarks/run_addgpucb_benchmarks.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. """ Run benchmarks for LineBO on the Hartmann6 100 problem. These benchmarks are run using the benchmarking suite contained in ...
alebo-main
benchmarks/run_linebo_benchmarks.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. """ Run benchmarks for: ALEBO, REMBO, HeSBO, and Sobol. """ import os os.environ['OPENBLAS_NUM_THREADS'] = '1' os.environ['OMP_N...
alebo-main
benchmarks/run_ax_benchmarks.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. """ Run benchmarks for Ensemble BO. A few steps are required to use EBO: (1) git clone https://github.com/zi-w/Ensemble-Bayesi...
alebo-main
benchmarks/run_ebo_benchmarks.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. """ Requires nasbench==1.0 from https://github.com/google-research/nasbench Also requires dataset nasbench_only108.tfrecord to b...
alebo-main
benchmarks/nasbench_evaluation.py
import os import cv2 import json from tqdm import tqdm import numpy as np import argparse import glob from src.common.utils.preprocessing import load_skeleton from src.common.utils.vis import vis_keypoints from src.common.utils.transforms import world2pixel def visualize_pose_on_frame(frame_path, camera_name, joints...
assemblyhands-toolkit-main
visualization/visualizer.py
from src.main.config import base_cfg as cfg
assemblyhands-toolkit-main
src/__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. # import numpy as np import torch import torch.utils.data import cv2 import os import os.path as osp import random from cop...
assemblyhands-toolkit-main
src/dataset/AssemblyHands-Ego/dataset.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. # # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under Th...
assemblyhands-toolkit-main
src/common/timer.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 logging import os OK = "\033[92m" WARNING = "\033[93m" FAIL = "\033[91m" END = "\033[0m" PINK = "\033[95m" BLUE ...
assemblyhands-toolkit-main
src/common/logger.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 os import os.path as osp import math import time import glob import abc from torch.utils.data import DataLoader im...
assemblyhands-toolkit-main
src/common/base.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 torch import numpy as np from scipy import linalg def cam2pixel(cam_coord, f, c): x = cam_coord[:, 0] / (cam_...
assemblyhands-toolkit-main
src/common/utils/transforms.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 os import sys def make_folder(folder_name): if not os.path.exists(folder_name): os.makedirs(folder_na...
assemblyhands-toolkit-main
src/common/utils/dir.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 os import os.path as osp import cv2 import numpy as np import matplotlib # matplotlib.use('tkagg') from mpl_toolki...
assemblyhands-toolkit-main
src/common/utils/vis.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 os import cv2 import numpy as np from PIL import Image from src import cfg from src.common.utils.transforms import...
assemblyhands-toolkit-main
src/common/utils/preprocessing.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 torch import torch.nn as nn from torch.nn import functional as F import numpy as np from src import cfg import mat...
assemblyhands-toolkit-main
src/common/nets/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. # import os import os.path as osp from src import cfg import torch import torch.nn as nn from torchvision.models.resnet imp...
assemblyhands-toolkit-main
src/common/nets/resnet.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 torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.nn...
assemblyhands-toolkit-main
src/common/nets/layer.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 torch import torch.nn as nn from torch.nn import functional as F from src import cfg from src.common.nets.layer im...
assemblyhands-toolkit-main
src/common/nets/module.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 os import os.path as osp import numpy as np from src.common.utils.dir import add_pypath, make_folder class BaseC...
assemblyhands-toolkit-main
src/main/config.py