repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
zhiqiangdon/autogluon | [
"71ee7ef0f05d8f0aad112d8c1719174aa33194d9"
] | [
"tabular/tests/unittests/data/test_label_cleaner.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\n\nfrom autogluon.core.constants import BINARY, MULTICLASS, REGRESSION, SOFTCLASS\nfrom autogluon.core.data.label_cleaner import LabelCleaner, LabelCleanerBinary, LabelCleanerMulticlass, LabelCleanerMulticlassToBinary, LabelCleanerDummy\n\n\ndef test_label_cle... | [
[
"numpy.array",
"pandas.Series",
"pandas.DataFrame",
"pandas.testing.assert_frame_equal"
]
] |
koushalkh/ML-LAB | [
"597389b7c93f964361baad8c8e27b2cf196e967c"
] | [
"10-regression.py"
] | [
"import numpy as np\r\nfrom bokeh.plotting import figure, show, output_notebook\r\nfrom bokeh.layouts import gridplot\r\nfrom bokeh.io import push_notebook\r\n\r\n#output_notebook()\r\nimport numpy as np\r\n\r\ndef local_regression(x0, X, Y, tau):\r\n # add bias term\r\n x0 = np.r_[1, x0] # Add one to avoid t... | [
[
"numpy.sum",
"numpy.abs",
"numpy.random.normal",
"numpy.linalg.pinv",
"numpy.linspace"
]
] |
miyamotost/ITDD-with-DialogueAct | [
"827b8b27bacb8a48fea479e709c39eaee3610552"
] | [
"onmt/model_builder.py"
] | [
"\"\"\"\nThis file is for models creation, which consults options\nand creates each encoder and decoder accordingly.\n\"\"\"\nimport re\nimport torch\nimport torch.nn as nn\nfrom torch.nn.init import xavier_uniform_\n\nimport onmt.inputters as inputters\nimport onmt.modules\nfrom onmt.encoders.rnn_encoder import RN... | [
[
"torch.nn.LogSoftmax",
"torch.nn.init.xavier_uniform_",
"torch.device",
"torch.load"
]
] |
gwallison/openFF-build | [
"3526dd5fdb78576186399f84c0bcb95b7edfd991"
] | [
"builder_tasks/CAS_2_incorporate_reference.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 31 07:32:13 2021\n\n@author: Gary\n\nIn this script, the cas master list is merged with the CAS reference list\ncreated from the SciFinder searches. \n\nThe steps in this process:\n- fetch the reference dataframes for authoritative CAS numbers and deprecated one... | [
[
"pandas.read_csv",
"numpy.where",
"pandas.merge",
"pandas.concat"
]
] |
PKSingh0017/MSCG-Net | [
"b7e79d68f14984fe460eff72bcbb8049e4d2bc9f"
] | [
"lib/utils/funtions.py"
] | [
"import numpy as np\n\nimport torch\nfrom torch import Tensor\n\nfrom PIL import Image, ImageEnhance\n\ndef torch_none(x: Tensor):\n return x\n\n\ndef torch_rot90_(x: Tensor):\n return x.transpose_(2, 3).flip(2)\n\n\ndef torch_rot90(x: Tensor):\n return x.transpose(2, 3).flip(2)\n\n\ndef torch_rot180(x: Te... | [
[
"torch.nn.functional.pad",
"numpy.asarray"
]
] |
2channelkrt/VLAE | [
"5fd34127a0805c14b967cc1742c4ac69bf52bb51"
] | [
"utils.py"
] | [
"import torch\n\n\ndef clip_grad(gradient, clip_value):\n \"\"\" clip between clip_min and clip_max\n \"\"\"\n return torch.clamp(gradient, min=-clip_value, max=clip_value)\n\ndef clip_grad_norm(gradient, clip_value):\n norm = (gradient**2).sum(-1)\n divisor = torch.max(torch.ones_like(norm).cuda(), ... | [
[
"torch.ones_like",
"torch.clamp"
]
] |
hsyis/object-detection-yolo2-tiny | [
"507ac8aa2fc1cd9d2e12db9a720a68dceb3a85f0"
] | [
"proj4/src/__init__.py"
] | [
"import sys\nimport numpy as np\nimport cv2\nimport time\nimport argparse\n\nimport yolov2tiny\n\n\ndef resize_input(im):\n imsz = cv2.resize(im, (416, 416))\n imsz = imsz / 255.0\n imsz = imsz[:, :, ::-1]\n return np.asarray(imsz, dtype=np.float32)\n\n\ndef image_object_detection(in_image, out_image, d... | [
[
"numpy.expand_dims",
"numpy.asarray",
"numpy.squeeze"
]
] |
adelevie/cudf | [
"fe5e07ddba42eeb6e1dc7cf94cdeebf52970b187"
] | [
"python/cudf/cudf/core/column/numerical.py"
] | [
"# Copyright (c) 2018-2021, NVIDIA CORPORATION.\nfrom __future__ import annotations\n\nfrom numbers import Number\nfrom typing import Any, Callable, Sequence, Union, cast\n\nimport numpy as np\nimport pandas as pd\nfrom nvtx import annotate\nfrom pandas.api.types import is_integer_dtype\n\nimport cudf\nfrom cudf im... | [
[
"numpy.min_scalar_type",
"numpy.promote_types",
"numpy.logical_or",
"numpy.dtype",
"pandas.api.types.is_number",
"pandas.api.types.is_integer_dtype",
"numpy.asarray",
"numpy.can_cast",
"numpy.iinfo",
"numpy.isnan",
"numpy.result_type",
"numpy.finfo",
"numpy.issc... |
huangshunliang/keras_h | [
"87ec630a76e2badf6ddd48f889c80e5e2f571117"
] | [
"tests/test_model_saving.py"
] | [
"import pytest\nimport os\nimport tempfile\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nfrom keras.models import Model, Sequential\nfrom keras.layers import Dense, Dropout, Lambda, RepeatVector, TimeDistributed\nfrom keras.layers import Input\nfrom keras import optimizers\nfrom keras import obj... | [
[
"numpy.random.random",
"numpy.zeros_like",
"numpy.abs",
"numpy.testing.assert_allclose"
]
] |
argallab/model_based_shared_control | [
"ff42226b6345266f35a32021c7d0b44cc5948ec1"
] | [
"src/model_based_shared_control/scripts/collect_data_script.py"
] | [
"#!/usr/bin/env python\n\nimport gym\nimport rospy\nfrom sensor_msgs.msg import Joy\nfrom std_msgs.msg import String\nfrom model_based_shared_control.msg import State\nfrom pyglet.window import key\nimport numpy as np\n\nclass LunarLander():\n\n def __init__(self):\n # initalize node\n rospy.init_node('lunar... | [
[
"numpy.array",
"numpy.power"
]
] |
mikoar/DAV_project | [
"8346e2c0b3171b7ddcf576eda0261533dbc6c826"
] | [
"scripts/germany_mobility.py"
] | [
"import plotly\nimport plotly.graph_objs as go\nimport pandas as pd\nimport sys\n\nmobility_germany = pd.read_csv(\"../data/mobility_germany.csv\")\n\nmobility_germany = mobility_germany.loc[mobility_germany.sub_region_1.isnull(), :]\n\ncolors = (['indianred']*2+['lightsalmon']*5)*12 + ['indianred']\n\nfig = go.Fig... | [
[
"pandas.read_csv"
]
] |
thomaskeefe/py_jive | [
"81f741afe2ef5f3d3dd006b7619690d6cb5ae09c"
] | [
"jive/utils.py"
] | [
"import numpy as np\nfrom scipy.sparse import issparse\nfrom scipy.sparse.linalg import svds\nfrom scipy.linalg import svd as full_svd\n\nfrom jive.lazymatpy.interface import LinearOperator\nfrom jive.lazymatpy.convert2scipy import convert2scipy\n\n\ndef svd_wrapper(X, rank=None):\n \"\"\"\n Computes the (pos... | [
[
"scipy.sparse.issparse",
"scipy.sparse.linalg.svds",
"numpy.argsort",
"scipy.linalg.svd"
]
] |
birkealine/konstanz-open-data-api | [
"5e7267020dd7db7592e1738d23f83990f9a92424"
] | [
"opencity/fetcher/xls_fetcher.py"
] | [
"import pandas as pd\nimport xlrd\n\nclass xlsFetcher(object):\n \"\"\"\n xlsFetcher: fetches xls files\n \"\"\"\n\n def __init__(self):\n self.flag_final = True\n\n def parse_xls(self, url):\n \"\"\"\n parses data from url to dataframe\n\n PARAMETERS:\n -----------... | [
[
"pandas.read_excel",
"pandas.DataFrame"
]
] |
jeanveau/rasa_core | [
"953d54f057c19ef10b9c71cb8fcfc2d13dbefc65"
] | [
"rasa/core/test.py"
] | [
"import argparse\nimport asyncio\nimport json\nimport logging\nimport os\nimport typing\nimport warnings\nfrom collections import defaultdict, namedtuple\nfrom typing import Any, Dict, List, Optional, Text, Tuple\n\nfrom rasa.core.events import (\n ActionExecuted, UserUttered,\n ActionExecutionRejected)\n\nif... | [
[
"sklearn.utils.multiclass.unique_labels",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.gca",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.show",
"numpy.std",
"numpy.mean"
]
] |
wolfenfeld/Palantiri | [
"719d78b891bf8ac8e90f8eab1d55c57b3b7bbb70"
] | [
"palantiri/ClassificationPlotHandlers.py"
] | [
"\nimport numpy as np\nfrom sklearn.metrics import confusion_matrix, roc_curve, auc\n\n\nimport plotly.graph_objs as go\nimport plotly.figure_factory as ff\nfrom plotly.offline import iplot\n\nfrom palantiri.BasePlotHandlers import PlotHandler\n\n\nclass ClassifierPlotHandler(PlotHandler):\n \"\"\" Handles all t... | [
[
"numpy.flipud",
"sklearn.metrics.roc_curve",
"sklearn.metrics.auc",
"numpy.asarray",
"sklearn.metrics.confusion_matrix",
"numpy.arange",
"numpy.meshgrid"
]
] |
SBCV/Open3D | [
"d335451e2b56897c3c8e37f68e1d41eee9faf5e9"
] | [
"python/test/test_color_map.py"
] | [
"import open3d as o3d\nimport numpy as np\nimport re\nimport os\nimport sys\nfrom open3d_test import download_fountain_dataset\n\n\ndef get_file_list(path, extension=None):\n\n def sorted_alphanum(file_list_ordered):\n convert = lambda text: int(text) if text.isdigit() else text\n alphanum_key = la... | [
[
"numpy.asarray",
"numpy.mean"
]
] |
mvoicer/cbic-2021-learning-preferences | [
"9ddd5449d5cae5a8f1cdafc6fa34b13ee83076b2"
] | [
"data_preparation.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\n\r\n\r\ndef create_subsample(df_var, df_pref, nobj, index):\r\n \"\"\"\r\n Create sub-dataframes with the features (alternatives) and target (value in the objective space).\r\n :param df_var:\r\n :param df_pref:\r\n :param nobj:\r\n :param index:\r\n ... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
HarshTrivedi/optuna | [
"9ea2ebd690127ca7af6f3df7b53807c648733a95"
] | [
"tests/integration_tests/lightgbm_tuner_tests/test_optimize.py"
] | [
"import contextlib\nfrom tempfile import TemporaryDirectory\nfrom typing import Any\nfrom typing import Dict\nfrom typing import Generator\nfrom typing import List\nfrom typing import Optional\nfrom unittest import mock\n\nimport numpy as np\nimport pytest\n\nimport optuna\nfrom optuna.integration._lightgbm_tuner.o... | [
[
"numpy.random.uniform",
"numpy.random.randint",
"numpy.zeros"
]
] |
CAVED123/mol-cycle-gan | [
"feb8d7504d0078798ee70d6d5cda3f37b4f7a903"
] | [
"decode.py"
] | [
"import argparse\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport torch\nimport tqdm\n\nfrom jtvae import (Vocab,\n JTNNVAE)\n\n\nclass Options:\n def __init__(self,\n jtvae_path=\"./jtvae/\",\n hidden_size=450,\n latent_size=56,\n ... | [
[
"torch.load",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.expand_dims",
"torch.from_numpy"
]
] |
CoastalHydrodynamicsLab/python-ctd | [
"af67120346eb0d0d506628a6584601cf3daf7f6a"
] | [
"tests/test_plotting.py"
] | [
"from pathlib import Path\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pytest\n\nimport ctd\n\n\nmatplotlib.use(\"Agg\")\n\ndata_path = Path(__file__).parent.joinpath(\"data\")\n\n\ndef _assert_is_valid_plot_return_object(objs):\n if isinstance(objs, np.ndarray):\n for... | [
[
"matplotlib.use",
"matplotlib.pyplot.close"
]
] |
Gavin666Github/chineseocr | [
"0cfd0ff28984c01b192646acfc63f8ec26d0752b"
] | [
"detector/detectors.py"
] | [
"#coding:utf-8\nfrom detector.other import normalize\nimport numpy as np\nimport numpy as np\nfrom detector.utils.cython_nms import nms as cython_nms\ntry:\n from detector.utils.gpu_nms import gpu_nms\nexcept:\n gpu_nms =cython_nms\n\ndef nms(dets, thresh):\n if dets.shape[0] == 0:\n return []\n ... | [
[
"numpy.hstack",
"numpy.where"
]
] |
Chris19920210/Swin-Transformer-TF | [
"ad9a35fd8c6303fbfa988c7a96845f96560c1184"
] | [
"swintransformer/data_processing/train_validation_split.py"
] | [
"import tensorflow as tf\nimport pathlib\nimport os\nimport numpy as np\nimport shutil\n\nflags = tf.compat.v1.flags\nflags.DEFINE_string('input', './input', 'Directory to input.')\nflags.DEFINE_string('output', './output', 'Directory to output. ')\nflags.DEFINE_float('ratio', 0.2, 'ratio')\nFLAGS = flags.FLAGS\n\n... | [
[
"numpy.random.uniform"
]
] |
CianciarusoCataldo/nn-object-detector | [
"a1a51f3e8ff295851759664c9155f8ceecb33256"
] | [
"detector/object_detection/keras_retinanet/initializers.py"
] | [
"\nimport keras\n\nimport numpy as np\nimport math\n\n\nclass PriorProbability(keras.initializers.Initializer):\n \"\"\"\n Initializer applies a prior probability.\n \"\"\"\n\n def __init__(self, probability=0.01):\n self.probability = probability\n\n def get_config(self):\n return {\n ... | [
[
"numpy.ones"
]
] |
MaxU11/playground | [
"240182f88836e860fc144a82e98c0f4028294334"
] | [
"pommerman/cli/Tournament.py"
] | [
"import csv\nimport os\nimport random\nimport time\nimport atexit\nimport numpy as np\nfrom datetime import datetime\n\nfrom pommerman.agents.abstract_mcts_skeleton import AbstractMCTSSkeleton\nfrom pommerman import utility\nfrom pommerman import constants\nfrom pommerman import make\n\n\ndef run(env, agent_names, ... | [
[
"numpy.iinfo",
"numpy.random.seed"
]
] |
JiwonCocoder/da-faster-rcnn-PyTorch-master | [
"9ba9ffac51f1926bec4950b5f8cf3556250ddb59"
] | [
"batch_demo.py"
] | [
"# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick\n# --------------------------------------------------------\nfrom __future__ import absolute_impo... | [
[
"numpy.tile",
"torch.FloatTensor",
"torch.nonzero",
"torch.load",
"torch.autograd.Variable",
"numpy.random.seed",
"numpy.asarray",
"numpy.copy",
"numpy.max",
"torch.from_numpy",
"numpy.min",
"numpy.array",
"numpy.concatenate",
"torch.LongTensor",
"numpy.... |
stupiding/insightface | [
"85a3b65c07b39e7ad02aabddd6cb6529baf4e605"
] | [
"recognition/eval/verification.py"
] | [
"\"\"\"Helper for evaluation on the Labeled Faces in the Wild dataset \n\"\"\"\n\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the So... | [
[
"numpy.sum",
"scipy.interpolate.interp1d",
"numpy.subtract",
"numpy.less",
"numpy.asarray",
"numpy.logical_and",
"numpy.logical_not",
"sklearn.model_selection.KFold",
"sklearn.preprocessing.normalize",
"numpy.mean",
"numpy.zeros",
"numpy.argmax",
"numpy.arange",... |
Brlaney/python-matrix-fem | [
"4dd0e1ee4db994cef896c57a0522fc48529a2d01"
] | [
"beam11.py"
] | [
"# beam11.py\n# UNITS: METRIC (meters & kN)\nfrom lib.beams import *\nimport numpy as np\n\n# Node coordinates (modeled with 4 nodes)\nnodes = np.array([[0], [4], [6], [11]])\n\n# Member/element connection matrix\nmembers = np.array([[1, 2], [2, 3], [3, 4]])\n\n# Pre-define arrays to contain each members\nn = len(n... | [
[
"numpy.array",
"numpy.repeat",
"numpy.zeros"
]
] |
phww/Andrew.Ng-ML-Study | [
"f0a84814bd538b0e0ec0d2a64d89338b730d1632"
] | [
"code-homework/ML/ex1_Linear Regression/ex1_batch.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\ndata = pd.read_csv(\"ex1data1.txt\",names = ['population','profit'])\nx = data.population\ny = data.profit\n\"初始化,所有变量都是matrix\"\ndf = data.copy()#因为insert会改变原数组,所以先复制一份,坑1.\ndf.insert(0,\"one\",1)\nX = df.iloc[:,0:df.shape[1]-1]\ny = df.ilo... | [
[
"numpy.sum",
"numpy.zeros",
"pandas.read_csv",
"numpy.matrix",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.power"
]
] |
hydrocode-de/RUINSapp | [
"2dd0f8b0b0ed04e95ef2ace9154414b1f83a89dc"
] | [
"ruins/processing/sdm.py"
] | [
"# BIAS CORRECTION\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import gamma\nfrom scipy.stats import norm\nfrom scipy.signal import detrend\n\n'''\nScaled distribution mapping for climate data\n\nThis is a excerpt from pyCAT and the method after Switanek et al. (2017) containing the functions to perf... | [
[
"scipy.signal.detrend",
"scipy.stats.norm.fit",
"pandas.Series",
"numpy.sign",
"numpy.zeros",
"scipy.stats.norm.ppf",
"numpy.argsort",
"numpy.abs",
"scipy.stats.gamma.ppf",
"scipy.stats.gamma.fit",
"numpy.sort",
"numpy.linspace",
"numpy.mean",
"numpy.minimum... |
IBM/oct-glaucoma-vf-estimate | [
"ea79352547f33fe05ee532ab9faad6a5e4811a76"
] | [
"python_code/train_tp_si.py"
] | [
"#!/usr/bin/struture_function1 python\n# File: train_tp.py\n# Author: Yasmeen George\n\nimport tensorflow as tf\n#from tensorflow import keras\nimport argparse\nfrom tensorpack.tfutils.summary import *\nfrom oct_dataflow_tp import *\nimport tensorflow.contrib.slim as slim\nfrom keras import backend as K\nfrom conte... | [
[
"tensorflow.summary.scalar",
"tensorflow.reduce_max",
"tensorflow.math.sigmoid",
"tensorflow.python.ops.gen_nn_ops.relu_grad",
"tensorflow.identity",
"tensorflow.compat.v1.get_variable",
"tensorflow.keras.losses.mean_squared_error",
"tensorflow.layers.conv3d",
"tensorflow.nn.si... |
ocefpaf/cf-xarray | [
"7bdb033395c8959a5d8147fe148ec987c1122387"
] | [
"cf_xarray/datasets.py"
] | [
"import numpy as np\nimport xarray as xr\n\nairds = xr.tutorial.open_dataset(\"air_temperature\").isel(time=slice(4), lon=slice(50))\nairds.air.attrs[\"cell_measures\"] = \"area: cell_area\"\nairds.air.attrs[\"standard_name\"] = \"air_temperature\"\nairds.coords[\"cell_area\"] = (\n xr.DataArray(np.cos(airds.lat... | [
[
"numpy.sqrt",
"numpy.ones",
"numpy.zeros",
"numpy.random.randn",
"numpy.cos",
"numpy.arange",
"numpy.prod",
"numpy.stack",
"numpy.sin",
"numpy.linspace"
]
] |
m1258218761/p-score | [
"6031d0352561ba3b5baa352645c6cfdf560224f2"
] | [
"Model/data_util.py"
] | [
"# coding=utf-8\nimport os\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import MaxAbsScaler\n\n\nclass data(object):\n def __init__(self, workpath, label_number, features_norm=False, Standardization=False, discretization=0,\n run_model='Train', train_file='', validation_fi... | [
[
"numpy.random.permutation",
"sklearn.preprocessing.MaxAbsScaler",
"pandas.cut",
"numpy.array",
"numpy.linspace"
]
] |
maroomir/deep-rl-stock-simple | [
"45101312056c7c7d222c391a875c024b97022809"
] | [
"train.py"
] | [
"import gym\nimport numpy as np\n\nfrom stable_baselines3.ddpg.policies import MlpPolicy\nfrom stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise\nfrom stable_baselines3 import DDPG\nfrom stable_baselines3.common.monitor import Monitor\n\nfrom env import Stock\n\nfrom utils.callba... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
labs15-baseball-pitch-predictor/flask_app | [
"86e63b94d12d309e5080926b5e75333cc09cb2f1"
] | [
"Utilities/pickles_to_csvs.py"
] | [
"## Takes Pickle Files and Exports Them to CSVs\nimport pandas as pd\nsource_path = \"Season_pickles/\"\ndestination_path = \"\"\n\nfilenames = [str(i) + '.pkl' for i in range(2010,2020)]\n\nseasons = ['df_' + str(i) for i in range(10,20)]\n\nseason_dataframes = {}\n\nfor i in list(zip(filenames, seasons)):\n ... | [
[
"pandas.read_pickle"
]
] |
vuiseng9/CalibTIP | [
"69077c92611b079234706784c344e8c9156f3283"
] | [
"models/modules/batch_norm.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nfrom torch.nn import BatchNorm1d as _BatchNorm1d\r\nfrom torch.nn import BatchNorm2d as _BatchNorm2d\r\nfrom torch.nn import BatchNorm3d as _BatchNorm3d\r\n\r\n\"\"\"\r\nBatchNorm variants that can be disabled by removing all parameters and running stats\r\n\"\"\"\r\n\r\n\r... | [
[
"torch.zeros",
"torch.no_grad",
"torch.nn.Module.__init__"
]
] |
aivclab/vision | [
"6c644dd72f68bca608a2900e5d9461e90fe841eb"
] | [
"neodroidvision/classification/procedures/classification_procedures.py"
] | [
"import copy\nimport numpy\nimport string\nimport time\nimport torch\nimport tqdm\nfrom draugr.numpy_utilities import Split\nfrom draugr.python_utilities import (\n rgb_drop_alpha_batch_nhwc,\n torch_vision_normalize_batch_nchw,\n)\nfrom draugr.torch_utilities import (\n TorchEvalSession,\n TorchTrainSe... | [
[
"torch.sum",
"sklearn.metrics.precision_recall_fscore_support",
"torch.autograd.detect_anomaly",
"torch.no_grad",
"numpy.argmax",
"numpy.random.random",
"sklearn.metrics.accuracy_score",
"matplotlib.pyplot.imshow",
"torch.dist",
"torch.max",
"numpy.array"
]
] |
MolecularAI/reinvent-scoring | [
"f7e052ceeffd29e17e1672c33607189873c82a45"
] | [
"reinvent_scoring/scoring/score_components/synthetic_accessibility/sas_component.py"
] | [
"import pickle\nfrom typing import List\n\nimport numpy as np\nfrom rdkit.Chem import Mol\nfrom rdkit.Chem.Descriptors import ExactMolWt\n\nfrom reinvent_chemistry import Descriptors\n\nfrom reinvent_scoring.scoring.component_parameters import ComponentParameters\nfrom reinvent_scoring.scoring.score_components impo... | [
[
"numpy.array",
"numpy.concatenate"
]
] |
cta-observatory/cta-lstchain | [
"d2d22567a6d0028737dd3b663f45c6206e43c437"
] | [
"lstchain/visualization/plot_calib.py"
] | [
"from matplotlib import pyplot as plt\nfrom ctapipe.visualization import CameraDisplay\nimport numpy as np\nfrom matplotlib.backends.backend_pdf import PdfPages\nfrom ctapipe_io_lst import load_camera_geometry\nfrom ctapipe.coordinates import EngineeringCameraFrame\n\n# read back the monitoring containers written w... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gcf",
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.title",
... |
AndyLiu11037/card-detector | [
"c4917f0235b623cb439e91a5e74d4acd08d03887"
] | [
"object_webcam.py"
] | [
"import os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging (1)\nimport pathlib\nimport tensorflow as tf\nimport sys\ntf.get_logger().setLevel('ERROR') # Suppress TensorFlow logging (2)\n\nimport time\nfrom object_detection.utils import label_map_util\nfrom object_detection.utils... | [
[
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.get_logger",
"tensorflow.reshape",
"numpy.expand_dims",
"matplotlib.use",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.compat.v2.train.Checkpoint"
]
] |
gpftc/qfunction | [
"5c3ceed0e270d343d51ee0b69d98d4fffad47b24"
] | [
".history/qfunction/quantum/quantum_circuit_20210710225508.py"
] | [
"########################\n## Author: Reinan Br. ##\n## Date_init:01/07/21 ##\n########################\nfrom qfunction import q_sin,q_exp,q_cos,radian,limit\nimport numpy as np\nfrom numpy import sqrt,array\nfrom math import atan\n############ quantum equations #############\ndef q_rho(u,q=1,cpx=False,israd=True):... | [
[
"numpy.array",
"numpy.dot",
"numpy.sqrt"
]
] |
davidbrochart/rioxarray | [
"6587726a019f46ec68ca94d6cea866abea956a2a"
] | [
"test/integration/test_integration__io.py"
] | [
"import contextlib\nimport itertools\nimport os\nimport pickle\nimport shutil\nimport sys\nimport tempfile\nimport warnings\n\nimport dask.array as da\nimport mock\nimport numpy as np\nimport pytest\nimport rasterio\nimport xarray as xr\nfrom affine import Affine\nfrom numpy.testing import assert_almost_equal\nfrom... | [
[
"numpy.nanmax",
"numpy.testing.assert_array_equal",
"numpy.nanmin",
"numpy.arange",
"numpy.isnan",
"numpy.array"
]
] |
jackd/graph-tfds | [
"c843e485b931cc25370a151ae2326e1eec009792"
] | [
"graph_tfds/graphs/graph_saint/graph_saint.py"
] | [
"\"\"\"graph_saint dataset.\"\"\"\n\nimport json\nimport os\nfrom typing import Dict\n\nimport numpy as np\nimport scipy.sparse as sp\nimport tensorflow as tf\nimport tensorflow_datasets as tfds\n\nimport gdown\n\n_DESCRIPTION = \"\"\"\\\nDatasets used in/provided by [GraphSAINT](https://github.com/GraphSAINT/Graph... | [
[
"tensorflow.io.gfile.exists",
"numpy.load",
"tensorflow.io.gfile.GFile",
"numpy.stack",
"scipy.sparse.load_npz",
"numpy.array"
]
] |
micimize/deepchem | [
"510b9bf1805bc5a472c1a519700e6b128e06c651"
] | [
"deepchem/trans/tests/test_normalization.py"
] | [
"import os\nimport deepchem as dc\nimport numpy as np\nimport pytest\n\n\ndef load_unlabelled_data():\n current_dir = os.path.dirname(os.path.abspath(__file__))\n featurizer = dc.feat.CircularFingerprint(size=1024)\n tasks = []\n input_file = os.path.join(current_dir, \"../../data/tests/no_labels.csv\")\n load... | [
[
"numpy.zeros_like",
"numpy.isclose",
"numpy.testing.assert_allclose"
]
] |
NightmareNyx/semi-supervised-pytorch | [
"43bb86bc6757345bd7a4eb37d6948ee62a268f7e"
] | [
"semi-supervised/read_functions.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec 6 15:40:14 2017\n\nFunctions needed to read the data from different databases\n\n@author: anazabal, olmosUC3M, ivaleraM\n\"\"\"\n\nimport csv\nimport os\nimport torch\nimport numpy as np\nfrom sklearn.metrics import mean_squared_error\n\n... | [
[
"numpy.sum",
"numpy.cumsum",
"numpy.transpose",
"numpy.squeeze",
"sklearn.metrics.mean_squared_error",
"numpy.floor",
"numpy.abs",
"numpy.argmax",
"numpy.exp",
"numpy.max",
"numpy.shape",
"numpy.min",
"numpy.isnan",
"numpy.array",
"numpy.concatenate",
... |
IAmSuyogJadhav/tensorlayer | [
"b9115e027f8a47f5b8c3c92ade30603560c5e987"
] | [
"example/tutorial_tfrecord.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"You will learn.\n\n1. How to save data into TFRecord format file.\n2. How to read data from TFRecord format file by using Queue and Thread.\n\nReference:\n-----------\nEnglish : https://indico.io/blog/tensorflow-data-inputs-part1-placeholders-protobufs-queues/\n ... | [
[
"tensorflow.TFRecordReader",
"tensorflow.reshape",
"tensorflow.decode_raw",
"tensorflow.python_io.tf_record_iterator",
"tensorflow.train.string_input_producer",
"numpy.asarray",
"tensorflow.train.Int64List",
"tensorflow.cast",
"tensorflow.train.start_queue_runners",
"tensor... |
sadielbartholomew/astropy | [
"ec864232350c5282a56af52a35945e9e43861556"
] | [
"astropy/io/votable/tree.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n# TODO: Test FITS parsing\n\n# STDLIB\nimport io\nimport re\nimport gzip\nimport base64\nimport codecs\nimport urllib.request\n\n# THIRD-PARTY\nimport numpy as np\nfrom numpy import ma\n\n# LOCAL\nfrom astropy.io import fits\nfrom astropy import __ve... | [
[
"numpy.ceil",
"numpy.zeros",
"numpy.dtype",
"numpy.any",
"numpy.asarray",
"numpy.ma.array",
"numpy.recarray",
"numpy.all",
"numpy.ma.zeros"
]
] |
hfyer/NAIC2020_ReID_R1 | [
"240f0c9f65e482e6b0090f01d9f9e3373a337033"
] | [
"fast-reid-master/fastreid/data/samplers/triplet_sampler.py"
] | [
"# encoding: utf-8\n\"\"\"\n@author: liaoxingyu\n@contact: liaoxingyu2@jd.com\n\"\"\"\n\nimport copy\nimport itertools\nfrom collections import defaultdict\nfrom typing import Optional\n\nimport numpy as np\nfrom torch.utils.data.sampler import Sampler\n\nfrom fastreid.utils import comm\n\n\ndef no_index(a, b):\n ... | [
[
"numpy.random.permutation",
"numpy.random.shuffle",
"numpy.random.seed",
"numpy.random.choice"
]
] |
Abdumajidhu/Image-Enhancement-therough-Image-Processing-Techniques | [
"126690319297a5ed7df99ff47797980cc525ecf3"
] | [
"lion.py"
] | [
"import numpy as np\r\nimport cv2\r\n\r\nimg = cv2.imread('exercise_images/lion.jpg')\r\n\r\nimg_yuv = cv2.cvtColor(img, cv2.COLOR_BGR2YUV)\r\n\r\n# equalize the histogram of the Y channel\r\nimg_yuv[:,:,1] = cv2.equalizeHist(img_yuv[:,:,0])\r\n\r\n# convert the YUV image back to RGB format\r\nimg_output = cv2.cvtC... | [
[
"numpy.hstack"
]
] |
Hydroxy-OH/pytorch-yolo2 | [
"3d38ae9a762ba22c95856584dc3914cb8ff176df"
] | [
"debug.py"
] | [
"from __future__ import print_function\n\nimport os\n\nimport numpy as np\nfrom PIL import Image\n\nimport torch\nimport torch.optim as optim\nfrom darknet import Darknet\nfrom torch.autograd import Variable\nfrom utils import convert2cpu, image2torch\n\ncfgfile = \"face4.1re_95.91.cfg\"\nweightfile = \"face4.1re_9... | [
[
"torch.zeros",
"torch.autograd.Variable",
"torch.abs",
"numpy.loadtxt"
]
] |
lhwzds/CS303-project | [
"e1a4e7965b759c2c9583df3b731b19a0b2a198d6"
] | [
"project1/demo4.py"
] | [
"import numpy as np\nimport random\nimport time\nCOLOR_BLACK=-1\nCOLOR_WHITE=1\nCOLOR_NONE=0\nrandom.seed(0)\n\nclass AI(object):\n\n def __init__(self, chessboard_size, color, time_out):\n self.chessboard_size = chessboard_size\n self.color = color\n self.time_out = time_out\n self.c... | [
[
"numpy.array",
"numpy.where"
]
] |
jpambrun/pynndescent | [
"0e31328e3f509fad4d7d06df9830a932a65c3436"
] | [
"pynndescent/tests/test_pynndescent_.py"
] | [
"import os\nimport io\nimport re\nfrom contextlib import redirect_stdout\n\nfrom nose.tools import assert_greater_equal, assert_true, assert_equal\nfrom nose import SkipTest\n\nimport numpy as np\nfrom scipy import sparse\nfrom sklearn.neighbors import KDTree\nfrom sklearn.preprocessing import normalize\n\nfrom pyn... | [
[
"numpy.random.uniform",
"numpy.allclose",
"numpy.load",
"scipy.sparse.random",
"numpy.ones",
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.random.randn",
"numpy.random.seed",
"numpy.argsort",
"sklearn.neighbors.KDTree",
"numpy.random.RandomState",
"numpy.i... |
Sujit-O/gemben | [
"4577914dbe4b39559093a6e9517c666b8e69c052"
] | [
"gemben/utils/graph_util.py"
] | [
"try: import cPickle as pickle\r\nexcept: import pickle\r\nimport numpy as np\r\nimport networkx as nx\r\nimport random\r\nimport itertools\r\nfrom time import time\r\nimport pdb\r\n\r\n\r\n\r\ndef transform_DiGraph_to_adj(di_graph):\r\n \"\"\"Function to convert the directed graph to adjacency matrix.\"\"\"\r\n... | [
[
"numpy.multiply",
"numpy.zeros",
"numpy.random.choice",
"numpy.random.rand",
"numpy.random.random_integers"
]
] |
daniella-brovkina-isw/panda_robot | [
"a89243af46cbcc47485f1d035af29695c9c89a9e"
] | [
"demos/demo_endeffector_keyboard.py"
] | [
"#!/usr/bin/env python\n\n# /***************************************************************************\n\n# \n# @package: panda_robot\n# @author: Saif Sidhik <sxs1412@bham.ac.uk>\n# \n\n# **************************************************************************/\n\n# /********************************************... | [
[
"numpy.asarray"
]
] |
susucy/CeleScope | [
"a5d9501ff8bd9dc067b9718070876acb0767a6cf"
] | [
"celescope/tag/Analysis_tag.py"
] | [
"import os\nimport sys\nimport json\nimport numpy as np\nimport pandas as pd\nimport glob\nfrom celescope.tools.report import reporter\nfrom celescope.tools.utils import log\nfrom celescope.tools.Analysis import Analysis\n\nclass Analysis_tag(Analysis):\n\n def run(self, tsne_tag_file):\n cluster_tsne = s... | [
[
"pandas.read_csv"
]
] |
goromal/flightmare | [
"b9b60a5bad4d167e3beb8401977802d6a926828f"
] | [
"flightrl/examples/view_reward.py"
] | [
"import seaborn as sns\nimport pandas as pd\nimport matplotlib.animation as animation\nimport matplotlib.pyplot as plt\n#\nsns.set_style(\"whitegrid\")\n#\n\n\ndef plot_reward(save_dir, varname, ylabel, save_fig=False):\n fig, ax = plt.subplots(1, 1, figsize=(7, 4))\n #\n sns.lineplot(data=data[varname].dr... | [
[
"pandas.read_csv",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xlabel"
]
] |
Asad-Ismail/SMN | [
"8d019d1751207ea535868d8473b39e77a22533f7"
] | [
"utils/util.py"
] | [
"import numpy as np\nimport cv2\nimport random\nimport warnings\nimport scipy\nfrom scipy.linalg.basic import solve_circulant\nimport skimage\nimport skimage.transform\nfrom distutils.version import LooseVersion\nimport torch\nimport math\nimport json\n\nfrom torch.functional import Tensor\n\nnp.random.seed(42)\n\n... | [
[
"torch.stack",
"scipy.ndimage.zoom",
"numpy.any",
"numpy.random.seed",
"numpy.moveaxis",
"torch.log",
"torch.maximum",
"torch.max",
"numpy.stack",
"numpy.meshgrid",
"torch.cat",
"torch.arange",
"numpy.where",
"numpy.unique",
"numpy.int0",
"torch.ones... |
zhouwubai/kaggle | [
"45fbce8834a5c7ce9c925af691f5761d9d88c8d3"
] | [
"src/DoorDash/src/process.py"
] | [
"import numpy as np\nimport pandas as pd\nimport copy\nimport re\n\n\nclass PreProcess(object):\n\n def __init__(self):\n self.df = None\n\n def _standardize_string(self, a_str):\n \"\"\"Replace whitespace with underscore\n remove non-alphanumeric characters\n \"\"\"\n if... | [
[
"pandas.get_dummies"
]
] |
LucasFranciscoCorreia/ontask_b | [
"5473e9faa24c71a2a1102d47ebc2cbf27608e42a"
] | [
"ontask/dataops/pandas/merge.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Functions to do data frame merging.\"\"\"\n\nfrom typing import Dict\n\nimport pandas as pd\nfrom django.utils.translation import gettext\n\nfrom ontask.dataops.pandas.columns import has_unique_column, is_unique_column\nfrom ontask.dataops.pandas.dataframe import store_dataframe\n\... | [
[
"pandas.merge"
]
] |
Justice-Eternal/mmrotate | [
"6519a3654e17b707c15d4aa2c5db1257587ea4c0"
] | [
"mmrotate/core/bbox/assigners/atss_kld_assigner.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nfrom mmcv.ops import points_in_polygons\nfrom mmdet.core.bbox.assigners.assign_result import AssignResult\nfrom mmdet.core.bbox.assigners.base_assigner import BaseAssigner\n\nfrom mmrotate.core.bbox.utils import GaussianMixture\nfrom ..builder import R... | [
[
"torch.min",
"torch.inverse",
"torch.stack",
"torch.nonzero",
"torch.det",
"torch.exp",
"torch.arange",
"torch.full_like",
"torch.max",
"torch.cat",
"torch.pow"
]
] |
sephiron99/polars | [
"7617eca9a85548c2978771f3a72c5937616c8f25"
] | [
"py-polars/polars/internals/expr.py"
] | [
"import copy\nfrom datetime import date, datetime, timedelta\nfrom typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union\n\nimport numpy as np\n\nfrom polars.utils import _timedelta_to_pl_duration\n\ntry:\n from polars.polars import PyExpr\n\n _DOCUMENTING = False\nexcept ImportError: # p... | [
[
"numpy.arcsin",
"numpy.arctan",
"numpy.arccos",
"numpy.cos",
"numpy.exp",
"numpy.log",
"numpy.log10",
"numpy.tan",
"numpy.array",
"numpy.sin",
"numpy.random.randint"
]
] |
lunarnautics/Stocksera | [
"09c114f588e95be28068af88c525565fdb98f92b"
] | [
"scheduled_tasks/government/get_retail_sales.py"
] | [
"import sqlite3\nimport pandas as pd\n\nconn = sqlite3.connect(r\"database/database.db\", check_same_thread=False)\ndb = conn.cursor()\n\n\ndef retail_sales():\n \"\"\"\n Get retail sales and compare it with avg monthly covid cases\n \"\"\"\n df = pd.read_html(\"https://ycharts.com/indicators/us_retail_... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"pandas.read_html",
"pandas.to_datetime",
"pandas.merge",
"pandas.Grouper"
]
] |
PyEst/PyEst | [
"4b7be6e29396605eb11fdfec7b409898ac49b9b9"
] | [
"source/PyEst.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\nfrom tkinter import *\nimport tkinter\nimport tkinter.scrolledtext as tkst\nfrom tkinter.ttk import *\nfrom tkinter import ttk\nfrom tkinter.constants import END,HORIZONTAL, VERTICAL, NW, N, E, W, S, SUNKEN, LEFT, RIGHT, TOP, BOTH, YES, NE, X, RAISED, SUNKEN, DI... | [
[
"pandas.read_csv",
"matplotlib.pyplot.show",
"pandas.DataFrame",
"pandas.tools.plotting.scatter_matrix"
]
] |
microsoft/ai-edu | [
"2f59fa4d3cf19f14e0b291e907d89664bcdc8df3"
] | [
"实践案例/B15-基于深度学习的代码搜索案例/src/3Model/codenn.py"
] | [
"# Copyright (c) Microsoft. All rights reserved.\n# Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport os\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nimport torch\nfrom torch.utils.data ... | [
[
"numpy.concatenate",
"numpy.linalg.norm",
"torch.device",
"numpy.mean"
]
] |
NancyFulda/towards-neural-programming-interfaces | [
"21b467af56848c4fc8642fb0412f9f8d1b7718a2"
] | [
"src/npi/models/classifiers.py"
] | [
"import torch.nn as nn\n\nclass StyleClassifier(nn.Module): # classifies NPI outputs\n def __init__(self, n=200, m=768, k=1):\n \"\"\"\n input_activs_shape: tuple of (b, n, m, 1)\n b is the number of batches\n n x m x 1 slices contain the elements of the original activations,... | [
[
"torch.nn.ReLU",
"torch.nn.Sigmoid",
"torch.nn.Linear"
]
] |
phamhuyhoang97/spark | [
"6a2452fb5cd776dc1f292704e6b86bbec0ff24e7"
] | [
"python/pyspark/pandas/typedef/typehints.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.Int64Dtype",
"numpy.dtype",
"pandas.Float32Dtype",
"pandas.Float64Dtype",
"pandas.Int32Dtype",
"pandas.StringDtype",
"pandas.BooleanDtype",
"pandas.Int8Dtype",
"pandas.Int16Dtype",
"pandas.api.types.pandas_dtype"
]
] |
nipunagarwala/cs273b_final_project | [
"9d816cb562feb741ebf883bc03d399b42fb2622f"
] | [
"cae_layers.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom cae_input_brain import *\nfrom utils import *\n\n\n# Define custom API for creating and adding layers to NN Model\n# Wrapper around Tensorflow API, for ease of use and readibility\n\nclass Layers(object):\n\n def __init__(self):\n self.stdDev = 0.35\n\n ... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.nn.avg_pool3d",
"tensorflow.sigmoid",
"tensorflow.nn.l2_loss",
"tensorflow.matmul",
"tensorflow.random_normal",
"tensorflow.nn.dropout",
"tensorflow.sub",
"tensorflow.constant",
"tensorflow.nn.sigmoid_cross_entr... |
ahojnnes/numpy | [
"55b766d549dc7a9cd417de001a2f7ba8d445579f"
] | [
"numpy/distutils/system_info.py"
] | [
"#!/bin/env python\n\"\"\"\nThis file defines a set of system_info classes for getting\ninformation about various resources (libraries, library directories,\ninclude directories, etc.) in the system. Currently, the following\nclasses are available:\n\n atlas_info\n atlas_threads_info\n atlas_blas_info\n atlas_b... | [
[
"numpy.distutils.compat.get_exception",
"numpy.distutils.exec_command.exec_command",
"numpy.distutils.misc_util.is_sequence",
"numpy.distutils.misc_util.is_string",
"numpy.distutils.misc_util.get_shared_lib_extension"
]
] |
Obs01ete/pytorch-detection | [
"4af02e232b38fd202bb348e9bbe7373c7eba165b"
] | [
"average_precision.py"
] | [
"import numpy as np\n\n\ndef iou_point_np(box, boxes):\n \"\"\"\n Find intersection over union\n :param box: (tensor) One box [xmin, ymin, xmax, ymax], shape: [4].\n :param boxes: (tensor) Shape:[N, 4].\n :return: intersection over union. Shape: [N]\n \"\"\"\n\n A = np.maximum(box[:2], boxes[:,... | [
[
"numpy.sum",
"numpy.cumsum",
"numpy.zeros",
"numpy.argsort",
"numpy.argmax",
"numpy.max",
"numpy.maximum",
"numpy.concatenate",
"numpy.array",
"numpy.minimum"
]
] |
arpitvaghela/probml-notebooks | [
"32ecb309dd474b989fd1c6ce4ad6dab7a25bbead"
] | [
"notebooks-text-format/ae_mnist_tf.py"
] | [
"# -*- coding: utf-8 -*-\n# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.11.3\n# kernelspec:\n# display_name: Python 3\n# name: python3\n# ---\n\n# + [markdown] id=\"view-in-github... | [
[
"numpy.sum",
"tensorflow.keras.layers.Flatten",
"numpy.histogram",
"matplotlib.pyplot.tight_layout",
"tensorflow.round",
"numpy.random.seed",
"tensorflow.keras.datasets.fashion_mnist.load_data",
"tensorflow.keras.datasets.mnist.load_data",
"matplotlib.pyplot.imshow",
"numpy... |
brkronheim/mcmc_samplers | [
"03d8b2b9b6b6150657eabc7b509875fb16445a0e"
] | [
"Samplers/mirrorSlice.py"
] | [
"import tensorflow as tf\n\nfrom Samplers.sampler import Sampler\n\nclass MirrorSlice(Sampler):\n \"\"\"\n An implementation of the Mirror Slice Sampling MCMC sampler. This sampler\n works by picking a random direction, moving a set distance in that\n direction, then reflecting off the gradient of the d... | [
[
"tensorflow.add",
"tensorflow.while_loop",
"tensorflow.cast",
"tensorflow.less",
"tensorflow.TensorArray",
"tensorflow.where",
"tensorflow.random.normal",
"tensorflow.random.uniform",
"tensorflow.GradientTape",
"tensorflow.exp",
"tensorflow.constant",
"tensorflow.re... |
mamerisawesome/glassmirror | [
"ed6147e73c049931f0118237f2ebb111d471963d"
] | [
"glassmirror/models.py"
] | [
"#!/usr/bin/env python\n# Darwin Bautista\n# HomographyNet, from https://arxiv.org/pdf/1606.03798.pdf\n\nimport os.path\n\nfrom tensorflow.keras.applications import MobileNet\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Conv2D\nfrom tensorf... | [
[
"tensorflow.keras.models.Sequential",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.InputLayer",
"tensorflow.keras.layers.Dense"
]
] |
zhaoguangxiang/pytorch-cifar | [
"509994fd2035009c7f53192a4c497b97f6295e6e"
] | [
"models/resnet_small.py"
] | [
"'''ResNet in PyTorch.\n\nFor Pre-activation ResNet, see 'preact_resnet.py'.\n\nReference:\n[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n Deep Residual Learning for Image Recognition. arXiv:1512.03385\nresnet same as the origin paper\n'''\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional... | [
[
"torch.nn.functional.avg_pool2d",
"numpy.log",
"torch.nn.Conv2d",
"torch.nn.ModuleList",
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d",
"torch.randn",
"torch.nn.init.normal_",
"torch.nn.RNNCell",
"torch.reshape",
"torch.nn.Linear",
"torch.nn.init.constant_",
... |
AIasd/pymoo | [
"08705ca866367d9fab675c30ffe585c837df9654"
] | [
"pymoo/interface.py"
] | [
"\"\"\"\nThis class provide an interface for other libraries to specific modules. For example, the evolutionary operations\ncan be used easily just by calling a function and providing the lower and upper bounds of the problem.\n\n\"\"\"\nimport copy\nimport types\n\nimport numpy as np\n\nfrom pymoo.model.algorithm ... | [
[
"numpy.arange"
]
] |
chengyu0910/DeepFusion_IQA_V1.1 | [
"7c55f7629b24df00a8c37f82e6142c3a636a667b"
] | [
"models/TrancatedIQA.py"
] | [
"\nimport scipy.io as sio\nimport numpy as np\nimport torch.nn as nn\nimport torch\nfrom models.BCNN import BCNN\n#matlab文件名\n\n\nclass IQANet_trancated(nn.Module):\n def __init__(self, matfile):\n super(IQANet_trancated, self).__init__()\n # matfile = r\"C:\\Users\\chengyu\\Desktop\\IQAloss\\Hu\\m... | [
[
"scipy.io.loadmat",
"torch.nn.Linear",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.ReLU"
]
] |
JanSchulz/pandas | [
"6e8ce685eb5a4bd0b39665a3a0d7ddd627ea8ed0"
] | [
"pandas/core/series.py"
] | [
"\"\"\"\nData structure for 1-dimensional cross-sectional and time series data\n\"\"\"\nfrom __future__ import division\n\n# pylint: disable=E1101,E1103\n# pylint: disable=W0703,W0622,W0613,W0201\n\nimport types\nimport warnings\n\nfrom numpy import nan, ndarray\nimport numpy as np\nimport numpy.ma as ma\n\nfrom pa... | [
[
"numpy.asarray",
"pandas.core.nanops.nancorr",
"pandas.core.algorithms.select_n",
"pandas.core.common._coerce_to_dtype",
"pandas.lib.map_infer",
"pandas.core.common.is_float_dtype",
"pandas.core.datetools.to_datetime",
"pandas.tseries.index.DatetimeIndex",
"pandas.tseries.timed... |
ojasjoshi/Selective_Deblur_GANs | [
"17056ca69f097a07884135d9031c53d4ef217a6a"
] | [
"new_yolo2/yolo2-pytorch/darknet_ori.py"
] | [
"import torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport utils.network as net_utils\nimport cfgs.config as cfg\nfrom layers.reorg.reorg_layer import ReorgLayer\nfrom utils.cython_bbox import bbox_ious, anchor_intersections\nfrom utils.cython_yolo import yolo_to_bbox\nfrom ... | [
[
"numpy.asarray",
"numpy.copy",
"numpy.ascontiguousarray",
"torch.cat",
"torch.nn.functional.sigmoid",
"numpy.reshape",
"numpy.expand_dims",
"torch.from_numpy",
"torch.nn.AvgPool2d",
"numpy.load",
"torch.nn.MaxPool2d",
"numpy.zeros",
"numpy.argmax",
"numpy.ma... |
siconos/siconos-tutorials | [
"821365a6ce679fc3d606b272ff069134e3c6aa4b"
] | [
"examples/mechanics/BulletBouncingBox/BulletBouncingBox.py"
] | [
"#!/usr/bin/env python\n\n# Siconos is a program dedicated to modeling, simulation and control\n# of non smooth dynamical systems.\n#\n# Copyright 2021 INRIA.\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... | [
[
"numpy.zeros",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"matplotlib.use",
"matplotlib.pyplot.plot",
"numpy.linalg.norm"
]
] |
zapatacomputing/tutorial-2-hello-ml | [
"e82f73f29cb2bde46cf1a24e9ee8b5e4cde291bc"
] | [
"src/python/lstm/data_manipulator.py"
] | [
"\"\"\"\nCopyright Zapata Computing, Inc. All rights reserved.\n\nThis module manipulates data.\n\"\"\"\n\nimport sys\nimport json\nimport numpy as np\nimport pandas as pd\n\nfrom typing import TextIO\n\n\ndef noisy_sine_generation(time_range:float, time_step:float, noise_std:float) -> dict:\n \"\"\"\n Genera... | [
[
"numpy.transpose",
"numpy.arange",
"numpy.array",
"numpy.sin",
"pandas.DataFrame.from_dict"
]
] |
gyes00205/Open3D | [
"2520323e2e143699dec28d8bd559eba326d4005d"
] | [
"examples/python/geometry/image_processing.py"
] | [
"# ----------------------------------------------------------------------------\n# - Open3D: www.open3d.org -\n# ----------------------------------------------------------------------------\n# The MIT License (MIT)\n#\n# Copyright (c) 2018-2021 www.open3d.org\n#\n# ... | [
[
"numpy.asarray",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.image.imread"
]
] |
bryant1410/arxiv2018-bayesian-ensembles | [
"d97cf64270d34b2301903678e6fbfe170c4c2105"
] | [
"src/run_arg_experiments.py"
] | [
"import os\nimport sys\n\nfrom baselines.ibcc import IBCC\nfrom baselines.majority_voting import MajorityVoting\nfrom bsc.bsc import BSC\nfrom data import data_utils\nfrom evaluation.experiment import Experiment, calculate_scores\nimport data.load_data as load_data\nimport numpy as np\nimport pandas as pd\n\noutput... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.argwhere",
"pandas.read_csv",
"numpy.concatenate",
"numpy.any",
"pandas.DataFrame",
"numpy.copy",
"numpy.arange",
"numpy.all",
"numpy.where"
]
] |
Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | [
"df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d"
] | [
"code/create_reporting_triangle.py"
] | [
"import pandas as pd\nfrom pathlib import Path\nfrom tqdm.auto import tqdm\ntqdm.pandas()\n\npath = Path('../data-truth/COVID-19/deconvoluted/')\nfiles = sorted([f.name for f in path.glob('**/*')])\ndates = [f[:10] for f in files]\n\ndfs = []\nfor f in files:\n date = f[:10]\n df_temp = pd.read_csv(path/f)\n ... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"pandas.concat",
"pandas.Timedelta"
]
] |
zacario-li/Fast-SCNN_pytorch | [
"c7ff081e3ed626fcf7fc752696a38431f9a00942"
] | [
"models/fastscnn.py"
] | [
"'''\nfast scnn\n\nauthor: zacario li\ndate: 2020-03-27\n'''\nimport time\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass FastSCNN(nn.Module):\n def __init__(self, numClasses, aux=False, **kwargs):\n super(FastSCNN, self).__init__()\n # auxiliary, use to ... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.Dropout",
"torch.randn",
"torch.nn.AdaptiveAvgPool2d",
"torch.no_grad",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.cat",
"torch.nn.functional.interpolate"
]
] |
anhdang000/mmsegmentation | [
"3a189329ee919eb68a362361984c6f697aaf0788"
] | [
"tools/custom_test.py"
] | [
"import argparse\nimport os\nfrom os.path import join\n\nimport mmcv\nimport torch\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import (get_dist_info, init_dist, load_checkpoint,\n wrap_fp16_model)\nfrom mmcv.utils import DictAction\n\nfrom mmseg.api... | [
[
"torch.cuda.current_device"
]
] |
mhamiltonj/EstimationPy3 | [
"cdc0de3da05dd7a6b3a4d88ce76b477a1ff078c1"
] | [
"estimationpy/modelica/FmuExamples/Resources/Python-Scripts/addNoiseToData_StuckValve.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport getCSVdata\n\n# LINEAR CHARACTERISTIC - No DYNAMICS\n#inputFileName = '../data/SimulationData_StuckValve_lin_noDyn.csv'\n#outputFileName = '../data/NoisyData_StuckValve_lin_noDyn.csv'\n\n# LINEAR CHARACTERISTIC - DYNAMICS\n#inputFileName = '../data/Simula... | [
[
"numpy.random.random",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.ones"
]
] |
Ilyabasharov/made_mail.ru | [
"a81bfd874ab80eb8c7eaad8a4acf723f327f2f50"
] | [
"2_term/made_2021_ml_adv/homeworks/2/dataset.py"
] | [
"from datetime import (\n datetime,\n)\nfrom zipfile import (\n ZipFile,\n)\n\nimport pandas as pd\nimport pickle as pk\n\n\ndef question_rating_calc(\n tournament_name: dict,\n question_rating: list,\n dataset: dict,\n) -> pd.DataFrame:\n\n tournament_rating = {}\n\n questions_count = 0\n ... | [
[
"pandas.DataFrame"
]
] |
VUB-HYDR/2020_Grant_etal | [
"59df2fe28857ce28a2f0e00b389d485786ab50a4"
] | [
"python/part2/plot/plot_p2.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Mar 10 12:50:59 2020\n\n@author: Luke\n\"\"\"\n\n#==============================================================================\n# SUMMARY\n#==============================================================================\n\n\n# 18 May 2020\n\n... | [
[
"matplotlib.lines.Line2D",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle",
"numpy.stack",
"matplotlib.gridspec.GridSpec"
]
] |
hcc-test/test | [
"1d7aa18b7b19f8373420367c6f76b7db6da43e9c"
] | [
"infer_contrast.py"
] | [
"import argparse\nimport functools\n\nimport numpy as np\nimport torch\n\nfrom utils.reader import load_audio\nfrom utils.utility import add_arguments, print_arguments\n\nparser = argparse.ArgumentParser(description=__doc__)\nadd_arg = functools.partial(add_arguments, argparser=parser)\nadd_arg('audio_path1', ... | [
[
"torch.tensor",
"torch.cuda.is_available",
"torch.jit.load",
"numpy.dot",
"numpy.linalg.norm"
]
] |
wweschen/Capstone | [
"52ed3209bd7da9bf5070ded5ecad32b61bbe84cf"
] | [
"coqa_lib.py"
] | [
"# Copyright 2019 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.compat.v1.python_io.TFRecordWriter",
"tensorflow.train.Features",
"tensorflow.io.gfile.GFile"
]
] |
dxfg/2DVoxelmorph | [
"115f4f0776f9c6f94a7706983ed7f0dc926b80ea"
] | [
"ext/medipy-lib/medipy/metrics.py"
] | [
"'''\nmetrics\n\nContact: adalca@csail.mit.edu\n'''\n\n# imports\nimport numpy as np\n\n\ndef dice(vol1, vol2, labels=None, nargout=1):\n '''\n Dice [1] volume overlap metric\n\n The default is to *not* return a measure for the background layer (label = 0)\n\n [1] Dice, Lee R. \"Measures of the amount ... | [
[
"numpy.sum",
"numpy.finfo",
"numpy.concatenate",
"numpy.logical_and",
"numpy.where"
]
] |
leondgarse/addons | [
"6c512e1ec49ae14ca61f1bbf0fd3403204ba21e2"
] | [
"tensorflow_addons/layers/tests/normalizations_test.py"
] | [
"# Copyright 2019 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... | [
[
"numpy.ones",
"tensorflow.keras.layers.Flatten",
"tensorflow.reshape",
"numpy.random.seed",
"tensorflow.keras.models.Model",
"tensorflow.abs",
"tensorflow.convert_to_tensor",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.initializers.Constant",
"tensorflow.keras.layer... |
asatk/improved_CcGAN | [
"29a58e6e2a03e56c2ad80ae1a2ebbd0710e026f3"
] | [
"UTKFace/UTKFace_64x64/cGAN-concat/models/ResNet_embed.py"
] | [
"'''\nResNet-based model to map an image from pixel space to a features space.\nNeed to be pretrained on the dataset.\n\nif isometric_map = True, there is an extra step (elf.classifier_1 = nn.Linear(512, 32*32*3)) to increase the dimension of the feature map from 512 to 32*32*3. This selection is for desity-ratio e... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.GroupNorm",
"torch.nn.Linear",
"torch.nn.BatchNorm1d",
"torch.randn",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.relu",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.ReLU"
]
] |
ryanbrand/mil | [
"6524047febe35fa59c356794f1649946332c4e7f"
] | [
"tf_utils.py"
] | [
"\"\"\" Utility functions for tensorflow. \"\"\"\n\nimport tensorflow as tf\nfrom tensorflow.python.framework import ops\nfrom tensorflow.python.framework import tensor_shape\nfrom tensorflow.python.framework import tensor_util\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.ops import random_op... | [
[
"tensorflow.reshape",
"tensorflow.contrib.layers.batch_norm",
"tensorflow.variable_scope",
"tensorflow.matmul",
"tensorflow.squeeze",
"tensorflow.contrib.layers.xavier_initializer_conv2d",
"tensorflow.abs",
"tensorflow.get_variable_scope",
"tensorflow.contrib.layers.layer_norm"... |
vrnanshuman/fpl-simulator | [
"1d78f8a74f69f740870fcbb729cb19ba4620c6fa"
] | [
"scout.py"
] | [
"from simulator import *\nimport numpy as np\n\n\n'''\n\tNotes : Use the env variable and its helper functions to \n\t1. get the points for a set of player ids\n\t2. get the cost for a set of player ids\n'''\n\nprofiles = [{'cols': ['stats.minutes'],\n 'order': [False],\n 'prob_dist': [0,... | [
[
"numpy.zeros",
"numpy.abs",
"numpy.argsort",
"numpy.in1d",
"numpy.broadcast_to",
"numpy.where"
]
] |
ObinnaObeleagu/evalml | [
"3b5bf62b08a5a5bc6485ba5387a08c32e1857473"
] | [
"evalml/tests/component_tests/test_arima_regressor.py"
] | [
"from unittest.mock import patch\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom pytest import importorskip\n\nfrom evalml.model_family import ModelFamily\nfrom evalml.pipelines.components import ARIMARegressor\nfrom evalml.problem_types import ProblemTypes\n\nsktime_arima = importorskip(\n \"skt... | [
[
"pandas.testing.assert_series_equal",
"pandas.DataFrame",
"pandas.date_range",
"numpy.zeros"
]
] |
dcmvdbekerom/exojax | [
"9b9305f8e383c73bdb97c1cfb0e276ddafcd75de"
] | [
"examples/LUH16A/COMP/compmodit.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport tqdm\n\nimport jax.numpy as jnp\nfrom jax import random\nfrom jax import vmap, jit\n\nfrom exojax.spec import rtransfer as rt\nfrom exojax.spec import planck, moldb, contdb, response, molinfo\nfrom exojax.spec.l... | [
[
"pandas.read_csv",
"numpy.savez",
"numpy.ones_like",
"numpy.log",
"numpy.array"
]
] |
AhmedArslan/arcsv | [
"596cbc30df6a213a6dc95fae1bcac865e2793dd9"
] | [
"arcsv/convex_diploid.py"
] | [
"import cvxpy as cvx\nimport numpy as np\n\ndef convex_diploid(lhs, ncs, pi_robust):\n n = len(lhs)\n w = cvx.Variable(n)\n print('building objective. . .')\n f = ((1-pi_robust) * np.asarray(lhs) + pi_robust) / np.asarray(ncs)\n print(f.shape)\n for i in range(f.shape[0]):\n print(np.sum(np... | [
[
"numpy.log",
"numpy.asarray"
]
] |
batmancn/Tensorflow-Tutorial | [
"946abac1b3723fff5525758c12bda827a93f9d2b"
] | [
"tutorial-contents/203_variable.py"
] | [
"\"\"\"\nKnow more, visit my Python tutorial page: https://morvanzhou.github.io/tutorials/\nMy Youtube Channel: https://www.youtube.com/user/MorvanZhou\n\nDependencies:\ntensorflow: 1.1.0\n\"\"\"\nimport tensorflow as tf\n\nvar = tf.Variable(0) # our first variable in the \"global_variable\" set\n\nadd_operation... | [
[
"tensorflow.global_variables_initializer",
"tensorflow.add",
"tensorflow.assign",
"tensorflow.Session",
"tensorflow.Variable"
]
] |
takecore/blueoil | [
"ae3001f4c5cdf1023371fa065898adbc6fcd1d33"
] | [
"lmnet/tests/lmnet_tests/test_pre_processor.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2018 The Blueoil 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... | [
[
"numpy.array",
"numpy.ones",
"numpy.max",
"numpy.zeros"
]
] |
bryanmr/pytorch | [
"129e99fbce8694f5694ec85c40ffa8e32ea674ed"
] | [
"test/distributed/test_c10d_common.py"
] | [
"# Owner(s): [\"oncall: distributed\"]\n\nimport copy\nimport os\nimport sys\nimport tempfile\nimport threading\nimport time\nimport unittest\nfrom datetime import timedelta\nfrom itertools import product\nfrom sys import platform\n\nimport torch\nimport torch.distributed as dist\n\nif not dist.is_available():\n ... | [
[
"torch.distributed.distributed_c10d._get_default_group",
"torch.empty",
"torch.testing._internal.common_utils.run_tests",
"torch.nn.functional.softmax",
"torch.no_grad",
"torch.distributed.FileStore",
"torch.distributed.new_group",
"torch.cuda.is_available",
"torch.nn.Conv2d",
... |
AIM3-RUC/ABAW2022 | [
"f1d25dc9914cc6768e58c14cea893c8e00b541bd"
] | [
"models/networks/lstm_encoder.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence\nfrom .fc_encoder import FcEncoder\n\nclass BiLSTMEncoder(nn.Module):\n def __init__(self, input_size, hidden_size):\n super(BiLSTMEncoder, self).__... | [
[
"torch.sum",
"torch.nn.LSTM",
"torch.nn.Linear",
"torch.nn.functional.softmax",
"torch.rand",
"torch.bmm",
"torch.nn.Conv1d",
"torch.nn.ReLU",
"torch.nn.LayerNorm",
"torch.nn.Sigmoid",
"torch.cat",
"torch.Tensor"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.