repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
gunho1123/models | [
"a5d63cd3c28e30476ea53f1a5c3d13370926054d"
] | [
"official/projects/yolact/modeling/yolact_model.py"
] | [
"# Copyright 2021 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.expand_dims",
"tensorflow.matmul",
"tensorflow.keras.utils.register_keras_serializable",
"tensorflow.transpose"
]
] |
derekeverett/stat_model_surrogates | [
"48b140fe89ac1ffa5a7d5733337a5fa519f95d6f"
] | [
"Bayesian_NN_regression/nn_grid_search.py"
] | [
"import pickle\nimport sklearn\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom warnings import filterwarnings\nfilterwarnings('ignore')\n\nimport seaborn as sns\nsns.set()\nfrom pandas.plotting import scatter_matrix\nfrom sklearn import datasets\nfrom sklearn.preprocessing import StandardScaler\nfrom skl... | [
[
"numpy.append",
"sklearn.preprocessing.MinMaxScaler",
"tensorflow.keras.wrappers.scikit_learn.KerasRegressor",
"numpy.expand_dims",
"sklearn.model_selection.GridSearchCV",
"numpy.array",
"sklearn.model_selection.train_test_split"
]
] |
themantalope/MONAI | [
"f398298b5aadc076102261a687a158f6ac17ad1c"
] | [
"tests/test_patch_wsi_dataset.py"
] | [
"# Copyright 2020 - 2021 MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre... | [
[
"numpy.array",
"numpy.testing.assert_array_equal"
]
] |
Mirkazemi/openml-python | [
"4ff66ed284790e4ae29245a15e23a3fa1f1c3a6b"
] | [
"openml/tasks/functions.py"
] | [
"# License: BSD 3-Clause\n\nfrom collections import OrderedDict\nimport io\nimport re\nimport os\nfrom typing import Union, Dict, Optional\n\nimport pandas as pd\nimport xmltodict\n\nfrom ..exceptions import OpenMLCacheException\nfrom ..datasets import get_dataset\nfrom .task import (\n OpenMLClassificationTask,... | [
[
"pandas.DataFrame.from_dict"
]
] |
jackyoung96/PettingZoo | [
"7ebcd1ddf9124b6857048af930d677974ab201a6"
] | [
"pettingzoo/mpe/scenarios/simple_world_comm.py"
] | [
"import numpy as np\n\nfrom .._mpe_utils.core import Agent, Landmark, World\nfrom .._mpe_utils.scenario import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def make_world(\n self,\n num_good_agents=2,\n num_adversaries=4,\n num_landmarks=1,\n num_food=2,\n num_fores... | [
[
"numpy.zeros",
"numpy.exp",
"numpy.array",
"numpy.concatenate",
"numpy.square"
]
] |
nicohrubec/blackjack_simulator | [
"b934a61f29ceae1bd37238963dfc83888bcdb5bd"
] | [
"src/game_simulation/players.py"
] | [
"from src import configs\nimport pandas as pd\nimport numpy as np\n\n\n# creates player instances from predefined options\ndef player_factory(player_type, capital):\n if player_type == 'basic':\n return BasicPlayer(init_capital=capital)\n elif player_type == 'strategic':\n return StrategicPlayer... | [
[
"numpy.round",
"pandas.read_excel"
]
] |
MikeFlanigan/DMU_project | [
"6ae5f658f25f2bd10e20a94f0ccc9a6dd669bac9"
] | [
"pf_test_3d.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Wedge\n\nimport mpl_toolkits.mplot3d as a3\nimport matplotlib.colors as colors\nimport pylab as pl\nimport scipy as sp\nimport math\n\n\nrigx = 0.5\nrigy = 0.5\nrigz = 0.0\ncent = (rigx, rigy, rigz)\n\nradius = 0.5\n\ncam_info = {\... | [
[
"numpy.arctan2",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.asarray",
"numpy.cos",
"numpy.clip",
"numpy.random.rand",
"matplotlib.pyplot.close",
"numpy.sqrt",
"numpy.sin",
"numpy.concatenate",
"numpy.random.randint",
"numpy.deg2rad"
]
] |
Euro2xx/generative-compression | [
"489f4fb77620e9b6d8f3bef691d32d50f6bb09be"
] | [
"compress.py"
] | [
"#!/usr/bin/python3\nimport tensorflow as tf\nimport numpy as np\nimport pandas as pd\nimport time, os, sys\nimport argparse\n\n# User-defined\nfrom network import Network\nfrom utils import Utils\nfrom data import Data\nfrom model import Model\nfrom config import config_test, directories\n\ntf.logging.set_verbosit... | [
[
"tensorflow.global_variables_initializer",
"tensorflow.train.get_checkpoint_state",
"tensorflow.logging.set_verbosity",
"tensorflow.ConfigProto",
"tensorflow.train.Saver",
"numpy.array",
"tensorflow.local_variables_initializer"
]
] |
slimgroup/Software.siahkoohi2020EAGEdlb | [
"5d20f6891ca8a17fa1695ed629c3a589ab8416bd"
] | [
"src/sample.py"
] | [
"import torch\nimport numpy as np\nimport time\nimport matplotlib.pyplot as plt\nimport os\nimport h5py\nfrom load_vel import overthrust_model\nfrom generator import generator\nfrom tqdm import tqdm\nfrom scipy.interpolate import interp1d\nimport matplotlib.ticker as ticker\nsfmt=ticker.ScalarFormatter(useMathText=... | [
[
"torch.set_default_tensor_type",
"matplotlib.pyplot.imshow",
"torch.cuda.is_available",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"torch.randn",
"matplotlib.pyplot.figure",
"numpy.random.choice",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.title",
"torch.de... |
shizizhou/ROAR | [
"f143605d84f30f071e24e8224014c0358e260c42"
] | [
"ROAR/agent_module/legacy_agents/point_cloud_map_recording_agent.py"
] | [
"from ROAR.agent_module.agent import Agent\r\nfrom ROAR.utilities_module.data_structures_models import SensorsData\r\nfrom ROAR.utilities_module.vehicle_models import Vehicle, VehicleControl\r\nfrom ROAR.perception_module.legacy.ground_plane_point_cloud_detector import GroundPlanePointCloudDetector\r\nfrom ROAR.vis... | [
[
"numpy.linalg.inv",
"numpy.logical_and",
"numpy.amax",
"numpy.amin",
"numpy.shape",
"numpy.array"
]
] |
rhong3/Neutrophil | [
"97efb7cc01dc7b1bb06e29a824352d493bb4add5"
] | [
"scripts/Legacy/deprecated/cnnva.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 7 12:02:45 2017\n\n@authors: lwk, RH\n\n\"\"\"\n\nfrom datetime import datetime\nimport os\nimport sys\n\nimport numpy as np\nimport tensorflow as tf\nimport vgg\n\nslim = tf.contrib.slim\n\n\nclass INCEPTION():\n \"\"\"\n Use the I... | [
[
"tensorflow.placeholder_with_default",
"tensorflow.placeholder",
"tensorflow.summary.scalar",
"tensorflow.reshape",
"tensorflow.summary.merge_all",
"tensorflow.global_variables_initializer",
"tensorflow.global_variables",
"tensorflow.cast",
"tensorflow.contrib.layers.optimize_l... |
glamod/glamod-nuim | [
"eed6f9d7d71b0c456ef39fdea6b58677e13ab50c"
] | [
"source_convert_IFF_code/321/DWD_oseas_data_extract_ws_pacific.py"
] | [
"\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Mar 19 09:02:55 2019\r\n\r\n@author: 67135099\r\n\"\"\"\r\n##reads all the files in the current working directory, make sure only input files are in folde\r\nimport os\r\n#import numpy as np \r\nos.chdir(r\"D:/DWD_overseas_subdy/data_pacific/\") \r\nfiles... | [
[
"pandas.to_numeric",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
TragerJoswig-Jones/dvoc_model | [
"fb5d369096e436b2e4a518c4f16c3493e36aadfc"
] | [
"dvoc_model/droop.py"
] | [
"from math import pi, sin, cos\nimport numpy as np\n\nfrom dvoc_model.reference_frames import SinCos, Abc, Dq0, AlphaBeta\nfrom dvoc_model.constants import *\nfrom dvoc_model.simulate import simulate, shift_controller_angle_half\nfrom dvoc_model.elements import Node, RefFrames\nfrom dvoc_model.calculations import c... | [
[
"numpy.arange",
"numpy.ones",
"matplotlib.pyplot.show",
"numpy.array"
]
] |
KerasKorea/YOLK_ObjectDetector | [
"78a260746c50508fcdf1d0c56a7d4f5373b1f5bf"
] | [
"keras_ssd/data_generator/object_detection_2d_data_generator.py"
] | [
"'''\nA data generator for 2D object detection.\n\nCopyright (C) 2018 Pierluigi Ferrari\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n... | [
[
"numpy.random.uniform",
"numpy.any",
"numpy.asarray",
"numpy.arange",
"numpy.stack",
"numpy.concatenate",
"numpy.array"
]
] |
doaa-altarawy/ml_models_deploy | [
"d39f07887e75aedb0f3530934f0b61afe3fabbac"
] | [
"models/qc_time_estimator/qc_time_estimator/predict.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom qc_time_estimator.config import config\nfrom qc_time_estimator.processing.data_management import load_pipeline\nfrom qc_time_estimator.processing.validation import validate_inputs\nfrom qc_time_estimator.metrics import mape, percentile_rel_90\nfrom qc_time_estimator im... | [
[
"pandas.DataFrame"
]
] |
daanknoors/synthetic_data_generation | [
"5a0d1818cba2bc8b629869773a2f86a156d25fd9"
] | [
"synthesis/evaluation/evaluator.py"
] | [
"\"\"\"\nUtility evaluator. Comparing a reference dataset to 1 or more target datasets.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom pathlib import Path\n\nimport synthesis.evaluation.metrics as metrics\nfrom synthesis.evaluation._base import BaseMetric, COLOR_PALETTE\n\... | [
[
"matplotlib.pyplot.show"
]
] |
Lee-Gihun/Micronet_GSJ | [
"72289bb66507b6c3b4d14f2e5916dec718a1b198"
] | [
"AutoML_autoaug.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nos.environ['OMP_NUM_THREADS'] = '1'\nimport sys\nimport math\nimport random\nimport shutil\nimport pickle\nimport logging\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lr_scheduler\nimport torchvision.models as models\nimpo... | [
[
"numpy.linspace"
]
] |
aliwimo/uav_placement | [
"85cde62361dd2bbfd907033b6954998b3461b1ee"
] | [
"firefly/config_file.py"
] | [
"import numpy as np\r\n\r\nPOP_SIZE = 50\r\nMAX_GEN = 1\r\nDIM_SIZE = 3\r\nALPHA = 1.0\r\nBETA0 = 0.5\r\nGAMMA = 1.0\r\nBOUND = 1000\r\nUB = BOUND\r\nLB = -BOUND\r\nBUILDING = [20, 50, 200] #b1\r\n# BUILDING = ... | [
[
"numpy.loadtxt"
]
] |
Megscammell/METOD-Algorithm | [
"7518145ec100599bddc880f5f52d28f9a3959108"
] | [
"src/metod_alg/objective_functions/calc_minimizer_sog.py"
] | [
"import numpy as np\nfrom numpy import linalg as LA\n\n\ndef calc_minimizer_sog(point, p, sigma_sq, store_x0, matrix_test, store_c):\n \"\"\"\n Finds the nearest local minimizer for point using the Sum of Gaussians\n function.\n\n Parameters\n ----------\n point : 1-D array with shape (d, )\n ... | [
[
"numpy.argmin",
"numpy.linalg.norm",
"numpy.min",
"numpy.zeros"
]
] |
Giannos-G/scikit-learn_modified | [
"03df71bbea1bcb3423262b711191552420422cda"
] | [
"examples/applications/plot_out_of_core_classification.py"
] | [
"\"\"\"\n======================================================\nOut-of-core classification of text documents\n======================================================\n\nThis is an example showing how scikit-learn can be used for classification\nusing an out-of-core approach: learning from data that doesn't fit into... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.asarray",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xticks",
"sklearn.linear_model.SGDClassifier",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.title"... |
bagustris/calfem-python | [
"f5946c7d822ec70d6420a36d197c41ad263d05a0"
] | [
"calfem/vis_mpl.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.collections\nimport matplotlib.path as mpp\nimport matplotlib.patches as patches\nimport matplotlib as mpl\nimport matplotlib.tri as tri\n\ntry:\n from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as... | [
[
"numpy.cross",
"numpy.asarray",
"numpy.asmatrix",
"matplotlib.path.Path",
"matplotlib.pyplot.plot",
"numpy.vstack",
"numpy.allclose",
"matplotlib.pyplot.tricontour",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.figure",
"numpy.reshape",
"... |
g-parki/bokeh | [
"664ead5306bba64609e734d4105c8aa8cfb76d81"
] | [
"examples/plotting/file/slider.py"
] | [
"''' An interactive plot of the ``sin`` function. This example demonstrates\nadding widgets and ``CustomJS`` callbacks that can update a plot.\n\n.. bokeh-example-metadata::\n :apis: bokeh.plotting.Figure.line, bokeh.layouts.column, bokeh.layouts.row, bokeh.models.callbacks.CustomJS, bokeh.models.widgets.sliders... | [
[
"numpy.sin",
"numpy.linspace"
]
] |
KESHAmambo/IEEE_802_11ad_beamforming_simulation | [
"93328a41d9c044ee7596d02e360fb3b5f2250ec0"
] | [
"graph/ap (0, 0, 0), 12 sect, mob 4 sect/dynamic/degree variation, 3 slots, 25 stations/with 0/avg_dist.py"
] | [
"\"\"\"\nDistribution plot options\n=========================\n\n\"\"\"\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\navgArr0 = [684.0322959592726, 884.7363009861817, 888.8322884189091, 942.080300986182, 970.7522934458182, 991.2322959592727, 991.2323009861818, 1011.712300986182, 1... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.show",
"numpy.array"
]
] |
dliu5812/PDAM | [
"09a5511e6bd10158ea06771c63be3150982b9fe3"
] | [
"maskrcnn_benchmark/modeling/domain_adaption/LabelResizeLayer.py"
] | [
"#\n# from __future__ import absolute_import\n# from __future__ import division\n# from __future__ import print_function\nimport random\nimport torch\nimport torch.nn.functional as F\nimport torchvision.models as models\nfrom torch.autograd import Variable\nimport numpy as np\nimport torch.nn as nn\nfrom torch.auto... | [
[
"numpy.array",
"numpy.ones",
"torch.from_numpy",
"numpy.zeros"
]
] |
Burntt/MastersMachineLearning | [
"9c8896b4dfe46ee02bc5fdbca47acffbeca6828e"
] | [
"day10_Optimization_and_Regularization_in_DL/notmnist.py"
] | [
"import os\nfrom glob import glob\n\nimport numpy as np\nfrom matplotlib.pyplot import imread\nfrom sklearn.model_selection import train_test_split\n\n\ndef load_notmnist(\n path=\"./notMNIST_small\", letters=\"ABCDEFGHIJ\", img_shape=(28, 28), test_size=0.25, one_hot=False\n):\n\n # download data if it's mis... | [
[
"matplotlib.pyplot.imread",
"numpy.max",
"numpy.stack",
"numpy.std",
"sklearn.model_selection.train_test_split",
"numpy.mean"
]
] |
pedro-abreu/twostream-attention | [
"60a47c50b8f2427911e5e30fd6c6f933dbf08a4e"
] | [
"code/code_AVA/extra/pose_test.py"
] | [
"import tensorflow as tf\nimport utils\nimport voting\nfrom pose_model import pose_create_model, compile_model\nfrom pose_data import load_split, get_AVA_set\nimport time\nfrom keras import backend as K\nimport numpy as np\nimport pickle\n\n\ndef main():\n\n root_dir = '../../data/AVA/files/'\n\n # Load list ... | [
[
"tensorflow.device",
"numpy.zeros"
]
] |
greatwallet/cosypose | [
"e72ce7d521ef61870daef267cbbe65aaebe9d24d"
] | [
"evaluation/meters/detection_meters.py"
] | [
"import numpy as np\r\nfrom sklearn.metrics import average_precision_score\r\nimport xarray as xr\r\nimport torchvision\r\nimport torch\r\nfrom torch.utils.data import TensorDataset, DataLoader\r\nfrom .base import Meter\r\n\r\nfrom .utils import (match_poses, get_top_n_ids,\r\n add_valid_gt, get... | [
[
"torch.empty",
"torch.utils.data.DataLoader",
"torch.utils.data.TensorDataset",
"sklearn.metrics.average_precision_score",
"torch.cat",
"numpy.unique",
"numpy.minimum"
]
] |
Chandler/color_science_papers | [
"c43addd63d5dc9bc7ed5f093f60432c929d13b8a"
] | [
"a_simple_algorithm_for_metamer_mismatch_bodies/metamer_mismatch_body.py"
] | [
"import numpy as np\nfrom scipy import optimize\nfrom numpy.testing import assert_array_almost_equal as almost_equal\n\nCOLOR_DIMENSIONS = 3\nLIGHT_DIMENSIONS = 31\n\n# vector representing a light beam with power 1 at every wavelength\nequal_energy_illumination_vector = [1] * LIGHT_DIMENSIONS\n\ndef assert_shape(m... | [
[
"scipy.optimize.linprog",
"numpy.linalg.norm",
"numpy.random.randn",
"numpy.dot"
]
] |
schoppmp/iree | [
"d573c3dbb4eef8044764ae6d80ca79e37e8de522"
] | [
"bindings/python/tests/testdata/generate_tflite.py"
] | [
"# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed... | [
[
"tensorflow.square",
"tensorflow.TensorSpec",
"tensorflow.lite.TFLiteConverter.from_concrete_functions"
]
] |
JoaoVicente129/GamestonkTerminal | [
"5f744f8ff3f034e436d0629fb530ffd41b86e6d9"
] | [
"gamestonk_terminal/behavioural_analysis/reddit_view.py"
] | [
"import argparse\nimport warnings\nimport pandas as pd\nfrom prawcore.exceptions import ResponseException\nfrom requests import HTTPError\nfrom psaw import PushshiftAPI\nimport praw\nimport finviz\nfrom gamestonk_terminal.helper_funcs import check_positive, parse_known_args_and_warn\nfrom gamestonk_terminal import ... | [
[
"pandas.DataFrame"
]
] |
wann31828/Tacotron-2 | [
"d7161f950cd42c7a7fd36ec2aaac19ba60567876"
] | [
"tacotron/utils/plot.py"
] | [
"import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nimport numpy as np\n\n\ndef split_title_line(title_text, max_words=5):\n\t\"\"\"\n\tA function that splits any string based on specific character\n\t(returning it with the string), with maximum number of words on it\n\t\"\"\"\n\tseq = tit... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"numpy.rot90",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.close",
"matplotlib.use",
"matplotlib.pyplot.xlabel"
]
] |
suryakantpandey/opencv | [
"2a52e44bc605bf73502dee0e0e3954bcda19a246"
] | [
"modules/calib3d/misc/python/test/test_solvepnp.py"
] | [
"#!/usr/bin/env python\n# Python 2/3 compatibility\nfrom __future__ import print_function\n\nimport numpy as np\nimport cv2 as cv\n\nfrom tests_common import NewOpenCVTests\n\nclass solvepnp_test(NewOpenCVTests):\n\n def test_regression_16040(self):\n obj_points = np.array([[0, 0, 0], [0, 1, 0], [1, 1, 0]... | [
[
"numpy.array"
]
] |
jrkoenig/folseparators | [
"7b35a1e5fc27709adcc647528bf8820201408966"
] | [
"experiments/make_charts.py"
] | [
"# Copyright 2020 Stanford University\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or ag... | [
[
"matplotlib.pyplot.rc",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.ylim",
"matplotlib.use",
"matplotlib.pyplot.xlabel"
]
] |
thinhnd2104/dask | [
"995c9dcd47ec040564a66d399fffea18e3dac597"
] | [
"dask/dataframe/shuffle.py"
] | [
"import contextlib\nimport logging\nimport math\nimport shutil\nimport tempfile\nimport uuid\n\nimport numpy as np\nimport pandas as pd\nimport tlz as toolz\n\nfrom .. import base, config\nfrom ..base import compute, compute_as_if_collection, is_dask_collection, tokenize\nfrom ..highlevelgraph import HighLevelGraph... | [
[
"pandas.api.types.is_categorical_dtype",
"numpy.min_scalar_type",
"pandas.api.types.is_list_like",
"pandas.api.types.is_integer_dtype",
"numpy.floor_divide",
"pandas.Categorical",
"numpy.mod",
"pandas.isnull",
"numpy.isscalar",
"numpy.linspace",
"pandas.isna"
]
] |
XidaoW/iFac | [
"43c3103051dfffefe8e0eb09fc7fd53b14754519"
] | [
"src/src/engine/myutil/sampler.py"
] | [
"#!/usr/bin/python\n# -*- coding:utf-8 -*-\n'''\nCreated on 2015/04/13\n\n@author: drumichiro\n'''\nimport numpy as np\nimport matplotlib.mlab as mlab\n\n\ndef generateSample(baseLength, mu, sigma, distFunc):\n x = np.empty([])\n np.random.seed(0)\n for i1 in range(len(mu)):\n data = distFunc(mu[i1]... | [
[
"matplotlib.mlab.normpdf",
"numpy.append",
"numpy.empty",
"numpy.random.seed",
"numpy.sqrt"
]
] |
bainro/garage | [
"c5afbb19524792d9bbad9b9741f45e1d48ddca3d"
] | [
"src/garage/tf/policies/categorical_cnn_policy.py"
] | [
"\"\"\"CategoricalCNNPolicy with model.\"\"\"\nimport akro\nimport tensorflow as tf\n\nfrom garage.tf.distributions import Categorical\nfrom garage.tf.models import CNNModel\nfrom garage.tf.models import MLPModel\nfrom garage.tf.models import Sequential\nfrom garage.tf.policies import StochasticPolicy\n\n\nclass Ca... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.zeros_initializer",
"tensorflow.compat.v1.get_default_session",
"tensorflow.cast",
"tensorflow.compat.v1.variable_scope",
"tensorflow.initializers.glorot_uniform"
]
] |
choishingwan/PRScsx | [
"f7941665c2d86754dbc94a25f2d6d19aea23be32"
] | [
"gigrnd.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nRandom variate generator for the generalized inverse Gaussian distribution.\nReference: L Devroye. Random variate generation for the generalized inverse Gaussian distribution.\n Statistics and Computing, 24(2):239-246, 2014.\n\n\"\"\"\n\n\nimport math\nfrom scipy import r... | [
[
"scipy.random.random"
]
] |
landreman/pyQSC | [
"75f34d62c24eb94f481632ee0e1bf260d7581f2a"
] | [
"qsc/qsc.py"
] | [
"\"\"\"\nThis module contains the top-level routines for the quasisymmetric\nstellarator construction.\n\"\"\"\n\nimport logging\nimport numpy as np\nfrom scipy.io import netcdf\n#from numba import jit\n\n#logging.basicConfig(level=logging.DEBUG)\nlogger = logging.getLogger(__name__)\n\nclass Qsc():\n \"\"\"\n ... | [
[
"numpy.zeros",
"numpy.mod",
"numpy.max",
"numpy.min",
"numpy.array",
"scipy.io.netcdf.netcdf_file"
]
] |
TharinduRusira/tvm | [
"b076cad542524cb3744149d953c341b5815f6474"
] | [
"topi/tests/python_cpp/test_topi_reorg.py"
] | [
"\"\"\"Test code for reorg\"\"\"\nimport logging\nimport numpy as np\nimport tvm\nimport topi\nimport topi.testing\nfrom topi.util import get_const_tuple\n\ndef verify_reorg(batch, in_size, in_channel, stride):\n '''Verify reorg operator by comparing outputs from tvm and numpy implementation'''\n in_height = ... | [
[
"numpy.random.uniform"
]
] |
thunderball7cd/night-to-day-image-processing | [
"388a082241af4bc67e770c76f207b58b330063d9"
] | [
"src/denoising/torch_utils.py"
] | [
"\"\"\"\n## CycleISP: Real Image Restoration Via Improved Data Synthesis\n## Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, Ming-Hsuan Yang, and Ling Shao\n## CVPR 2020\n## https://arxiv.org/abs/2003.07761\n\"\"\"\n\nfrom collections import OrderedDict\n\nimport torch\n\n\ndef load_... | [
[
"torch.load"
]
] |
wakataw/ipython-dawet-sql | [
"af17db523bfcee236e2bae7cc36995e5b41f6c36"
] | [
"dawetsql/odbc_sql.py"
] | [
"import logging\nimport pypyodbc\nimport sys\n\nfrom pandas import DataFrame, read_sql, concat\nfrom IPython.core import magic_arguments\nfrom IPython.core.magic import magics_class, Magics, line_magic, cell_magic\nfrom dawetsql.widgets import SchemaExplorer\nfrom . import utils\nfrom cryptography.fernet import Fer... | [
[
"pandas.DataFrame",
"pandas.concat",
"pandas.read_sql"
]
] |
Lumonk/CNNs.PyTorch | [
"d634fb63c86bc135e7be79102983045696bdaed4"
] | [
"modules/dfx_modules.py"
] | [
"from __future__ import division\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .dfx import quant, quant_grad, quant_fb\n\n__all__ = ['QLinear', 'QConv2d', 'QBatchNorm2d']\n\nclass QLinear(nn.Linear):\n\n def __init__(self, in_features, out_features, bias=True, weight_copy=True):\n ... | [
[
"torch.ones",
"torch.nn.functional.linear",
"torch.nn.functional.conv2d",
"torch.tensor",
"torch.nn.functional.batch_norm",
"torch.zeros",
"torch.Tensor"
]
] |
VT-ASIM-LAB/autoware.ai | [
"211dff3bee2d2782cb10444272c5d98d1f30d33a"
] | [
"jsk_recognition/jsk_recognition_utils/python/jsk_recognition_utils/depth.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom skimage.segmentation import slic\nfrom skimage.feature import peak_local_max\nfrom skimage.morphology import binary_closing\n\nfrom jsk_recognition_utils.mask import descent_closing\n\n\ndef split_fore_background(depth_img, footprint=None):... | [
[
"numpy.ones"
]
] |
565353780/railway-fault-detect | [
"56c5df835d21efeb4e09111282d251c80eaa6ca0"
] | [
"src/Python/lapnet/test_line.py"
] | [
"import torch\nimport numpy as np\nimport os\n\nimport cv2\n\nfrom LapNet import LAPNet\nfrom create_dataset import createDataset\nfrom torch.nn import DataParallel\nfrom collections import OrderedDict\nfrom torch.nn.parameter import Parameter\nimport json\nimport base64\nimport numpy as np\n\nfrom flask import Fla... | [
[
"torch.utils.data.DataLoader",
"torch.load",
"torch.tensor",
"torch.squeeze",
"numpy.frombuffer",
"torch.cuda.set_device"
]
] |
undeadinu/dldt | [
"fbc7a4a710c24def8ab199926a7da90a0394b87d"
] | [
"model-optimizer/mo/front/common/partial_infer/matmul.py"
] | [
"\"\"\"\n Copyright (c) 2018 Intel Corporation\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law ... | [
[
"numpy.array",
"numpy.concatenate"
]
] |
lsoffi/EsperienzeDiLaboratorioDiCalcolo201920 | [
"7a2a821b37cc8dfca527e9afb639a86a8e6c759b"
] | [
"esercitazioni/ex3.py"
] | [
"#!/usr/bin/env python3\nimport matplotlib.pyplot as plt\nimport numpy as np\nplt.title('Un primo plot con Python')\nplt.xlabel('x')\nplt.ylabel('y')\nx = np.linspace(0.0, 5.0, 100)\ny = x\nplt.plot(x,y,label='y=x')\nx, y = np.loadtxt('temp.dat', usecols=(0,2), delimiter=' ', unpack=True)\nplt.plot(x,y, 'x',label='... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"numpy.linspace",
"matplotlib.pyplot.xlabel",
"numpy.loadtxt"
]
] |
Rockysed/PSC_classification | [
"1815b673ac9374d9d2abd08ba0f1f43597316dee"
] | [
"code/plotting_psc.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Jan 23 10:48:58 2019\r\n\r\n@author: rocco\r\n\"\"\"\r\nimport cartopy.crs as ccrs\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\nimport os\r\n\r\n\"\"\"\r\nDefinition function to plot psc, df is a pandas dataframe, i = 0 if Northern Emisphere, i = ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"pandas.read_hdf",
"matplotlib.pyplot.close",
"matplotlib.pyplot.plot"
]
] |
AxelAllen/Multimodal-BERT-in-Medical-Image-and-Text-Classification | [
"b60bb7bd4fe07773ee3bf8edfc5011a337ac6037"
] | [
"MMBT/image.py"
] | [
"\"\"\"\nThis code is adapted from the image.py by Kiela et al. (2020) in https://github.com/facebookresearch/mmbt/blob/master/mmbt/models/image.py\nand the equivalent Huggingface implementation: utils_mmimdb.py, which can be\nfound here: https://github.com/huggingface/transformers/blob/8ea412a86faa8e9edeeb6b5c46b0... | [
[
"torch.load",
"torch.nn.AdaptiveAvgPool2d",
"torch.flatten",
"torch.nn.functional.relu",
"torch.nn.Sequential"
]
] |
WONDER-project/GSAS-II-WONDER-OSX | [
"f90ab85f89f282d1b9686a1cbbf5adc5c48ceac9"
] | [
"GSAS-II-WONDER/SUBGROUPS.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n*SUBGROUPS: Interface to special GSAS Bilbao SUBGROUPS & k-SUBGROUPSMAG web pages*\n-------------------------------\n\nExtraction of space subgroups for a given space group and a propagation vector\nfrom the GSAS version of SUBGROUPS & k-SUBGROUPSMAG web page on the Bilbao Crystal... | [
[
"numpy.linalg.inv"
]
] |
ajeytiwary/sunpy | [
"6ba94b471f2a2e716f91ef8b8014adbef358aa6f"
] | [
"sunpy/cm/cm.py"
] | [
"\"\"\"\nThis module provides a set of colormaps specific for solar data.\n\"\"\"\nfrom __future__ import absolute_import\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\n\nfrom sunpy.cm import color_tables as ct\n\n__all__ = ['get_cmap', 'show_colormaps']\n\nsdoaia94 = ct.aia_col... | [
[
"numpy.vstack",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
csprock/bmdcluster | [
"0caf02bb8a93846aa679518ee6a839f843819eac"
] | [
"bmdcluster/optimizers/blockdiagonalBMD.py"
] | [
"import numpy as np\r\n\r\n\"\"\"\r\nThis module contains a variant of the Binary Matrix Decomposition (BMD) algorithm for clustering binary data\r\nas presented in \"A General Model for Clustering Binary Data\" (Tao Li, 2005) and \"On Clustering Binary Data\"\r\n(Tao Li & Shenghuo Zhu, 2005). This varient of the B... | [
[
"numpy.sum",
"numpy.dot",
"numpy.zeros",
"numpy.greater_equal",
"numpy.where"
]
] |
Zelenyy/phd-code | [
"d5b8bfefd2418a915dde89f7da2cb6683f438556"
] | [
"python/simulation_scripts/grep_log.py"
] | [
"from phd.utils.path_tools import LogTime\nimport numpy as np\n\nlog = LogTime(\".\")\npaths = np.array(log.paths)\nindx = paths.argsort()\ncount = 1\nfor t, p in zip(log.time[indx], paths[indx]):\n if (count % 3 == 0):\n print(p,t)\n count+=1"
] | [
[
"numpy.array"
]
] |
binfnstats/eli5 | [
"017c738f8dcf3e31346de49a390835ffafad3f1b"
] | [
"eli5/formatters/image.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom typing import Union, Optional, Callable\n\nimport numpy as np\nfrom PIL import Image\nimport matplotlib.cm\n\nfrom eli5.base import Explanation\n\n\ndef format_as_image(expl, # type: Explanation\n resampling_filter=Image.LANCZOS, # type: int\... | [
[
"numpy.max",
"numpy.min",
"numpy.minimum"
]
] |
jason-neal/companion_simulations | [
"b5773e5539011d492b7128d0dd2778041ce50d52"
] | [
"bin/coadd_chi2_db.py"
] | [
"#!/usr/bin/env python\n\"\"\"Co-add_chi2_values.py.\n\nCreate Table of minimum Chi_2 values and save to a table.\n\"\"\"\nimport argparse\nimport warnings\nimport glob\nimport os\nimport sys\n\nimport numpy as np\nimport pandas as pd\nimport sqlalchemy as sa\n\nimport simulators\n\n\ndef parse_args(args):\n \"\... | [
[
"pandas.read_csv",
"pandas.merge"
]
] |
baronrustamov/pytext | [
"9790943736e7c0ac53095be2e20177be6fc529a9"
] | [
"pytext/data/masked_util.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nfrom typing import Dict, List, Optional, Set\n\nimport numpy as np\nfrom pytext.common.constants import SpecialTokens, Token\nfrom pytext.config.component import Component, ComponentType\nfrom pytext.config.pytext_confi... | [
[
"numpy.random.RandomState",
"numpy.random.random"
]
] |
XavierValParejo/SeedBot | [
"7b338184ac9137027c726c43b481c2f79ad12b51"
] | [
"Code/Mapping/ultrasound_mapping.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport math\nimport lidar_to_grid_map as lg\nfrom grid_mapping_for_a_star import OccupancyGridMap\nfrom a_star_for_ogm_testing import a_star\n\nf = \"mesures.txt\"\n\ndef read_measures(file):\n measures = [line.split(\",\") for line in open(file)]\n angles... | [
[
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
vivid-k/code | [
"c39d5a0ba219b499e595812a31362a8f2535859e"
] | [
"AREL-data-process/Data_process.py"
] | [
"import json\nimport os.path as osp\nimport matplotlib.pyplot as plt\nfrom collections import OrderedDict\nfrom collections import Counter\nimport numpy\nimport h5py\nimport os\n\n\n\"\"\"\n处理文本数据,提取出story,并构建词表\n\"\"\"\nbase_path = \"AREL-data-process/\"\ntrain_data = json.load(open(osp.join(base_path, \"test.stor... | [
[
"numpy.asarray"
]
] |
neuralmagic/yolact | [
"68ea8f6edcc0d61047a95071fa22d8d271164605"
] | [
"layers/box_utils.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nfrom utils import timer\n\nfrom data import cfg\n\n@torch.jit.script\ndef point_form(boxes):\n \"\"\" Convert prior_boxes to (xmin, ymin, xmax, ymax)\n representation for comparison to point form ground truth data.\n Args:\n boxes: (tensor) center-size default... | [
[
"torch.min",
"torch.exp",
"torch.log",
"torch.arange",
"torch.max",
"torch.cat",
"torch.clamp"
]
] |
dimitrymindlin/DenseNetMuraPytorch | [
"ef3a872d739b015e3618c00265acb481dc251342"
] | [
"pipeline.py"
] | [
"import os\nimport pandas as pd\nfrom tqdm import tqdm\nimport torch\nfrom torchvision import transforms\nfrom torch.utils.data import DataLoader, Dataset\nfrom torchvision.datasets.folder import pil_loader\n\nfrom configs.mura_config import mura_config\n\ndata_cat = ['train', 'valid'] # data categories\n\ndef get_... | [
[
"torch.utils.data.DataLoader",
"torch.stack",
"pandas.DataFrame"
]
] |
ruidongjr/Aldi | [
"0d2dad1ab180abb59bee15d9e5e851e4de4e8cd5"
] | [
"libraries/deep_sort/deep_sort/deep/feature_extractor.py"
] | [
"import torch\nimport torchvision.transforms as transforms\nimport numpy as np\nimport cv2\nimport logging\n\nfrom .model import Net\n\nclass Extractor(object):\n def __init__(self, model_path, use_cuda=True):\n self.net = Net(reid=True)\n self.device = \"cuda\" if torch.cuda.is_available() and use... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.load"
]
] |
aalbersk/DeepRec | [
"f673a950780959b44dcda99398880a1d883ab338"
] | [
"sparse_operation_kit/unit_test/test_scripts/tf1/test_sparse_emb_demo.py"
] | [
"\"\"\"\n Copyright (c) 2021, NVIDIA CORPORATION.\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable l... | [
[
"numpy.allclose",
"tensorflow.global_variables_initializer",
"tensorflow.Graph",
"tensorflow.nn.compute_average_loss",
"tensorflow.constant",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.gradients",
"tensorflow.Session",
"tensorflow.concat",
"tensorflow.identit... |
richardrl/graphics | [
"c05ee5b947bc462881968b4a109a9ba59ff8c6a8"
] | [
"tensorflow_graphics/rendering/opengl/math.py"
] | [
"# Copyright 2020 The TensorFlow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"tensorflow.shape",
"tensorflow.expand_dims",
"tensorflow.matmul",
"tensorflow.squeeze",
"tensorflow.linalg.matmul",
"tensorflow.name_scope",
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.linalg.normalize"
]
] |
Anthuang/bdd100k | [
"b7e1781317784317e4e715ab325515ade73978a9"
] | [
"bdd100k/vis/viewer.py"
] | [
"\"\"\"An offline label visualizer for BDD100K file.\n\nWorks for 2D / 3D bounding box, segmentation masks, etc.\n\"\"\"\n\nimport argparse\nimport concurrent.futures\nfrom typing import Dict\n\nimport numpy as np\nfrom scalabel.common.parallel import NPROC\nfrom scalabel.common.typing import NDArrayF64\nfrom scala... | [
[
"numpy.array"
]
] |
PedroRisquez/c19norge-data | [
"ac38460800d5d311877b949c74444b44a0916575"
] | [
"src/utils/graphs.py"
] | [
"import os\nfrom datetime import date\nimport altair as alt\nimport pandas as pd\n\n\ndef tested_lab():\n data = \"data/tested_lab.csv\"\n filename = \"graphs/tested_lab.png\"\n if os.path.exists(filename):\n os.remove(filename)\n\n df = pd.read_csv(data)\n\n mapping = {\n \"new_neg\": ... | [
[
"pandas.DatetimeIndex",
"pandas.date_range",
"pandas.read_csv",
"pandas.to_datetime",
"pandas.melt"
]
] |
jnsrch/disentangling-vae-cwt | [
"0e927bdcd3d149cadb30aa107331f0c071138c41"
] | [
"disvae/training.py"
] | [
"import imageio\nimport logging\nimport os\nfrom timeit import default_timer\nfrom collections import defaultdict\nfrom utils.datasets import DATASETS_DICT\n\nfrom tqdm import trange\nimport torch\nfrom torch.nn import functional as F\n\nfrom disvae.utils.modelIO import save_model\n\n\nTRAIN_LOSSES_LOGFILE = \"trai... | [
[
"torch.device"
]
] |
alaaib/NetworkAnalysis | [
"bf45d616b3a2f40cec3879515fe8ecdbe19b0537"
] | [
"ClusterGivenGraph/main.py"
] | [
"import datetime\nimport sys\nimport time\nimport os\n\nfrom ClusterGivenGraph.Graph import Graph\nfrom ClusterGivenGraph.GraphHelper import get_graph_based_degree_sequence, create_motifs, export_to_pajek, \\\n motifs_main_calculation, calc_z_score, export_to_pajek_by_z_score\nimport networkx as nx\nfrom matplot... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.bar"
]
] |
lidq92/MDTVSFA | [
"22f49a9c1b2faec4a643c92b0f6b69297f4e4121"
] | [
"VQAloss.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass VQALoss(nn.Module):\n def __init__(self, scale, loss_type='mixed', m=None):\n super(VQALoss, self).__init__()\n self.loss_type = loss_type\n self.scale = scale\n self.m = m #\n\n def forward(self, y_pr... | [
[
"torch.mean",
"torch.nn.functional.l1_loss",
"torch.exp"
]
] |
7FM/OpenRadar | [
"d90eea23feb062830dd71b00064f06f70ba6783c"
] | [
"mmwave/dsp/doppler_processing.py"
] | [
"# Copyright 2019 The OpenRadar Authors. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by ap... | [
[
"numpy.sum",
"numpy.fft.fft",
"numpy.transpose",
"numpy.abs",
"numpy.argmax",
"numpy.einsum",
"numpy.concatenate"
]
] |
amckenna41/CDBLSTM_PSP | [
"d4e5d874af65c1264c3a459ecad19e71610d1f82"
] | [
"psp/main_gcp.py"
] | [
"################################################################################\n##### Entry script for psp_gcp dir for training on Google Cloud Platform #####\n################################################################################\n\n#import required modules and dependancies\nimport tensorflow as tf\... | [
[
"tensorflow.compat.v1.reset_default_graph",
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.GPUOptions",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.device",
"tensorflow.keras.backend.clear_session",
"tensorflow.compat.v... |
htcr/deeplab-pytorch | [
"8cea35415112fefb6a886d0d98ab64350ed09601"
] | [
"api.py"
] | [
"import numpy as np\nimport cv2\n\nimport os\nimport os.path as osp\n\nimport torch\nimport yaml\nfrom addict import Dict\nimport matplotlib.pyplot as plt\n\nfrom .libs.models import *\nfrom .libs.utils import DenseCRF\n\nfrom demo import preprocessing, inference\n\nclass DeepLabV2Masker(object):\n def __init__(... | [
[
"torch.load",
"torch.set_grad_enabled",
"numpy.max",
"numpy.min",
"numpy.maximum",
"numpy.where",
"torch.device",
"numpy.minimum"
]
] |
alicechi2/LargeScaleCoverSongId | [
"d33a8425ce8761f09537d657d29c0e4b87e05249"
] | [
"binary_task.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nBinary task of cover song identification using the Millions Song Dataset \nand the Second Hand Song dataset.\n\nIt takes the Million Song Dataset path as an argument. \n\nThe list of queries to test must be located in:\n./SHS/list_500queries.txt\n\nThe training set of the Second Hand... | [
[
"numpy.sum",
"numpy.random.randint",
"numpy.median",
"numpy.mean"
]
] |
bmorris3/mosfire_wasp6 | [
"df802640eeb717a649c18caa1e940b684eeb99dc"
] | [
"analysis/moar/samples.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Mar 24 09:33:04 2015\n\n@author: bmmorris\n\"\"\"\n\nimport numpy as np\nimport triangle\nfrom matplotlib import pyplot as plt\n\ndef splitchain(infile, outfile, tossfraction=0.9):\n '''\n Take the last `savefraction` of file `infile`, save it as the\n small... | [
[
"numpy.vstack",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.loadtxt"
]
] |
JasonQSY/Associative3D | [
"c50818b593ec48c38ed7ee3e109c23531089da32",
"c50818b593ec48c38ed7ee3e109c23531089da32"
] | [
"object_branch/benchmark/suncg/evaluate_detection.py",
"object_branch/benchmark/nyu/box3d.py"
] | [
"# ---------------------------------------------------------\n# Copyright (c) 2015, Saurabh Gupta\n#\n# Licensed under The MIT License [see LICENSE for details]\n# ---------------------------------------------------------\nfrom ...utils import bbox_utils\nimport numpy as np\n\ndef inst_bench_image(dt, gt, bOpts, ov... | [
[
"numpy.vstack",
"numpy.sum",
"numpy.ones",
"numpy.cumsum",
"numpy.divide",
"numpy.zeros",
"numpy.argsort",
"numpy.hstack",
"numpy.where"
],
[
"numpy.ones",
"numpy.sum",
"numpy.diag",
"numpy.random.seed",
"numpy.random.RandomState",
"numpy.log",
"... |
storopoli/Machine-Learning-Probalistic | [
"fb939b92a61f7d3a7e6c28d0b14f58d99a0b07f1"
] | [
"pyprobml-master/examples/betaCredibleInt.py"
] | [
"from scipy.stats import beta\nimport numpy as np\n\nS = 47\nN = 100 \na = S+1\nb = (N-S)+1 \nalpha = 0.05;\n\nCI1 = beta.interval(1-alpha, a, b)\n\nl = beta.ppf(alpha/2, a, b)\nu = beta.ppf(1-alpha/2, a, b)\nCI2 = (l,u)\n\nsamples = beta.rvs(a, b, size=1000)\nsamples = np.sort(samples)\nCI3 = np.percentile(sampl... | [
[
"scipy.stats.beta.interval",
"scipy.stats.beta.rvs",
"scipy.stats.beta.ppf",
"numpy.sort",
"numpy.array"
]
] |
YasuShimizu/1D-Free-Water-Surface | [
"38a86e167b43ebe46187aa6e781a93414136235f"
] | [
"initial.py"
] | [
"import numpy as np\r\n\r\ndef eta_init(eta,eta0,eta_up,eta_up0,nx,dx, \\\r\n slope,xl,xb1,xb2,xb3,dbed):\r\n zb0=xl*slope\r\n for i in np.arange(0,nx+2):\r\n xx=dx*float(i)\r\n eta_up[i]=zb0-xx*slope\r\n eta_up0[i]=eta_up[i]\r\n# print(i,nx,eta_up[i])\r\n if xx>xb1 and x... | [
[
"numpy.arange",
"numpy.sqrt"
]
] |
dennis-l/tolteca | [
"1dffaffb585eb7027e26b34ae01e8632bef134cb"
] | [
"tolteca/simu/toltec/models.py"
] | [
"#!/usr/bin/env python\n\n\nfrom gwcs import coordinate_frames as cf\nimport astropy.units as u\nfrom astropy.time import Time\nfrom astropy.modeling import models, Parameter, Model\nfrom astropy.coordinates import SkyCoord, Angle\nfrom astropy.table import Table\nfrom astropy.cosmology import default_cosmology\nfr... | [
[
"numpy.ones",
"numpy.sum",
"numpy.diff",
"numpy.nansum",
"numpy.isscalar",
"numpy.meshgrid",
"numpy.vstack",
"numpy.cos",
"numpy.expm1",
"numpy.mean",
"numpy.zeros",
"numpy.random.normal",
"numpy.median",
"numpy.tan",
"numpy.std",
"numpy.array",
... |
kagemusha/streamingbandit | [
"f5228611a0ac9432e958761dd6d68d972d7d163b"
] | [
"app/libs/thompson_bayesian_linear.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nfrom libs.base import *\nimport ast\n\nglobal numpy\n\nclass ThompsonBayesianLinear():\n \"\"\" Class for Thompson sampling for Bayesian Linear Regression\n \n :var dict default: The value of the model, consisting of a 1*p \\\n list of J, p*p list of P and a... | [
[
"numpy.linalg.inv",
"numpy.matrix",
"numpy.random.multivariate_normal",
"numpy.asarray"
]
] |
sdss/chernosim | [
"734f349c82d85dd6a1fe00013d21025ef0e9b845"
] | [
"chernosim/acquisition/acquisition.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# @Author: José Sánchez-Gallego (gallegoj@uw.edu)\n# @Date: 2020-09-13\n# @Filename: acquisition.py\n# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)\n\nimport collections\nimport functools\nimport multiprocessing\nimport pathlib\nimport ... | [
[
"numpy.random.uniform",
"numpy.sum",
"numpy.arcsin",
"pandas.DataFrame",
"numpy.random.seed",
"numpy.cos",
"pandas.read_hdf",
"numpy.log10",
"numpy.log",
"numpy.random.normal",
"numpy.sin",
"numpy.radians"
]
] |
anjlip/pymatgen | [
"5cc42912a12a265a603df7e34c856561f76edc1f"
] | [
"pymatgen/analysis/graphs.py"
] | [
"# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\nimport warnings\nimport subprocess\nimport numpy as np\nimport os.path\nimport copy\nfrom itertools import combinations\n\nfrom pymatgen.core import Structure, Lattice, PeriodicSite, Molecule\nfrom p... | [
[
"numpy.eye",
"numpy.multiply",
"scipy.spatial.KDTree",
"numpy.subtract",
"scipy.stats.describe",
"numpy.add",
"numpy.array_equal",
"numpy.array",
"numpy.around",
"numpy.dot"
]
] |
mpopescu/compas | [
"55f259607deea501f862cbaea79bd97d7e56ead6"
] | [
"src/compas/numerical/pca/pca_numpy.py"
] | [
"from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import division\n\nfrom numpy import asarray\nfrom scipy.linalg import svd\n\n\n__all__ = ['pca_numpy']\n\n\ndef pca_numpy(data):\n \"\"\"Compute the principle components of a set of data points.\n\n Parameters\n ... | [
[
"numpy.asarray",
"scipy.linalg.svd"
]
] |
dasolhwang/tf-mobilenet-v2 | [
"e0e8f936e63e14561d9d25b77256d1cadb85172a"
] | [
"mobilenet_v2.py"
] | [
"\"\"\"\nMobileNet v2.\n\nAs described in https://arxiv.org/abs/1801.04381\n\n Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation\n\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfro... | [
[
"tensorflow.truncated_normal_initializer",
"tensorflow.reduce_mean",
"tensorflow.add",
"tensorflow.variable_scope",
"tensorflow.contrib.layers.l2_regularizer"
]
] |
JuliaSprenger/spikeinterface | [
"d5d3d3992a6d430d7008e16db4ee030734e685e5"
] | [
"spikeinterface/widgets/unitlocalization.py"
] | [
"import numpy as np\nimport matplotlib.pylab as plt\nfrom .basewidget import BaseWidget\n\nfrom probeinterface.plotting import plot_probe\n\nfrom spikeinterface.toolkit import compute_unit_centers_of_mass\n\nfrom .utils import get_unit_colors\n\n\nclass UnitLocalizationWidget(BaseWidget):\n \"\"\"\n Plot unit... | [
[
"numpy.array"
]
] |
MRD-Git/Huggingface-course | [
"7c0440584e630cb8885c2a237bc6e8213cfd5572"
] | [
"drop/multilabel_classification/loss.py"
] | [
"# https://pytorch.org/docs/stable/_modules/torch/nn/modules/loss.ht\nfrom torch.nn.modules.loss import _Loss\nfrom typing import Optional\nfrom torch import Tensor\nimport torch.nn.functional as F\n\nclass BCEWithLogitsLoss(_Loss):\n r\"\"\"This loss combines a `Sigmoid` layer and the `BCELoss` in one single\n ... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits"
]
] |
egbQuantum/strawberryfields | [
"674e4fe2de5e5dd791a77f1cd219009120dcbbbf"
] | [
"strawberryfields/backends/states.py"
] | [
"# Copyright 2019 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applica... | [
[
"numpy.sum",
"scipy.special.factorial",
"numpy.trace",
"numpy.meshgrid",
"numpy.allclose",
"numpy.transpose",
"numpy.arccosh",
"numpy.reshape",
"numpy.abs",
"numpy.cos",
"numpy.tensordot",
"numpy.identity",
"numpy.eye",
"numpy.zeros",
"numpy.linalg.det",... |
KyleKing/dash_charts | [
"8e3644505047fa85f3175f5bc55a2421cb0a19ea"
] | [
"tests/examples/ex_rolling_chart.py"
] | [
"\"\"\"Example Rolling Mean and Filled Standard Deviation Chart.\"\"\"\n\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport numpy as np\nimport pandas as pd\nimport plotly.graph_objects as go\nfrom implements import implements\n\nfrom dash_charts.scatter_line_charts import RollingChart... | [
[
"numpy.random.normal",
"numpy.amin",
"numpy.mean"
]
] |
hluedemann/inplace_abn | [
"5210ec0b38ba7c6c9deb08927aa18806ac3380f3"
] | [
"scripts/models/densenet.py"
] | [
"import sys\nfrom collections import OrderedDict\nfrom functools import partial\n\nimport torch.nn as nn\n\nfrom inplace_abn import ABN\nfrom modules import GlobalAvgPool2d, DenseModule\nfrom .util import try_index\n\n\nclass DenseNet(nn.Module):\n def __init__(self,\n structure,\n ... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Conv2d",
"torch.nn.AvgPool2d"
]
] |
lipinoelbreve/topicos-streamlit | [
"849d34ee4c8f1dbd700c50a2069e87dbb6c93663"
] | [
"data-collection/main.py"
] | [
"# %%\n# Recorre las 1000 paginas de articulos que podemos ver\n# De cada artículo guarda:\n# Url\n# Id de Pubmed\n# Título\n# Keywords\n# Lista de autores con nombres y afiliaciones y país\n\n# El código no para hasta que lo frenes o que llegue a la página 1.000, pero cada vez que carga un artículo lo gu... | [
[
"numpy.arange"
]
] |
VisCog/ArgusShapes | [
"ba361e28b8d30097c41314bbfe68341cc8ac0c01"
] | [
"argus_shapes/tests/test_argus_shapes.py"
] | [
"from __future__ import absolute_import, division, print_function\nimport os\nimport numpy as np\nimport pandas as pd\nimport shutil\nimport requests\n\nimport numpy.testing as npt\nimport pytest\n\nimport skimage.io as skio\n\nfrom .. import argus_shapes as shapes\nimport pulse2percept.implants as p2pi\n\ntry:\n ... | [
[
"pandas.Series",
"numpy.testing.assert_equal",
"pandas.DataFrame",
"numpy.isclose",
"numpy.random.rand",
"numpy.random.randint"
]
] |
klimpie94/Python-training | [
"7af210126cfe2e9386a8f22075ea0d7eff80daac"
] | [
"Day2/pandas-exercises-python/python-exercises-02-questions/utils/transformation_functions.py"
] | [
"\nimport pandas as pd\n\n\ndef read_csv_files(file_path):\n return pd.read_csv(file_path)\n\n\ndef filter_films(dataframe):\n pass\n\n\ndef join_categories_with_metadata(facts_df, categories_df):\n # Hint: You can use lambda functions to change the id column in order to\n # use join method in pandas.\n... | [
[
"pandas.read_csv"
]
] |
vanderschaarlab/MIRACLE | [
"ec28f5051d604a3134f9379b9a63a6cc379f2bc5"
] | [
"miracle/third_party/imputation_gain.py"
] | [
"# stdlib\nfrom typing import Tuple, Union\n\n# third party\nimport numpy as np\nfrom sklearn.base import TransformerMixin\n\n# Necessary packages\nimport torch\nfrom torch import nn\n\nEPS = 1e-8\n\nDEVICE = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n\ndef sample_Z(m: int, n: int) -> np.nd... | [
[
"numpy.random.uniform",
"torch.nn.Linear",
"numpy.nanmax",
"numpy.zeros",
"numpy.random.permutation",
"numpy.asarray",
"numpy.nanmin",
"torch.nn.ReLU",
"torch.cuda.is_available",
"torch.from_numpy",
"torch.log",
"numpy.isnan",
"torch.nn.Sigmoid",
"torch.cat"... |
zpreisler/tensorflow | [
"f2b17b22e12bd743b66945070f338f70b5fa3332"
] | [
"tensorflow/contrib/distribute/python/metrics_v1_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.metrics.mean_squared_error",
"tensorflow.python.ops.metrics.false_positives",
"tensorflow.python.data.ops.dataset_ops.Dataset.range",
"tensorflow.python.ops.metrics.precision_at_thresholds",
"tensorflow.python.ops.metrics.false_negatives_at_thresholds",
"tensorflow.p... |
keflavich/sedfitter | [
"ec8722ec423ac684e4930fe23a98cd7b2d5b9f50"
] | [
"sedfitter/models.py"
] | [
"from __future__ import print_function, division\n\nimport os\n\nimport numpy as np\nfrom astropy.table import Table\nfrom astropy import units as u\n\nfrom .convolved_fluxes import ConvolvedFluxes, MonochromaticFluxes\nfrom . import fitting_routines as f\nfrom .utils import parfile\nfrom .utils.validator import va... | [
[
"numpy.zeros",
"numpy.argmin",
"numpy.any",
"numpy.abs",
"numpy.char.strip",
"numpy.arange",
"numpy.log10",
"numpy.array"
]
] |
Next-Trends/rasa | [
"c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7"
] | [
"rasa/nlu/featurizers/sparse_featurizer/regex_featurizer.py"
] | [
"from __future__ import annotations\nimport logging\nimport re\nfrom typing import Any, Dict, List, Optional, Text, Tuple, Type\nimport numpy as np\nimport scipy.sparse\nfrom rasa.nlu.tokenizers.tokenizer import Tokenizer\n\nimport rasa.shared.utils.io\nimport rasa.utils.io\nimport rasa.nlu.utils.pattern_utils as p... | [
[
"numpy.zeros"
]
] |
arnaudgelas/pytorch-lightning | [
"cc624358c8e396e966f9c51b3010f6a986047fc6"
] | [
"tests/models/test_restore.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.eq",
"torch.nn.Linear",
"torch.load",
"torch.cuda.device_count"
]
] |
fanzhiyan/magenta | [
"622c47c19bb84c6f57b286ed03b738516b2f27d6"
] | [
"magenta/common/nade_test.py"
] | [
"# Copyright 2019 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o... | [
[
"tensorflow.random_normal",
"tensorflow.test.main",
"tensorflow.global_variables_initializer"
]
] |
paxtonedgar/MisInfo | [
"81b32fa3e7d0d204feb83e10169093f45727a2ea"
] | [
"src/trainers/lstm_attn_trainer.py"
] | [
"\nimport torch\n\nimport numpy as np\n\nfrom src.trainers.base_trainer import BaseTrainer\nfrom src.evaluation.metrics import Metrics\n\n\nclass LSTMAttnTrainer(BaseTrainer):\n \"\"\"\n Trainer class. Optimizer is by default handled by BaseTrainer.\n \"\"\"\n def __init__(self, model, config):\n ... | [
[
"numpy.arange",
"torch.no_grad",
"torch.max"
]
] |
RubenImhoff/Large_Sample_Nowcasting_Evaluation | [
"b2d8500261881a749a8f20815b7e2b0b9b69c4f7",
"b2d8500261881a749a8f20815b7e2b0b9b69c4f7"
] | [
"HPCrunScripts/PS_DeterministicNowcast_parallel_advection_24h.py",
"pysteps/pysteps/extrapolation/semilagrangian.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jan 17 07:41:32 2019\n\nDeterministic nowcast with pySTEPS, with extraction of results per catchment. \nBased on the input data for the Ensemble nowcast, but without any ensembles. \n\nMake sure to change the initial part to your case.\n\nNote that this script assume... | [
[
"numpy.array",
"numpy.isfinite"
],
[
"numpy.zeros",
"numpy.reshape",
"numpy.nanmin",
"numpy.arange",
"numpy.stack",
"scipy.ndimage.interpolation.map_coordinates",
"numpy.isfinite"
]
] |
xiaohanhuang/pytorch | [
"a31aea8eaa99a5ff72b5d002c206cd68d5467a5e",
"a31aea8eaa99a5ff72b5d002c206cd68d5467a5e"
] | [
"test/ao/sparsity/test_pruner.py",
"test/fx2trt/converters/acc_op/test_getitem.py"
] | [
"# -*- coding: utf-8 -*-\n# Owner(s): [\"module: unknown\"]\n\n\nimport copy\nimport logging\n\nimport torch\nfrom torch import nn\nfrom torch.ao.sparsity import BasePruner, PruningParametrization, ZeroesParametrization\nfrom torch.nn.utils import parametrize\n\nfrom torch.testing._internal.common_utils import Test... | [
[
"torch.nn.BatchNorm2d",
"torch.ones",
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.cuda.is_available",
"torch.nn.Conv2d",
"torch.nn.utils.parametrize.is_parametrized",
"torch.device"
],
[
"torch.randn"
]
] |
RobinRojowiec/intent-recognition-in-doctor-patient-interviews | [
"b91c7a9f3ad70edd0f39b56e3219f48d1fcf2078"
] | [
"models/siamese_neural_network.py"
] | [
"import random\n\nimport torch\nimport torch.nn as nn\n\nfrom models.cnn_layer import CNNLayer\nfrom utility.model_parameter import ModelParameter, Configuration\n\n\nclass SiameseNeuralNetwork(nn.Module):\n def __init__(self, config: Configuration, label_count=64, device=torch.device('cpu'), *args, **kwargs):\n... | [
[
"torch.device",
"torch.nn.CosineSimilarity"
]
] |
ujjaldas132/models | [
"e13441ed200ce1bb204977e731508748bd0e0d14"
] | [
"official/recommendation/ncf_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.zeros",
"tensorflow.test.main",
"tensorflow.compat.v1.local_variables_initializer",
"tensorflow.Graph",
"numpy.arange",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.convert_to_tensor",
"numpy.array",
"tensorflow.python.eager.context.num_gpus"
]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.