repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
microsoft/DualOctreeGNN | [
"29eed84653d4f0c1681c8227714cf84e76c31abe"
] | [
"tools/shapenet.py"
] | [
"# --------------------------------------------------------\n# Dual Octree Graph Networks\n# Copyright (c) 2022 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Peng-Shuai Wang\n# --------------------------------------------------------\n\nimport os\nimport time\nimport wget\nimpo... | [
[
"numpy.save",
"numpy.sum",
"torch.stack",
"torch.rand",
"torch.cat",
"torch.floor",
"numpy.savez",
"numpy.reshape",
"numpy.abs",
"numpy.random.choice",
"torch.from_numpy",
"numpy.expand_dims",
"numpy.random.rand",
"torch.Tensor",
"numpy.load",
"torch... |
ahmedtaiye/tfeatslekan | [
"fc6bbfe9f1cfdb56b002c03f611725120be0d9c4"
] | [
"L1.py"
] | [
"\r\nfrom __future__ import print_function\r\nfrom sklearn.metrics.pairwise import cosine_similarity\r\nfrom sklearn.decomposition import TruncatedSVD\r\nfrom sklearn.pipeline import make_pipeline\r\nfrom sklearn.preprocessing import Normalizer\r\nfrom sklearn import metrics\r\nfrom sklearn.decomposition import Tru... | [
[
"sklearn.preprocessing.Normalizer",
"sklearn.metrics.v_measure_score",
"sklearn.decomposition.ProjectedGradientNMF",
"sklearn.metrics.adjusted_rand_score",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.decomposition.TruncatedSVD",
"sklearn.decomposition.LatentDirichletAll... |
hashstat/cvxpy | [
"20d667ebe8614821fa38e41b1e333257512d9594"
] | [
"examples/extensions/feature_selection.py"
] | [
"\"\"\"\nCopyright 2013 Steven Diamond\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\nUnless required by applicable law or agreed to i... | [
[
"numpy.random.normal",
"numpy.random.seed"
]
] |
NuTufts/chroma_lartpc | [
"ea6d1a62d22eeeaac069efdef1068a56be683fcc"
] | [
"chroma/uboone/materials.py"
] | [
"import os,sys\nimport numpy as np\n\n# This module has functions and defintions to load the optical \n# properties required by the MicroBooNE detector\n\nmaterialnames = [\"LAr\", # liquid argon [ may have its own module one day ]\n \"ArGas\", # gaseous arg... | [
[
"numpy.array"
]
] |
Mu-L/TheAlgorithmsOfPython | [
"2d3d660155241113b23e4ed810e05479b2fc4bba"
] | [
"machine_learning/polymonial_regression.py"
] | [
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.linear_model import LinearRegression\n\n# Splitting the dataset into the Training set and Test set\nfrom sklearn.model_selection import train_test_split\n\n# Fitting Polynomial Regression to the dataset\nfrom sklearn.preprocessing import Polynomial... | [
[
"sklearn.preprocessing.PolynomialFeatures",
"pandas.read_csv",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.sc... |
AleksaC/gym-snake | [
"216a1af7cc1edd3d95be8a5ae2effc5f420452b0"
] | [
"gym-snake/gym_snake/envs/snake_env.py"
] | [
"from collections import deque\nimport time\n\nimport gym\nimport numpy as np\n\nfrom gym import spaces, logger\nfrom gym.utils import seeding\nfrom gym.envs.classic_control import rendering\n\n\nclass SnakeEnv(gym.Env):\n metadata = {\n \"render.modes\": [\"human\", \"rgb_array\"],\n \"video.frame... | [
[
"numpy.empty",
"numpy.zeros"
]
] |
moghadas76/test_bigcity | [
"607b9602c5b1113b23e1830455e174b0901d7558",
"607b9602c5b1113b23e1830455e174b0901d7558"
] | [
"libcity/model/traffic_speed_prediction/STAGGCN.py",
"test/test_gwnet.py"
] | [
"import math\nfrom logging import getLogger\nfrom typing import Optional\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils import weight_norm\n\nfrom libcity.model import loss\nfrom libcity.model.abstract_traffic_state_model import AbstractTrafficStateM... | [
[
"numpy.sum",
"torch.nn.init.xavier_uniform_",
"torch.mm",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.functional.dropout",
"torch.tanh",
"torch.nn.functional.leaky_relu",
"torch.sigmoid",
"torch.device",
"torch.Tensor",
"torch.tensor",
"torch.nn.Conv1d",
"tor... |
Sunnyfred/Atlantic_Hurricane_Simulations | [
"ee5d6d0f975876a01c4a21bebd3089bf3bbb843a"
] | [
"section3_change_pars_for_weak_hurricanes/Source_code_for_extracting_data/source_code_change_Clz/1_Calculate_wind_track.py"
] | [
"import numpy as np\nfrom netCDF4 import Dataset\nimport matplotlib.pyplot as plt\nfrom plotly.graph_objs import Scattergeo, Layout\nfrom plotly import offline\nfrom cartopy import config\nimport matplotlib as matplot\nfrom matplotlib.image import imread\nimport cartopy.crs as crs\nimport os\nimport shapely.geometr... | [
[
"numpy.array",
"numpy.amin"
]
] |
ZurMaD/DeblurGANv2 | [
"bf8ab7d178ecf32db7eba588ede3f3f121d17470"
] | [
"predict.py"
] | [
"import os\nfrom glob import glob\nfrom typing import Optional\n\nimport cv2\nimport numpy as np\nimport torch\nimport yaml\nfrom fire import Fire\nfrom tqdm import tqdm\n\nfrom aug import get_normalize\nfrom models.networks import get_generator\n\n\nclass Predictor:\n def __init__(self, weights_path: str, model... | [
[
"numpy.transpose",
"torch.load",
"torch.no_grad",
"numpy.ones_like",
"numpy.hstack",
"torch.from_numpy",
"numpy.expand_dims",
"numpy.pad"
]
] |
NCcoco/kaggle-project | [
"bff565bcfa8395c87920068557678566631b8d99"
] | [
"Bird-Species/transformer/vision-transformer3.py"
] | [
"import tensorflow as tf\nimport tensorflow_hub as hub\nimport tensorflow.keras as keras\nimport tensorflow.keras.layers as layers\n\nfrom PIL import Image\nfrom io import BytesIO\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport requests\nimport os\nimport platform\nimport pathlib\nimport random\nimport... | [
[
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.metrics.SparseCategoricalAccuracy",
"tensorflow.image.resize",
"tensorflow.keras.layers.Rescaling",
"tensorflow.cast",
"tensorflow.GradientTape",
"tensorflow.keras.layers.... |
kineticengines/text-to-text-transfer-transformer | [
"97cdc174f138e1aa5c189593ed2be77236dcb323"
] | [
"t5/data/preprocessors_test.py"
] | [
"# Copyright 2020 The T5 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 or agr... | [
[
"tensorflow.equal",
"tensorflow.stack",
"tensorflow.range",
"tensorflow.data.Dataset.from_tensors",
"tensorflow.cast",
"tensorflow.data.Dataset.from_generator",
"tensorflow.constant",
"tensorflow.random.set_seed",
"tensorflow.data.Dataset.from_tensor_slices"
]
] |
Xiaoxiong-Liu/gluon-ts | [
"097c492769258dd70b7f223f826b17b0051ceee9"
] | [
"src/gluonts/nursery/spliced_binned_pareto/tcn.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ... | [
[
"torch.nn.utils.weight_norm",
"torch.nn.Conv1d",
"torch.nn.Sequential",
"torch.nn.LeakyReLU"
]
] |
marcbue/spikeinterface | [
"d3462eeabcb9f0b9816004dd47355e40f4de1ac5"
] | [
"spikeinterface/comparison/groundtruthstudy.py"
] | [
"from pathlib import Path\nimport os\nimport shutil\nimport numpy as np\nimport pandas as pd\n\nfrom spikeinterface.core import load_extractor\nfrom spikeinterface.extractors import NpzSortingExtractor\nfrom spikeinterface.sorters import sorter_dict, run_sorters\n\nfrom spikeinterface import WaveformExtractor\nfrom... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"pandas.MultiIndex.from_tuples",
"pandas.concat"
]
] |
mrjavoman/Image-Super-Resolution-via-Iterative-Refinement | [
"d353bbcbc667e7ad5da739c7d1b343a44afb88c9"
] | [
"sr.py"
] | [
"import torch\nimport data as Data\nimport model as Model\nimport argparse\nimport logging\nimport core.logger as Logger\nimport core.metrics as Metrics\nfrom tensorboardX import SummaryWriter\nimport os\nimport numpy as np\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n parser.add_argu... | [
[
"numpy.concatenate"
]
] |
ShiKaiWi/python-practice | [
"2ce82bd778b9a4022bdd26d0a3e1bee2ebec6f51"
] | [
"CVlib/GaussianFilter.py"
] | [
"import numpy as np\nimport pylab as plt\nimport mahotas as mh\n\nclass GaussianFilter:\n def __init__(self,img,sigma = 1,windsize = 3):\n self.img = mh.imread(img)\n self.M,self.N = self.img.shape\n self.windsize = windsize \n self.sigma = sigma\n self.gaussian_kernel = self.k... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.reshape",
"numpy.square",
"numpy.meshgrid",
"numpy.linspace"
]
] |
mihirp1998/EmbLang | [
"169b0468ccda554896973bcc226afb3e762a70e7"
] | [
"vis_imagine_static_voxels/lib_classes/modules/embnet2.py"
] | [
"\nfrom lib_classes.modules.utils_basic import *\nfrom lib_classes.modules import utils_improc\nimport constants as const\nimport ipdb\nst = ipdb.set_trace\nfrom sklearn.decomposition import PCA\n\n\nclass SimpleNetBlock(tf.keras.Model):\n def __init__(self,out_chans, blk_num,istrain):\n super(SimpleNetBl... | [
[
"sklearn.decomposition.PCA"
]
] |
jsikyoon/dreamer | [
"c422d14bba523083c69a862d8c16b41d686c5028"
] | [
"models.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import layers as tfkl\nfrom tensorflow_probability import distributions as tfd\nfrom tensorflow.keras.mixed_precision import experimental as prec\n\nimport tools\nfrom trxls import TrXL\n\n\nclass RSSM(tools.Module):\n\n def __init__(self, stoch=3... | [
[
"tensorflow.keras.layers.GRUCell",
"tensorflow.zeros",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.tanh",
"tensorflow.expand_dims",
"numpy.exp",
"tensorflow.concat",
"numpy.prod",
"tensorflow.keras.mixed_precision.experimental.global_policy",
"tensorflow.trans... |
JE-Chen/je_old_repo | [
"a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5"
] | [
"LogSystem_JE/venv/Lib/site-packages/tqdm/gui.py"
] | [
"\"\"\"\r\nGUI progressbar decorator for iterators.\r\nIncludes a default `range` iterator printing to `stderr`.\r\n\r\nUsage:\r\n>>> from tqdm.gui import trange, tqdm\r\n>>> for i in trange(10):\r\n... ...\r\n\"\"\"\r\n# future division is important to divide integers and get as\r\n# a result precise floating ... | [
[
"matplotlib.pyplot.ticklabel_format",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.isinteractive",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.axhspan"
]
] |
jungtaekkim/bayeso-benchmarks | [
"3650aaeeaa123da14f0f839da664b071ee17bf9a"
] | [
"tests/test_inf_dim_ackley.py"
] | [
"#\n# author: Jungtaek Kim (jtkim@postech.ac.kr)\n# last updated: February 8, 2021\n#\n\nimport numpy as np\nimport pytest\n\nfrom bayeso_benchmarks.inf_dim_ackley import *\n\nclass_fun = Ackley\n\nTEST_EPSILON = 1e-5\n\n\ndef test_init():\n obj_fun = class_fun(2)\n\n with pytest.raises(TypeError) as error:\n... | [
[
"numpy.array"
]
] |
tzole1155/moai | [
"d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180"
] | [
"moai/validation/single.py"
] | [
"import moai.utils.engine as mieng\n\nimport torch\nimport omegaconf.omegaconf\nimport typing\nimport logging\nimport inspect\nimport itertools\n\nlog = logging.getLogger(__name__)\n\n__all__ = ['Metric']\n\nclass Metric(mieng.Single):\n def __init__(self,\n metrics: omegaconf.DictConfig,\n **kwarg... | [
[
"torch.mean"
]
] |
shoshijak/NTPoly | [
"04ee94f743727775bbc97120325c57bf393932e9"
] | [
"UnitTests/test_matrix.py"
] | [
"\"\"\"\nA test suite for local matrices.\n\"\"\"\nimport unittest\nimport NTPolySwig as nt\n\nfrom scipy.io import mmwrite, mmread\n\n\nclass TestParameters:\n '''An internal class for holding test parameters.'''\n\n def __init__(self, rows, columns, sparsity):\n '''Default constructor\n @param... | [
[
"scipy.sparse.random",
"scipy.linalg.norm",
"scipy.sparse.csr_matrix",
"scipy.io.mmread",
"scipy.io.mmwrite"
]
] |
suryadheeshjith/Frustum-PointNet | [
"10e7b1c0ee8183c4791e67c44e7e2ba6c265486c"
] | [
"mayavi/test_drawline.py"
] | [
"import numpy\nfrom mayavi.mlab import *\n\ndef test_plot3d():\n \"\"\"Generates a pretty set of lines.\"\"\"\n n_mer, n_long = 6, 11\n pi = numpy.pi\n dphi = pi / 1000.0\n phi = numpy.arange(0.0, 2 * pi + 0.5 * dphi, dphi)\n mu = phi * n_mer\n x = numpy.cos(mu) * (1 + numpy.cos(n_long * mu / n... | [
[
"numpy.arange",
"numpy.sin",
"numpy.cos"
]
] |
m-mirz/proloaf | [
"4109665b2e6eb1dbdc37dae4a3c0afd2ca6af87f"
] | [
"source/fc_prep.py"
] | [
"# Copyright 2021 The ProLoaF Authors. All Rights Reserved.\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to yo... | [
[
"pandas.read_csv",
"pandas.read_excel",
"numpy.cos",
"pandas.to_datetime",
"pandas.concat",
"numpy.sin",
"pandas.get_dummies"
]
] |
robot-perception-group/AutonomousBlimpDRL | [
"a10a88b2e9c9f9a83435cff2e4bc7e16e83cfeee"
] | [
"RL/rl/rllib_script/test_agent/test_agent.py"
] | [
"import os\nimport pickle\n\nimport numpy as np\nimport ray\nimport sys\nimport rl.rllib_script.agent.model.ray_model\nfrom blimp_env.envs import ResidualPlanarNavigateEnv\nfrom ray.rllib.agents import ppo\nfrom ray.tune.logger import pretty_print\n\ncheckpoint_path = os.path.expanduser(\n \"~/catkin_ws/src/Auto... | [
[
"numpy.sin",
"numpy.cos"
]
] |
MilanSusa/Skin-Cancer-Detection-Inference-API | [
"f4a62982ee6dfb3e2d56bdfc65fcc885aab69935"
] | [
"app.py"
] | [
"import os\nimport shutil\n\nfrom flask import Flask, request, jsonify\nfrom werkzeug.utils import secure_filename\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.metrics import top_k_categorical_accuracy\nfrom keras_preprocessing.image import ImageDataGenerator\nfrom keras.applications.mobil... | [
[
"tensorflow.keras.metrics.top_k_categorical_accuracy",
"tensorflow.keras.models.load_model"
]
] |
alisure-fork/BASNet | [
"0cc349a3190d92a2fe991107f711abdcce3531ec"
] | [
"src/MyThink_MIC5_Decoder8.py"
] | [
"import os\nimport glob\nimport torch\nimport numpy as np\nfrom PIL import Image\nfrom skimage import io\nfrom alisuretool.Tools import Tools\nfrom torch.utils.data import DataLoader\nfrom src.MyTrain_MIC5_Decoder8 import BASNet, DatasetUSOD\n\n\ndef one_decoder():\n # --------- 1. get path ---------\n has_ma... | [
[
"torch.utils.data.DataLoader",
"torch.load",
"numpy.asarray",
"torch.topk",
"torch.cuda.is_available"
]
] |
walkagain/name_generator | [
"e7b43c917b8a68563518e65b8d63a6c40fc2285d"
] | [
"name_generator_rnn.py"
] | [
"# -*- coding:utf-8 -*-\r\nfrom __future__ import print_function, unicode_literals, division\r\nfrom io import open\r\nimport glob\r\nimport os\r\nimport unicodedata\r\nimport string\r\nimport argparse\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport random\r\n\r\nimport time\r\nimport math\r\n\r\nimport matp... | [
[
"torch.nn.NLLLoss",
"torch.nn.Linear",
"torch.load",
"torch.nn.LogSoftmax",
"torch.zeros",
"torch.LongTensor",
"torch.cat",
"torch.nn.Dropout"
]
] |
dan1keen/dissertation_counter | [
"1265ee9563d349849c9a68d204e0f427e33f0f48"
] | [
"kalman_tracker/main.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport glob\n#from moviepy.editor import VideoFileClip\nfrom collections import deque\nfrom sklearn.utils.linear_assignment_ import linear_assignment\n\nfrom kalman_tracker import helpers\nfrom kalman_tracker import detector\nfrom kalman_tracker import tracker\n... | [
[
"numpy.empty",
"numpy.asarray",
"numpy.expand_dims",
"sklearn.utils.linear_assignment_.linear_assignment",
"numpy.array",
"numpy.concatenate"
]
] |
s10singh97/GSQuantify2018 | [
"a18df022414659cafdbc010df31db5a4f957a1d6"
] | [
"1.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\ndataset = pd.read_csv('train.csv')\nX = dataset.iloc[:, 1:4].values\ny = dataset.iloc[:, 0].values\n\nfrom sklearn.preprocessing import LabelEncoder, OneHotEncoder\nlabelencoder_X_1 = LabelEncoder()\nX[:, 2] = labelencoder_X_1.fit_transfor... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"sklearn.tree.DecisionTreeRegressor",
"numpy.column_stack",
"numpy.row_stack",
"sklearn.preprocessing.LabelEncoder",
"sklearn.preprocessing.OneHotEncoder"
]
] |
nicehiro/multiagent-particle-envs | [
"9028a9f73306b4044d352dd46356ed451ca82c7b"
] | [
"multiagent/environment.py"
] | [
"import gym\nfrom gym import spaces\nfrom gym.envs.registration import EnvSpec\nimport numpy as np\nfrom gym.spaces import MultiDiscrete\n\n\nclass MultiAgentEnv(gym.Env):\n \"\"\"Environment for all agents in the multiagent world.\n currently code assumes that no agents will be created/destroyed at runtime!\... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.cos",
"numpy.argmax",
"numpy.all",
"numpy.array",
"numpy.sin",
"numpy.linspace"
]
] |
artanzand/neural_style_transfer | [
"134ff775a706e1c08d836b43e11986b6f2d00543"
] | [
"stylize.py"
] | [
"# author: Artan Zandian\r\n# date: 2022-01-22\r\n\r\n\"\"\"\r\nReads two source images, one as the initial content image and second as the target style image,\r\nand applies Neural Style Transfer on the content image to create a stylized rendering of the content\r\nimage based on the texture and style of the style... | [
[
"tensorflow.keras.optimizers.Adam",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.subtract",
"tensorflow.function",
"numpy.reshape",
"tensorflow.keras.Model",
"tensorflow.add",
"tensorflow.keras.applications.VGG19",
"tensorflow.GradientTape",
"tensorflow.image.c... |
oreh/gseapy | [
"d3212afb2e8d61f37957d685da6ef28f723d98e6"
] | [
"gseapy/gsea_plot.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.transforms as transforms\nfrom matplotlib.colors import Normalize\n\n\n\nclass _MidpointNormalize(Normalize):\n def __init__(self, vmin=None, vmax=None, midpoint=None, clip=False):\n self.midpoint = midpoint... | [
[
"matplotlib.colors.Normalize.__init__",
"numpy.interp",
"matplotlib.pyplot.ioff",
"matplotlib.pyplot.figure",
"numpy.abs",
"matplotlib.pyplot.GridSpec",
"matplotlib.pyplot.close",
"matplotlib.transforms.blended_transform_factory"
]
] |
TangleSpace/hotstepper | [
"4d8a278d94f19fee2bc4d3ba25628fa69ed3653d"
] | [
"hotstepper/mixins/operations.py"
] | [
"import numpy as np\nfrom hotstepper.core.data_model import DataModel\nfrom hotstepper.utilities.helpers import get_epoch_start\n\n\ndef apply_math_function(caller,other,math_function, sample_points=None):\n \"\"\"\n Apply the supplied function to two objects evaluated at the union of all their unique step ke... | [
[
"numpy.alltrue",
"numpy.array",
"numpy.empty",
"numpy.isnan"
]
] |
cyberflax2020/21-S1-2-C-Cinema-Code | [
"6c3358168996529cbb0745a7c3f5aa257d790360"
] | [
"Build_Body_Samples.py"
] | [
"import csv\nimport numpy as np\nimport mediapipe as mp\nimport cv2\n\nclass_name = \"Speaking\"\n\nmp_drawing = mp.solutions.drawing_utils # Drawing helpers\nmp_holistic = mp.solutions.holistic # Mediapipe Solutions\n\nstr_source = input(\"dir:\")\ncap = cv2.VideoCapture(str_source)\n# Initiate holistic model\nw... | [
[
"numpy.array"
]
] |
wdxtub/deep-learning-note | [
"47b83a039b80d4757e0436d5cbd2fa3037de3904"
] | [
"mlds/1-numpy/4_numpy_100.py"
] | [
"import numpy as np\nimport time\n\nprint('1. 创建大小为 10 的空向量')\na = np.zeros(10)\nprint(a)\n\nprint('2. 查看矩阵占据的内存大小')\nprint('用元素个数乘以每个元素的大小')\nprint(f'占据 {a.size * a.itemsize} 字节')\n\nprint('3. 创建一个向量,值从 10 到 49')\na = np.arange(10, 50)\nprint(a)\n\nprint('4. 翻转一个向量')\na = a[::-1]\nprint(a)\n\nprint('5. 创建一个 3x3 的矩... | [
[
"numpy.ones",
"numpy.sum",
"numpy.intersect1d",
"numpy.argsort",
"numpy.trunc",
"numpy.unravel_index",
"numpy.allclose",
"numpy.add.reduce",
"numpy.argpartition",
"numpy.linspace",
"numpy.nonzero",
"numpy.mean",
"numpy.random.uniform",
"numpy.eye",
"nump... |
BitGo/statsmodels | [
"31a73250495d63dfc853625ce1d2b3566d3ac95a"
] | [
"statsmodels/tsa/vector_ar/tests/test_var.py"
] | [
"\"\"\"\nTest VAR Model\n\"\"\"\nfrom __future__ import print_function\n# pylint: disable=W0612,W0231\nfrom statsmodels.compat.python import (iteritems, StringIO, lrange, BytesIO,\n range)\nfrom nose.tools import assert_raises\nimport nose\nimport os\nimport sys\n\nimport numpy... | [
[
"numpy.testing.assert_almost_equal",
"pandas.DatetimeIndex",
"numpy.append",
"numpy.testing.assert_equal",
"numpy.savez",
"pandas.rpy.common.convert_robj",
"pandas.DataFrame",
"numpy.log",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.round"
]
] |
hnwarid/DQLabAcademy | [
"e03d82f97536ae103b6abc65db0ae16520fb68c7"
] | [
"1_PythonDataProcessing/3_14_index_method.py"
] | [
"import pandas as pd\n# Baca file sample_tsv.tsv untuk 10 baris pertama saja\ndf = pd.read_csv(\"https://storage.googleapis.com/dqlab-dataset/sample_tsv.tsv\", sep=\"\\t\", nrows=10)\n# Cetak data frame awal\nprint(\"Dataframe awal:\\n\", df)\n# Set index baru\ndf.index = [\"Pesanan ke-\" + str(i) for i in range(1,... | [
[
"pandas.read_csv"
]
] |
vibhatha/cylon | [
"3f2c5b08935a4332b820818ca113cb44f7ac5da3"
] | [
"python/examples/op_benchmark/null_handling_benchmark.py"
] | [
"##\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 agreed to in writing, software\n# distri... | [
[
"numpy.array",
"pandas.eval",
"pandas.DataFrame"
]
] |
mieldehabanero/stable-baselines3 | [
"b37052cbf059b6f81314f5b98205e4a3403e4112"
] | [
"tests/test_dict_env.py"
] | [
"import gym\nimport numpy as np\nimport pytest\nfrom gym import spaces\n\nfrom stable_baselines3 import A2C, DDPG, DQN, PPO, SAC, TD3\nfrom stable_baselines3.common.env_util import make_vec_env\nfrom stable_baselines3.common.envs import BitFlippingEnv, SimpleMultiObsEnv\nfrom stable_baselines3.common.evaluation imp... | [
[
"numpy.allclose"
]
] |
OliviaWang123456/ncnet | [
"d45920d57ea1c01befb96785a2f1af8bd50e7390"
] | [
"lib/pf_dataset.py"
] | [
"from __future__ import print_function, division\nimport os\nimport torch\nfrom torch.autograd import Variable\nfrom skimage import io\nimport pandas as pd\nimport numpy as np\nfrom torch.utils.data import Dataset\nfrom lib.transformation import AffineTnf\n \nclass PFPascalDataset(Dataset):\n \n \"\"\"\n ... | [
[
"numpy.ones",
"torch.FloatTensor",
"pandas.read_csv",
"torch.autograd.Variable",
"numpy.asarray",
"torch.ne",
"numpy.nonzero",
"numpy.fromstring"
]
] |
jongtack/tensorflow | [
"2d5f0ac61fe4e4160fbb68d8031418528111dae9"
] | [
"tensorflow/python/ops/rnn.py"
] | [
"# Copyright 2015 Google Inc. 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 required by appl... | [
[
"tensorflow.python.ops.math_ops.reduce_max",
"tensorflow.python.ops.array_ops.pack",
"tensorflow.python.ops.array_ops.identity",
"tensorflow.python.ops.array_ops.shape",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.array_ops.unpack",
"tensorflow.python.... |
bozhenhhu/gvp-pytorch | [
"82af6b22eaf8311c15733117b0071408d24ed877"
] | [
"run_cpd.py"
] | [
"import argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--models-dir', metavar='PATH', default='./models/',\n help='directory to save trained models, default=./models/')\nparser.add_argument('--num-workers', metavar='N', type=int, default=4,\n help='number o... | [
[
"torch.cuda.empty_cache",
"torch.load",
"numpy.zeros",
"torch.argmax",
"torch.no_grad",
"numpy.median",
"torch.nn.CrossEntropyLoss",
"numpy.exp",
"torch.cuda.is_available",
"numpy.round"
]
] |
italogfernandes/machine-learning | [
"7a0cb2bdf7fcc44dee1241fdf0ff59a68d8e45db"
] | [
"Part 2 - Regression/Section 4 - Simple Linear Regression/simple_linear_regression.py"
] | [
"# Simple Linear Regression\n\n# Importing the libraries\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LinearRegression\n\n# Importing the dataset\ndataset = pd.read_csv('../datasets/Salary_Data.csv')\nX = dataset.iloc[:... | [
[
"pandas.read_csv",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.scatter"
]
] |
FrankZhu7/play-with-data-science | [
"f527c7233fc9f33408e239b03ffd7a699a8b6923"
] | [
"SP500 volatility estimation with machine learning models/dm_test.py"
] | [
"# Author : John Tsang\n# Date : December 7th, 2017\n# Purpose : Implement the Diebold-Mariano Test (DM test) to compare\n# forecast accuracy\n# Input : 1) actual_lst: the list of actual values\n# 2) pred1_lst : the first list of predicted values\n# 3) pred2_lst : the seco... | [
[
"numpy.arange",
"pandas.Series"
]
] |
goktug97/PyYOLO | [
"69c6997e3e3762199ee04e7339725b51059e56f4"
] | [
"pyyolo/yolo.py"
] | [
"#!/usr/bin/env python3\n\nimport cv2\nfrom .cyolo import *\nimport numpy as np\n\n\nclass BBox(np.ndarray):\n def __new__(cls, x, y, w, h, prob, name):\n cls.name = \"\"\n cls.prob = 0\n obj = np.asarray([x, y, w, h]).view(cls)\n obj.x, obj.y, obj.w, obj.h = obj.view()\n obj.n... | [
[
"numpy.array",
"numpy.asarray"
]
] |
emanuelevivoli/CompReGAN | [
"33589c3871bed8adcc157bf25a45b8d12ba1af66"
] | [
"data_utils.py"
] | [
"from os import listdir\nfrom os.path import join\n\nfrom PIL import Image\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data.dataset import Dataset\nfrom torchvision.transforms import Compose, RandomCrop, ToTensor, ToPILImage, CenterCrop, Resize, transforms\nfrom utils.jpeg_layer import jpeg_compression_t... | [
[
"torch.nn.init.xavier_uniform_",
"numpy.clip",
"torch.Tensor"
]
] |
rishabhsamb/fairlearn | [
"c039a3fb292a57d5d2995ded8400122e4c736985"
] | [
"fairlearn/metrics/_metric_frame.py"
] | [
"# Copyright (c) Microsoft Corporation and Fairlearn contributors.\n# Licensed under the MIT License.\n\nimport copy\nimport logging\nimport numpy as np\nimport pandas as pd\nfrom typing import Any, Callable, Dict, List, Optional, Union\nfrom sklearn.utils import check_consistent_length\nimport warnings\nfrom funct... | [
[
"pandas.Series",
"pandas.MultiIndex.from_product",
"numpy.isscalar",
"sklearn.utils.check_consistent_length",
"numpy.asarray",
"pandas.Index",
"pandas.DataFrame.from_dict"
]
] |
aditya-vikram-parakala/MachineLearning_CSE574 | [
"7816ebd6cc342d0c4405d45e771dd50e800c2463"
] | [
"logreg_hd_concat.py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\n\nimport numpy as np\nimport csv \nimport random\nimport math\nimport pandas as pd\n\n\n# In[2]:\n\n\nTrainingPercent = 80 # 80% of raw data \nValidationPercent = 10 # 10% of raw data\nTestPercent = 10 #10% of raw data \nIsSynthetic =False\ndef GenerateRawData(filePath, IsSyntheti... | [
[
"numpy.ones",
"numpy.transpose",
"numpy.zeros",
"numpy.dot",
"numpy.exp",
"numpy.log",
"numpy.delete",
"numpy.concatenate"
]
] |
ana-simionescu/ddsp | [
"9f37ff66e79cf912c3377ba1beddb220196aa1a3"
] | [
"ddsp/synths_test.py"
] | [
"# Copyright 2020 The DDSP 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 or a... | [
[
"numpy.logical_and",
"tensorflow.compat.v2.zeros",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.linspace",
"numpy.all",
"tensorflow.compat.v2.tile"
]
] |
loramf/mlforhealthlabpub | [
"aa5a42a4814cf69c8223f27c21324ee39d43c404"
] | [
"alg/discriminative-jackknife/utils/parameters.py"
] | [
"\n# Copyright (c) 2020, Ahmed M. Alaa\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\n# ---------------------------------------------------------\n# Helper functions and utilities for deep learning models\n# ---------------------------------------------------------\n\n\nfrom __future__ import absol... | [
[
"torch.nn.LeakyReLU",
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LogSigmoid",
"torch.manual_seed",
"torch.nn.CELU",
"torch.nn.Tanh",
"torch.nn.ReLU6",
"torch.nn.Hardtanh",
"torch.nn.GLU",
"torch.nn.Sequential",
"torch.nn.ELU",
"torch.nn.Sigmoid",
"torc... |
albamr09/PythonML | [
"9848cf913a7cdb73d2b98a8ab7334c04f421ad87"
] | [
"pyml/supervised/SVM/SVM2.py"
] | [
"import numpy as np\n\n\"\"\"\n\n------------------------------------------------------------------------------------------------------------------------------------------------------\n\n SVM2\n\n---------------------------------------------------------... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.exp",
"numpy.stack",
"numpy.dot",
"numpy.meshgrid"
]
] |
w-sugar/maskrcnn-benchmark | [
"37d985c2c0b190bf76945b9f7a9530b855e370e5"
] | [
"maskrcnn_benchmark/engine/trainer.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport datetime\nimport logging\nimport os\nimport time\n\nimport torch\nimport torch.distributed as dist\nfrom tqdm import tqdm\n\nfrom maskrcnn_benchmark.data import make_data_loader\nfrom maskrcnn_benchmark.utils.comm import get_world_size... | [
[
"torch.stack",
"torch.distributed.get_rank",
"torch.no_grad",
"torch.cuda.max_memory_allocated",
"torch.distributed.reduce"
]
] |
scuervo91/reservoirpy | [
"a4db620baf3ff66a85c7f61b1919713a8642e6fc"
] | [
"reservoirpy/wellproductivitypy/pi/outflow.py"
] | [
"import numpy as np\nimport pandas as pd \nimport matplotlib.pyplot as plt\nfrom ...pvtpy.black_oil import Pvt,Oil,Water,Gas\nfrom scipy.optimize import root_scalar\nfrom .inflow import OilInflow, GasInflow\nfrom ...utils import intercept_curves\nfrom typing import Union\n\n## Incompressible pressure drop\ndef pote... | [
[
"numpy.sqrt",
"numpy.atleast_2d",
"numpy.sign",
"numpy.zeros",
"matplotlib.pyplot.gca",
"pandas.DataFrame",
"numpy.abs",
"numpy.column_stack",
"numpy.exp",
"numpy.atleast_1d",
"numpy.power",
"numpy.log",
"numpy.array",
"numpy.sin",
"numpy.full",
"num... |
pyrateml/agent | [
"84235db931d6e4ef956962961c619994898ebdd5"
] | [
"utilities/curriculum/InitialStateDistribution.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n__author__ = 'cnheider'\nfrom collections import namedtuple\n\nimport numpy as np\n\n\nclass InitStateDistribution(object):\n StateDist = namedtuple('StateDist', ('state', 'prob'))\n\n def __init__(self):\n self.state_tuples = []\n\n def add(self, state, pro... | [
[
"numpy.random.choice"
]
] |
conorfalvey/Python-MultilayerExtraction | [
"68cfe9a82c45d52f36c5588e2bce83a5fc8400bb"
] | [
"python/test_init.py"
] | [
"# Testing Setup of Multilayer Extraction\nimport networkx as nx\nimport pandas as pd\nimport numpy as np\nimport math\nimport itertools as it\nfrom . import adjacency_to_edgelist\nfrom . import expectation_CM\nfrom . import initialization\nfrom . import score\nimport matplotlib.pyplot as plt\n\n# Gen default testi... | [
[
"numpy.sum",
"matplotlib.pyplot.show"
]
] |
allanwright/media-classifier-core | [
"7d86c0bc4a9361d36da0f6eaf62f2faa257c2339"
] | [
"src/mccore/prediction.py"
] | [
"'''Helper methods for making classification predictions.\n\n'''\n\nimport numpy as np\n\ndef get_class(proba, labels):\n '''Gets the class label from the specified class probability estimates.\n\n Args:\n proba (array like): The estimated class probability estimates.\n labels (dictionary): The ... | [
[
"numpy.max",
"numpy.argmax"
]
] |
rkalahasty/medicaltorch | [
"34ea15075a57271940d26684c34767a8a9e8fb58"
] | [
"medicaltorch/metrics.py"
] | [
"from collections import defaultdict\n\nfrom scipy import spatial\nimport numpy as np\n\n\nclass MetricManager(object):\n def __init__(self, metric_fns):\n self.metric_fns = metric_fns\n self.result_dict = defaultdict(float)\n self.num_samples = 0 \n \n def __call__(self, prediction, g... | [
[
"numpy.sum",
"numpy.divide",
"scipy.spatial.distance.directed_hausdorff",
"scipy.spatial.distance.dice",
"numpy.isnan",
"scipy.spatial.distance.jaccard"
]
] |
dertilo/espnet | [
"4d2414b3d56154ab8c6ded0eb0a3f076e073344b"
] | [
"tools/check_install.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"Script to check whether the installation is done correctly.\"\"\"\n\n# Copyright 2018 Nagoya University (Tomoki Hayashi)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\nimport argparse\nimport importlib\nimport logging\nimport sys\nimport traceback\n\nfrom distutils.... | [
[
"torch.cuda.is_available",
"torch.backends.cudnn.is_available",
"torch.cuda.device_count"
]
] |
HubBucket-Team/lingvo | [
"fb929def2f27cf73a6ee1b1eaa8bee982bd92987"
] | [
"lingvo/core/base_model_test.py"
] | [
"# Lint as: python2, python3\n# 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/... | [
[
"numpy.random.seed"
]
] |
MilesCranmer/bifrost | [
"951dd4a449850d22cfd74f4db13ecf806fe5cc30"
] | [
"python/bifrost/dtype.py"
] | [
"\n# Copyright (c) 2016, The Bifrost Authors. All rights reserved.\n# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source... | [
[
"numpy.dtype"
]
] |
acctouhou/Prediction_of_battery | [
"c7b1f4ccb11ddf416d1026c0a528ff2ef15eb842"
] | [
"1_Predicting/predict.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Oct 26 00:06:46 2019\n\n@author: Acc\n\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nfrom sklearn import preprocessing\nimport tensorflow as tf\nfrom tensorflow.keras import backend as K\nfrom tqdm import tqdm\n\n\ndata_dir='dataset'\nmodel_d... | [
[
"numpy.vstack",
"numpy.load",
"numpy.transpose",
"tensorflow.keras.models.load_model",
"tensorflow.keras.backend.clear_session",
"numpy.abs",
"numpy.float32",
"tensorflow.keras.backend.softplus",
"numpy.hstack",
"sklearn.preprocessing.StandardScaler",
"numpy.stack",
... |
Ostyk/unet-plus-plus | [
"924edd8b90856650da2f040fa2ae2db6fcda18b1"
] | [
"train.py"
] | [
"import argparse\nimport os\nfrom collections import OrderedDict\nfrom glob import glob\n\nimport pandas as pd\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn as nn\nimport torch.optim as optim\nimport yaml\nfrom albumentations.augmentations import transforms\nfrom albumentations.core.compositi... | [
[
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.utils.data.DataLoader",
"torch.cuda.empty_cache",
"torch.optim.SGD",
"torch.no_grad",
"pandas.DataFrame",
"torch.optim.Adam",
"torch.nn.BCEWithLogitsLoss",
"torch.optim.lr_scheduler.ReduceLROnPlateau"
]
] |
rogersheu/AllLeague-NBA-Predictions | [
"3675277e283ed48b4f0ab6a87b6403e8c29d287e"
] | [
"scripts/daily_database_update.py"
] | [
"import sqlite3\nfrom os import listdir\n\nimport pandas as pd\n\nfrom transfer_data import pick_path\n\n\ndef database_pipeline(path):\n connection = sqlite3.connect(\"./baseData/allPlayerStats.db\")\n\n cursor = connection.cursor()\n\n # See this for various ways to import CSV into sqlite using Python. P... | [
[
"pandas.read_csv"
]
] |
tonyshao5/Tensorflow-up | [
"f8f8fce9436c40cad298f6211db2be3a18480bad"
] | [
"tflib/data/disk_image.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport multiprocessing\n\nimport tensorflow as tf\nfrom tflib.data.dataset import batch_dataset, Dataset\n\n\n_N_CPU = multiprocessing.cpu_count()\n\n\ndef disk_image_batch_dataset(img_paths, batch_siz... | [
[
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.image.decode_png",
"tensorflow.read_file"
]
] |
machanic/TangentAttack | [
"17c1a8e93f9bbd03e209e8650631af744a0ff6b8"
] | [
"adversarial_defense/model/feature_defense_model.py"
] | [
"import glob\nimport os\nimport pretrainedmodels\nimport torch\nfrom torch import nn\nfrom torchvision import models as torch_models\nimport cifar_models as models\nfrom adversarial_defense.model.denoise_resnet import DenoiseResNet50, DenoiseResNet101, DenoiseResNet152\nfrom adversarial_defense.model.pcl_resnet imp... | [
[
"torch.FloatTensor",
"torch.no_grad",
"torch.nn.Linear",
"torch.load"
]
] |
miksu/edward2 | [
"973acdb23701f320ebaee8a56fc44d4414acfa4e"
] | [
"edward2/tensorflow/initializers.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Edward2 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 ... | [
[
"tensorflow.compat.v2.keras.initializers.he_normal",
"tensorflow.compat.v2.keras.utils.serialize_keras_object",
"tensorflow.compat.v2.keras.initializers.get",
"tensorflow.compat.v2.keras.initializers.GlorotNormal",
"tensorflow.compat.v2.random.truncated_normal",
"tensorflow.compat.v2.keras... |
3778/icd-prediction-mimic | [
"fb8dfc3140e6cf690690b04eddc735f4f20612cf"
] | [
"MIMIC_train_baselines.py"
] | [
"# Copyright 2020, 37.78 Tecnologia Ltda.\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 requir... | [
[
"tensorflow.keras.backend.clear_session"
]
] |
rosydavis/rdavis_msee_project_csun2017 | [
"d23159d19b5b3ea47ddd4a0f9684477346560fc2"
] | [
"move_images.py"
] | [
"# File: move_images.py\n# Author: Rosy Davis, rosydavis@ieee.org\n# Last modified: 2017 Nov. 28\n#\n# A utility script to copy DWT images from a folder that keeps them placed by file name\n# (as is true of the source MP3s in the FMA dataset) to folders that split them by dataset\n# split (test, train, val) and gen... | [
[
"numpy.testing.assert_array_equal"
]
] |
ari-s/XpyY | [
"384500b8112a4475f2df3e736f324ab8724f66c4"
] | [
"inputfilter/csv.py"
] | [
"import numpy,csv\n\ndef csv(infile,delimiter=','):\n '''reads csv with arbitrary delimiter, returns numpy array of strings'''\n with open(infile) as f:\n rv = [ l.strip().split(delimiter) for l in f\n if l.strip() # no empty lines\n and not l.st... | [
[
"numpy.array"
]
] |
jaideepmurkute/Active-Learning---Supervised-Machine-Learning-With-Minimal-Data | [
"ba3f4e471b0a01d87848f5153f2d9f79c0eff6b1"
] | [
"mnist_fashion_lc.py"
] | [
"import sys\r\nimport os\r\n\r\nfrom sklearn.linear_model import LogisticRegression\r\nfrom sklearn.linear_model import LogisticRegression\r\nfrom sklearn.linear_model import SGDClassifier\r\nfrom sklearn.model_selection import train_test_split\r\n#For sample ranking function from https://github.com/davefernig/alp\... | [
[
"numpy.sum",
"numpy.savetxt",
"numpy.random.choice",
"numpy.arange",
"numpy.shape",
"sklearn.linear_model.LogisticRegression",
"numpy.stack",
"numpy.concatenate",
"sklearn.model_selection.train_test_split"
]
] |
jiafeng5513/BinocularNet | [
"c26262cef69f99f9db832ec5610cc03bf50aed88"
] | [
"comparisons/SfmLeaner_pytorch/kitti_eval/depth_evaluation_utils.py"
] | [
"# Mostly based on the code written by Clement Godard:\n# https://github.com/mrharicot/monodepth/blob/master/utils/evaluation_utils.py\nimport numpy as np\nfrom collections import Counter\nfrom path import Path\nfrom scipy.misc import imread\nfrom tqdm import tqdm\nimport datetime\n\n\nclass test_framework_KITTI(ob... | [
[
"numpy.eye",
"numpy.fromfile",
"numpy.zeros",
"numpy.dot",
"numpy.round",
"numpy.logical_and",
"numpy.cos",
"scipy.misc.imread",
"numpy.arange",
"numpy.where",
"numpy.array",
"numpy.concatenate",
"numpy.linalg.norm"
]
] |
DFNaiff/Dissertation | [
"8db72a0e588042a582053625ec58cde6a661f2a9"
] | [
"tests_dissertation/source1d/test1a_mcmc.py"
] | [
"# -*- coding: utf-8 -*-\nimport sys\nsys.path.insert(0,\"../../src2\")\nimport math\nimport functools\nimport time\n\nimport torch\nimport numpy as np\nfrom scipy.special import gamma\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport emcee\n\nfrom source_1d_likelihood_fn import comp... | [
[
"numpy.savez",
"torch.manual_seed",
"numpy.random.seed",
"numpy.exp",
"torch.log",
"numpy.log",
"numpy.random.rand"
]
] |
Rensvandeschoot/automated-systematic-review | [
"fe06a570a806e1f14d3de5186511a04edf851cf3"
] | [
"asreview/models/embedding.py"
] | [
"import gzip\nimport io\nfrom multiprocessing import Process, Queue, cpu_count\nfrom pathlib import Path\nfrom urllib.request import urlopen\n\nimport numpy as np\n\nfrom asreview.utils import get_data_home\n\n\nEMBEDDING_EN = {\n \"url\": \"https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.en.300.vec.gz\... | [
[
"numpy.asarray",
"numpy.zeros"
]
] |
joyjeni/-Learn-Artificial-Intelligence-with-TensorFlow | [
"8ae05456241a3ead3dcb83dd315797380d7acacf"
] | [
"section3/snippets.py"
] | [
"import tensorflow as tf\n\n# ===============================================\n# Previously was snippets.py of: 3_2_RNNs\n# ===============================================\n\n# i = input_gate, j = new_input, f = forget_gate, o = output_gate\n# Get 4 copies of feeding [inputs, m_prev] through the \"Sigma\" diagram.\... | [
[
"tensorflow.tanh",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.nn.dynamic_rnn",
"tensorflow.concat",
"tensorflow.layers.Dense",
"tensorflow.split"
]
] |
colinzuo/MLAPP_Solution | [
"6d4bab23455169310547462fe2fc2cb71a915ef0"
] | [
"practice/toolbox/knn.py"
] | [
"import numpy as np\r\n\r\nfrom toolbox.sqDistance import *\r\nfrom toolbox.oneOfK import *\r\n\r\n\r\nclass KnnModel():\r\n def fit(self, X, y, K, C=None):\r\n self.X = X\r\n self.y = y\r\n self.K = K\r\n if C is not None:\r\n self.C = C\r\n else:\r\n sel... | [
[
"numpy.zeros",
"numpy.argmin",
"numpy.argsort",
"numpy.argmax",
"numpy.arange",
"numpy.array",
"numpy.unique"
]
] |
cwaluga/singularities_dolfin | [
"dd379f71f384717a63906fd701df542a1603b03b"
] | [
"src/extrapolate.py"
] | [
"#! /usr/bin/env python\n\n\"\"\"\nExtrapolation of correction parameters.\n\"\"\"\n\n__author__ = \"Christian Waluga (waluga@ma.tum.de)\"\n__copyright__ = \"Copyright (c) 2013 %s\" % __author__\n\nfrom dolfin import *\nfrom correction import *\nfrom meshtools import *\nfrom singular import *\nimport math\n\ndef ex... | [
[
"numpy.asarray",
"numpy.linspace",
"scipy.optimize.leastsq",
"numpy.zeros"
]
] |
ananyashreyjain/astropy | [
"a8b8d4c4d2dcc9be28385600f56066cef92a38ad"
] | [
"astropy/utils/iers/tests/test_iers.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport os\nimport urllib.request\n\nimport pytest\nimport numpy as np\n\nfrom ....tests.helper import assert_quantity_allclose, catch_warnings\nfrom .. import iers\nfrom .... import units as u\nfrom ....table import QTable\nfrom ....time import Tim... | [
[
"numpy.array",
"numpy.all",
"numpy.arange"
]
] |
huangyuyao/bevutils | [
"24e5c4954b17ed58e27697447ab667c65f59b7e0"
] | [
"bevutils/layers/perspective_transformer.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\nfrom ..functional import epipolar as E\n\nclass PerspectiveTransformerLayer(nn.Module):\n\n def __init__(self, bv_size, pv_size, intrinsics, translate_z = -10.0, rotation_order='xyz', device='cuda:0', dtype=torch.float32... | [
[
"torch.ones_like",
"torch.inverse",
"torch.tensor",
"torch.arange",
"torch.device",
"torch.matmul"
]
] |
danielballan/suitcase-tiff | [
"eb401cd4f2f1bd637ec23c10472e0579f0cefc66"
] | [
"suitcase/tiff/tests.py"
] | [
"from . import export\nimport numpy\nfrom numpy.testing import assert_array_equal\nimport pytest\nimport tifffile\n\nexpected = numpy.ones((10, 10))\n\n\n@pytest.mark.parametrize('stack_images', [True, False])\ndef test_export(tmp_path, example_data, stack_images):\n ''' runs a test using the plan that is passed... | [
[
"numpy.ones",
"numpy.testing.assert_array_equal"
]
] |
yjf18340/webots | [
"7c35a359848bafe81fe0229ac2ed587528f4c73e"
] | [
"projects/samples/robotbenchmark/visual_tracking/controllers/visual_tracking/visual_tracking.py"
] | [
"\"\"\"Sample Webots controller for the visual tracking benchmark.\"\"\"\n\nfrom controller import Robot, Node\nimport base64\nimport os\nimport sys\nimport tempfile\n\ntry:\n import numpy as np\nexcept ImportError:\n sys.exit(\"Warning: 'numpy' module not found. Please check the Python modules installation i... | [
[
"numpy.zeros"
]
] |
tpedelose/apls | [
"5afcadb1e75e5b2f0c0e0c8be4419251f61f23e7"
] | [
"apls/apls_utils.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 6 14:05:30 2019\n\n@author: avanetten\n\"\"\"\n\nimport osmnx_funcs\nimport numpy as np\nfrom osgeo import gdal, ogr, osr\nimport scipy.spatial\nimport geopandas as gpd\nimport rasterio as rio\nimport affine as af\nimport shapely\nimport ... | [
[
"numpy.rint",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"numpy.concatenate",
"numpy.asarray",
"matplotlib.pyplot.subplots",
"numpy.max",
"numpy.min",
"matplotlib.pyplot.close",
"numpy.round",
"numpy.where",
"numpy.unique"
]
] |
allydunham/sequence_unet | [
"e0d3d6b73ad79c596130ed6e1a58b41a4ad7e299"
] | [
"models/classifier/regularisation.py"
] | [
"\"\"\"\nExperiment testing various regularisations on the Sequence UNET model\n\"\"\"\nimport os\nimport sys\n\nimport utils\nfrom tensorflow.keras import optimizers\n\nfrom proteinnetpy.data import ProteinNetDataset, ProteinNetMap\nfrom proteinnetpy.data import make_length_filter\n\nimport metrics\nimport pn_maps... | [
[
"tensorflow.keras.optimizers.Adam"
]
] |
eragasa/pypospack | [
"21cdecaf3b05c87acc532d992be2c04d85bfbc22"
] | [
"tests/pyposmat/visualization/Pyposmat3DScatterWithProjections/dev__contours.py"
] | [
"from mpl_toolkits.mplot3d import axes3d\nimport matplotlib.pyplot as plt,numpy as np\nplt.clf()\nfig = plt.figure(1)\nax = fig.gca(projection='3d')\nX, Y, Z = axes3d.get_test_data(0.05)\nax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)\ncset = ax.contourf(X, Y, Z, zdir='z', offset=-100,\n levels=np... | [
[
"matplotlib.pyplot.figure",
"numpy.linspace",
"matplotlib.pyplot.clf"
]
] |
eugene-yang/libact | [
"d86b7b850560138defb7be51986bfafd3d45f81b"
] | [
"libact/query_strategies/multiclass/hierarchical_sampling.py"
] | [
"\"\"\" Hierarchical Sampling for Active Learning (HS)\n\nThis module contains a class that implements Hierarchical Sampling for Active\nLearning (HS).\n\n\"\"\"\nfrom __future__ import division\n\nimport numpy as np\nfrom sklearn.cluster import AgglomerativeClustering\n\nfrom libact.base.interfaces import QueryStr... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.sqrt",
"numpy.full",
"sklearn.cluster.AgglomerativeClustering"
]
] |
saltastroops/imephu | [
"0c302a73d01fe3ad018e7adf4b91e0beaecc6709"
] | [
"tests/conftest.py"
] | [
"\"\"\"pytest configuration.\"\"\"\nimport io\nimport pathlib\nimport time\nfrom unittest import mock\n\nimport numpy as np\nimport pytest\nfrom astropy import units as u\nfrom astropy.coordinates import SkyCoord\nfrom typer.testing import CliRunner\n\nimport imephu\nfrom imephu.annotation.general import TextAnnota... | [
[
"numpy.random.seed"
]
] |
dieterv77/statsmodels | [
"844381797a475a01c05a4e162592a5a6e3a48032"
] | [
"statsmodels/tsa/vector_ar/tests/example_svar.py"
] | [
"import numpy as np\nimport statsmodels.api as sm\nimport pandas as pd\n\nmdatagen = sm.datasets.macrodata.load().data\nmdata = mdatagen[['realgdp','realcons','realinv']]\nnames = mdata.dtype.names\nstart = pd.datetime(1959, 3, 31)\nend = pd.datetime(2009, 9, 30)\n#qtr = pd.DatetimeIndex(start=start, end=end, freq=... | [
[
"pandas.DatetimeIndex",
"pandas.datetime",
"pandas.DataFrame",
"numpy.asarray",
"numpy.log"
]
] |
JiuShiNewBee/mypyfesom2 | [
"d84adad116888f83b89813e1a86ce8a233171138"
] | [
"pyfesom2/fesom_plot_tools.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# This file is part of pyfesom2\n# Original code by Dmitry Sidorenko, 2013\n#\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ntry:\n from mpl_toolkits.basemap import Basemap\nexcept KeyError:\n # dirty hack to avoid KeyError: 'PROJ_LIB' problem with basemap\n import c... | [
[
"numpy.copy",
"numpy.meshgrid",
"matplotlib.pyplot.tricontourf",
"numpy.ma.masked_where",
"matplotlib.pyplot.gca",
"numpy.abs",
"matplotlib.pyplot.tripcolor",
"matplotlib.pyplot.get_cmap",
"numpy.isnan",
"numpy.linspace",
"numpy.ma.masked_equal",
"matplotlib.pyplot.... |
googleinterns/gail-dyn | [
"31c93b12d068dede0dbe69547f0b2e500374f260"
] | [
"third_party/a2c_ppo_acktr/baselines/results_plotter.py"
] | [
"# The MIT License\n#\n# Copyright (c) 2017 OpenAI (http://openai.com)\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 Software without restriction, including without limitation the r... | [
[
"numpy.cumsum",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.title",
"numpy.lib.stride_tricks.as_strided",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"ma... |
vishalbelsare/PySyft | [
"6b2cb4ca3a54e8bb2e61d549bf7773aa955d7468"
] | [
"packages/syft/tests/syft/core/pointer/garbage_collection/gc_strategies_test.py"
] | [
"# third party\nimport torch\n\n# syft absolute\nimport syft as sy\nfrom syft.core.pointer.garbage_collection import GCBatched\nfrom syft.core.pointer.garbage_collection import GCSimple\nfrom syft.core.pointer.garbage_collection import GarbageCollection\nfrom syft.core.pointer.garbage_collection import gc_get_defau... | [
[
"torch.tensor"
]
] |
millernj/phys202-project | [
"51c56d4bd849a717081c6d686e5abbba225d4334"
] | [
"core.py"
] | [
"import numpy as np\n\nsigmoid = lambda x: 1/(1 +np.exp(-x))\n\ndef perceptron_sigmoid(weights, inputvect):\n return sigmoid(np.dot(np.append(inputvect,[1]), weights))\n\ndef gen_network(size):\n weights= [np.array([[np.random.randn() for _ in range(size[n-1]+1)]\n for _ in range(size[n])]) for ... | [
[
"numpy.random.shuffle",
"numpy.append",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.randn",
"numpy.exp",
"numpy.array",
"numpy.linspace"
]
] |
cshreyastech/deep-reinforcement-learning | [
"f2c9a45c76afa65083eed6994785fd1c3e04b1ec"
] | [
"p1_navigation/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass QNetwork(nn.Module):\n \"\"\"Actor (Policy) Model.\"\"\"\n\n def __init__(self, state_size, action_size, seed, fc1_units=64, fc2_units=64):\n \"\"\"Initialize parameters and build model.\n Params\n ======\n ... | [
[
"torch.manual_seed",
"torch.nn.Linear"
]
] |
mkeshita/grove | [
"dc6bf6ec63e8c435fe52b1e00f707d5ce4cdb9b3"
] | [
"grove/tests/jordan_gradient/test_jordan_gradient.py"
] | [
"import numpy as np\nfrom unittest.mock import patch\nfrom pyquil import Program\nfrom pyquil.gates import H, CPHASE, SWAP, MEASURE\n\nfrom grove.alpha.phaseestimation.phase_estimation import controlled\nfrom grove.alpha.jordan_gradient.jordan_gradient import gradient_program, estimate_gradient\n\n\ndef test_gradie... | [
[
"numpy.array",
"numpy.dot",
"numpy.isclose"
]
] |
bioexcel/biobb_ml | [
"f99346ef7885d3a62de47dab738a01db4b27467a"
] | [
"biobb_ml/classification/classification_predict.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"Module containing the ClassificationPredict class and the command line interface.\"\"\"\nimport argparse\nimport pandas as pd\nimport joblib\nfrom biobb_common.generic.biobb_object import BiobbObject\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn import linear_model... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
YuXie96/time | [
"8539d55d2449c712f54331b06720ab7faf3593df"
] | [
"evaluate.py"
] | [
"import torch\nfrom utils.data_util import char_list\nfrom utils.train_util import data_init, model_init\n\n\ndef eval_total_acc(config):\n # initialize data loaders\n test_loader = data_init(mode='test', use_velocity=config.use_velocity,\n t_scale=config.t_scale, batch_s=config.bat... | [
[
"torch.no_grad"
]
] |
nuannuanhcc/mmdetection | [
"26162d7fd49d2b87ead2bf5d9d8fbabd2b8933bb"
] | [
"mmdet/apis/runner/base_runner.py"
] | [
"# Copyright (c) Open-MMLab. All rights reserved.\nimport logging\nimport os.path as osp\nimport warnings\nfrom abc import ABCMeta, abstractmethod\n\nimport torch\nfrom torch.optim import Optimizer\n\nimport mmcv\nfrom mmcv.parallel import is_module_wrapper\nfrom .checkpoint import load_checkpoint\nfrom .dist_utils... | [
[
"torch.cuda.is_available",
"torch.cuda.current_device"
]
] |
ZJULearning/SRDet | [
"12d9302fad742f64ca3c8e05cd601d7dca1bf81e"
] | [
"mmdet3d/ops/furthest_point_sample/points_sampler.py"
] | [
"import torch\nfrom mmcv.runner import force_fp32\nfrom torch import nn as nn\nfrom typing import List\n\nfrom .furthest_point_sample import (furthest_point_sample,\n furthest_point_sample_with_dist)\nfrom .utils import calc_square_dist\n\n\ndef get_sampler_type(sampler_type):\n ... | [
[
"torch.stack",
"torch.nn.ModuleList",
"torch.cat",
"torch.randperm"
]
] |
mdebony/gammapy | [
"015206d2418b1d254f1c9d3ea819ab0c5ece99e9"
] | [
"gammapy/datasets/io.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport abc\nfrom pathlib import Path\nimport numpy as np\nfrom astropy import units as u\nfrom astropy.io import fits\nfrom astropy.table import Table\nfrom gammapy.data import GTI\nfrom gammapy.utils.scripts import make_path\nfrom gammapy.maps impor... | [
[
"numpy.logical_not",
"numpy.ones"
]
] |
QUANHAO-NCU/pytorch-visual-block | [
"f024541add5581026343aaaaeaf27d8415f3d4fe"
] | [
"Working/oc-cnn-master-Q/src/main/getAUC.py"
] | [
"import numpy as np\nimport h5py\n\nfrom sklearn import metrics\nfrom sklearn.metrics import accuracy_score\nfrom sklearn import svm\n\n# path variables\nscore_path = '../../temp_files/scores.mat'\nlabel_path = '../../temp_files/labels.mat'\n\nwith h5py.File(score_path, 'r') as f:\n test_features = f['scores'][(... | [
[
"sklearn.metrics.auc",
"numpy.transpose"
]
] |
SaitejaUtpala/geomstats | [
"5d4e16b3f30a86aab4725142f2263d8f10a30508"
] | [
"geomstats/geometry/hypersphere.py"
] | [
"\"\"\"The n-dimensional hypersphere.\n\nThe n-dimensional hypersphere embedded in (n+1)-dimensional\nEuclidean space.\n\"\"\"\n\nimport logging\nimport math\nfrom itertools import product\n\nfrom scipy.stats import beta\n\nimport geomstats.algebra_utils as utils\nimport geomstats.backend as gs\nfrom geomstats.geom... | [
[
"scipy.stats.beta.rvs"
]
] |
ankitshah009/Object_Detection_Tracking | [
"90b0d5a04f87155c2a84b0d51ecb009f757ebf85"
] | [
"obj_detect_tracking.py"
] | [
"# coding=utf-8\n# run script\n\nimport sys, os, argparse\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # so here won't have poll allocator info\n\n# remove all the annoying warnings from tf v1.10 to v1.13\nimport logging\nlogging.getLogger('tensorflow').disabled = True\n\nfrom tqdm import tqdm\nimport numpy as np\nimp... | [
[
"numpy.load",
"numpy.save",
"numpy.ceil",
"tensorflow.global_variables_initializer",
"tensorflow.train.get_checkpoint_state",
"numpy.asarray",
"tensorflow.global_variables",
"numpy.log",
"tensorflow.train.Saver",
"tensorflow.Session",
"numpy.array",
"tensorflow.Conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.