repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
davidesala/af2_conformations | [
"212781996d00869b0f31237a9b6cf9aba77e5185"
] | [
"scripts/predict.py"
] | [
"from . import util\nimport os\nimport numpy as np\nimport random\nimport sys\n\nfrom alphafold.common import protein\nfrom alphafold.model import data\nfrom alphafold.model import config\nfrom alphafold.model import model\n\nfrom typing import List, NoReturn\n\nfrom absl import logging\n\ndef set_config(\n use_... | [
[
"numpy.where"
]
] |
brekkanegg/birdclef-2021 | [
"2674b60328372ec35e5deac7677eae347f827a04"
] | [
"racoon/inputs/data2.py"
] | [
"import numpy as np\nimport pandas as pd\nimport soundfile as sf\nfrom pathlib import Path\nimport librosa\n\nfrom audiomentations import *\n\nimport torch.utils.data as torchdata\n\nfrom config import CFG\n\nimport time\n\n\nclass WaveformDataset(torchdata.Dataset):\n def __init__(\n self,\n df: p... | [
[
"numpy.random.random"
]
] |
pystockhub/pykiwoom | [
"1f51ad208e15c33b87a7652d595801e8113078e7"
] | [
"pykiwoom/wrapper/__init__.py"
] | [
"import sys\nimport time\nimport pandas as pd\nfrom datetime import datetime\nfrom PyQt5.QtWidgets import *\n\napp = QApplication(sys.argv)\n\nclass KiwoomWrapper:\n def __init__(self, kiwoom):\n self.kiwoom = kiwoom\n\n def get_daily_data(self, code, start='20000101', end='20161218', req_count=None):\... | [
[
"pandas.DataFrame"
]
] |
trentkyono/MIRACLE | [
"949d96736a7cfa51e9ea88cab56430633d25571a"
] | [
"tests/test_miracle.py"
] | [
"import sys\n\nimport networkx as nx\nimport numpy as np\nimport pytest\nimport tensorflow.compat.v1 as tf\nfrom sklearn.preprocessing import StandardScaler\nfrom utils import binary_sampler, enable_reproducible_results, gen_data_nonlinear\n\nimport miracle.logger as log\nfrom miracle import MIRACLE\nfrom miracle.t... | [
[
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.set_printoptions",
"numpy.isnan",
"sklearn.preprocessing.StandardScaler"
]
] |
ericmjl/flu-sequence-predictor | [
"33eab076222e3c5c0e0d886da8d69ad2e61eb0ef"
] | [
"custom.py"
] | [
"from collections import Counter\nfrom copy import deepcopy\n\nimport numpy as np\nfrom sklearn.preprocessing import LabelBinarizer\n\nfrom keras.models import model_from_yaml\n\n\ndef right_pad(sequences):\n \"\"\"\n Pads sequences with extra \"*\" characters.\n \"\"\"\n padded_sequences = deepcopy(seq... | [
[
"numpy.percentile",
"sklearn.preprocessing.LabelBinarizer"
]
] |
W0n9/deepface | [
"7febcdcecc7c19afc8cbd8f455baf1006ffe0c22"
] | [
"video_face/recognize.py"
] | [
"import os\nfrom tqdm import tqdm\nimport pickle\nimport numpy as np\nimport pandas as pd\nimport cv2\nimport os\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\nfrom deepface.commons import functions, realtime, distance as dst\n\n\ndef face_recognize(faces, db_embeddings, model, model_name, distance_metric):\... | [
[
"numpy.max",
"numpy.argmax",
"numpy.transpose"
]
] |
amitkumarj441/TGS_Kaggle | [
"a4f613046cc36f3f6dbec28adb35f97a63c2a994"
] | [
"transforms.py"
] | [
"import cv2\nimport numpy as np\nfrom scipy.ndimage.filters import gaussian_filter\nfrom scipy.ndimage.interpolation import map_coordinates\n\n\ndef upsample(image, image_size_target):\n padding0 = (image_size_target - image.shape[0]) / 2\n padding1 = (image_size_target - image.shape[1]) / 2\n padding_star... | [
[
"numpy.concatenate",
"numpy.zeros_like",
"numpy.array",
"numpy.ceil",
"numpy.random.rand",
"numpy.random.choice",
"numpy.random.RandomState",
"numpy.reshape",
"scipy.ndimage.interpolation.map_coordinates",
"numpy.float32",
"numpy.fliplr",
"numpy.random.randint",
... |
ayoub-root/ginga | [
"51eb46607c001494443e0eb2bded77a07795672e"
] | [
"ginga/rv/plugins/Mosaic.py"
] | [
"# This is open-source software licensed under a BSD license.\n# Please see the file LICENSE.txt for details.\n\"\"\"\nPlugin to create image mosaic.\n\n**Plugin Type: Local**\n\n``Mosaic`` is a local plugin, which means it is associated with a\nchannel. An instance can be opened for each channel.\n\n**Usage**\n\n... | [
[
"numpy.sign",
"numpy.isscalar"
]
] |
yanqi1811/Gibson | [
"a1b07adf89e8a15304f9f94cc7c414ee412fe3af"
] | [
"gibson/envs/mobile_robots_env.py"
] | [
"from gibson.envs.env_modalities import CameraRobotEnv, BaseRobotEnv\nfrom gibson.envs.env_bases import *\nfrom gibson.core.physics.robot_locomotors import Turtlebot, JR, JR2\nfrom transforms3d import quaternions\nimport os\nimport numpy as np\nimport sys\nimport pybullet as p\nfrom gibson.core.physics.scene_stadiu... | [
[
"numpy.square",
"numpy.array",
"numpy.abs",
"numpy.mean"
]
] |
cvai-repo/eccentricity | [
"b8a4570635320aad4e6e48712104b56cf3f67291"
] | [
"src/python/ecc/ecc_train.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nTrain the eccentricity model\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom datetime import datetime\nimport os.path\nimport time\n\nimport numpy as np\nnp.random.seed(seed=1)\n\nfrom six.moves import x... | [
[
"tensorflow.train.start_queue_runners",
"numpy.isnan",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.initialize_all_variables",
"tensorflow.train.Coordinator",
"numpy.random.seed",
"tensorflow.Graph",
"tensorflow.Variable",
"tensorflow.app.flags.DEFINE_boolean",
"tenso... |
shenkev/Exact-Inference-VAE-Robustness | [
"37438df2d63b2de19b084153e6c68d528d533837",
"37438df2d63b2de19b084153e6c68d528d533837"
] | [
"Jernej Kos-v1/experiments/attacks/optimization.py",
"Jernej Kos/experiments/ensemble.py"
] | [
"import tqdm\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\n\nfrom .. import attack\n\n\nclass Attack(attack.AttackBase):\n \"\"\"Optimization-based attack.\"\"\"\n name = 'optimization'\n\n def __init__(self, *args, **kwargs):\n super(Attack, self).__init__(*a... | [
[
"numpy.concatenate",
"tensorflow.constant_initializer",
"tensorflow.train.AdamOptimizer",
"tensorflow.matmul",
"tensorflow.nn.l2_loss",
"tensorflow.reshape",
"tensorflow.nn.tanh",
"tensorflow.one_hot",
"tensorflow.reduce_mean",
"tensorflow.contrib.slim.get_variables",
"... |
Smallflyfly/Pytorch_Retinaface | [
"bdb0ad2cb1f4529628c3f35a81e95777088fccd2"
] | [
"tensorRT_demo.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 20-7-4 下午2:42\n# @Author : smallflyfly\n# @FileName: tensorRT_demo.py\nimport time\n\nimport cv2\n\nimport torch\nfrom torch.backends import cudnn\nfrom torch2trt import torch2trt\n\nfrom data import cfg_mnet\nfrom models.retinaface import RetinaFace\nfrom utils.net_utils imp... | [
[
"torch.cuda.is_available",
"torch.set_grad_enabled"
]
] |
hmtrii/mmdetection | [
"a998e0ac45118482b4a1fa320c2f0611f35fb0d1",
"a998e0ac45118482b4a1fa320c2f0611f35fb0d1",
"a998e0ac45118482b4a1fa320c2f0611f35fb0d1"
] | [
"mmdet/core/anchor/point_generator.py",
"mmdet/models/losses/gfocal_loss.py",
"mmdet/models/dense_heads/cascade_rpn_head.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\r\nimport numpy as np\r\nimport torch\r\nfrom torch.nn.modules.utils import _pair\r\n\r\nfrom .builder import PRIOR_GENERATORS\r\n\r\n\r\n@PRIOR_GENERATORS.register_module()\r\nclass PointGenerator:\r\n\r\n def _meshgrid(self, x, y, row_major=True):\r\n xx ... | [
[
"torch.zeros",
"numpy.ceil",
"torch.nn.modules.utils._pair",
"torch.stack",
"torch.arange"
],
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nn.functional.cross_entropy"
],
[
"torch.cat",
"torch.stack",
"torch.arange",
"torch.onnx.is_in_onnx_ex... |
itongs/Historic_Work | [
"07678b2b3a84dcf4013187ffae8d69afb7b14fa4"
] | [
"FIT3139-Assn-1/q3/q3a_script.py"
] | [
"\"\"\"\r\nAssignment 1 Question 3 Part A script\r\n\r\n@author Ian Tongs, 27765369\r\n@since 26 April 2020\r\n\"\"\"\r\n\r\n# Imports:\r\n\r\nfrom scipy.integrate import odeint\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport math\r\n\r\n\r\n# Functions:\r\n\r\n\r\nbeta = 0.002\r... | [
[
"scipy.integrate.odeint",
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
amitmse/statsmodels | [
"c09c1b871ddb50378ff8c54405e2117c13e64a85"
] | [
"statsmodels/duration/tests/test_survfunc.py"
] | [
"import numpy as np\nfrom statsmodels.duration.survfunc import SurvfuncRight, survdiff, plot_survfunc\nfrom numpy.testing import assert_allclose\nfrom numpy.testing import dec\nimport pandas as pd\nimport os\n\n# If true, the output is written to a multi-page pdf file.\npdf_output = False\n\ntry:\n import matplo... | [
[
"numpy.concatenate",
"numpy.testing.assert_allclose",
"matplotlib.pyplot.xlim",
"numpy.testing.dec.skipif",
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.fill_between",
"numpy.arange",
"pandas.read_csv"
... |
googleinterns/wild-nerf | [
"a11ca4df70618117f267341fd065632bd1754511"
] | [
"jaxnerf/train.py"
] | [
"# Lint as: python3\n\"\"\"Training script for Nerf.\"\"\"\n\nimport functools\nimport gc\nimport time\nimport copy\nfrom absl import app\nfrom absl import flags\nfrom absl import logging\nfrom absl.logging import INFO\nimport flax\nfrom flax.metrics import tensorboard\nfrom flax.training import checkpoints\nimport... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros_like",
"numpy.set_printoptions",
"numpy.log10"
]
] |
nsfzyzz/boundary_thickness | [
"f47701b882a52f18cfa8614dac03fc58db1b2d87"
] | [
"visualize_thickness_measurement_experiment.py"
] | [
"import os\nfrom os import listdir\nfrom os.path import isfile, join\nimport torch\nimport pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nplt.style.use('ggplot')\n\ndef draw_once(thickness_adv_hist, mode='processed', ylim = [0, 1]):\n fig, axs = plt.subplots(1, 5, figsize=(25,5))\n\n markers =... | [
[
"matplotlib.pyplot.savefig",
"numpy.mean",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.use"
]
] |
PhysicsTeacher13/CHAINER | [
"64018f7c6956c8ea42220e2e4bd55f7ff30df097"
] | [
"chainer/optimizers/rmsprop_graves.py"
] | [
"import numpy\n\nfrom chainer import cuda\nfrom chainer import optimizer\n\n\nclass RMSpropGraves(optimizer.GradientMethod):\n\n \"\"\"Alex Graves's RMSprop.\n\n See http://arxiv.org/abs/1308.0850\n\n \"\"\"\n\n def __init__(self, lr=1e-4, alpha=0.95, momentum=0.9, eps=1e-4):\n # Default paramete... | [
[
"numpy.sqrt"
]
] |
PyVCEchecker/LightGBM | [
"e0c68e3cd47004b1fc9a20eb5ae4b12c5e00987f"
] | [
"examples/python-guide/simple_example.py"
] | [
"# coding: utf-8\nfrom pathlib import Path\n\nimport pandas as pd\nfrom sklearn.metrics import mean_squared_error\n\nimport lightgbm as lgb\n\nprint('Loading data...')\n# load or create your dataset\nregression_example_dir = Path(__file__).absolute().parents[1] / 'regression'\ndf_train = pd.read_csv(str(regression_... | [
[
"sklearn.metrics.mean_squared_error"
]
] |
ImagiaViz/inviwo | [
"69cca9b6ecd58037bda0ed9e6f53d02f189f19a7"
] | [
"tests/volumes/testdata-generate.py"
] | [
"import numpy as np # requiers version 1.12+\nimport os\nimport math\n\ndat = \"\"\"RawFile: {file}\nResolution: {x} {y} {z}\nFormat: {format}\nByteOrder: {byteorder}\n\"\"\"\n\nivf = \"\"\"<?xml version=\"1.0\" ?>\n<InviwoTreeData version=\"1.0\">\n <RawFile content=\"{file}\" />\n <Format content=\"{format... | [
[
"numpy.ndindex",
"numpy.zeros"
]
] |
xyang35/Disentangled-GAN | [
"7fb3e0ddc0881631e2e82073f3a514062e9b9a86"
] | [
"data/depth_dataset.py"
] | [
"import os.path\nimport torchvision.transforms as transforms\nfrom data.base_dataset import BaseDataset, get_transform\nfrom data.image_folder import make_dataset\nfrom PIL import Image\nimport PIL\nfrom pdb import set_trace as st\nimport numpy as np\nimport random\n\n\nclass DepthDataset(BaseDataset):\n def ini... | [
[
"numpy.random.randint"
]
] |
CSCI4850/S18-team1-project | [
"7dbd418e3c197db309bb626f148aad9053628664"
] | [
"demo/DQN_Testing.py"
] | [
"# ## Project Demo\n# Just run through these to watch breakout run! We handle processing the frame input and rewards. We then make the environment and model then run the demo.\n\n\n# #### Imports as needed:\nfrom PIL import Image\nimport numpy as np\nimport gym\n\nfrom keras.models import Sequential\nfrom keras.lay... | [
[
"numpy.array",
"numpy.zeros"
]
] |
zhouyuegithub/medicaldetectiontoolkit | [
"283121228ab6012f3369c0a649c0e1aeae492283"
] | [
"plotting.py"
] | [
"#!/usr/bin/env python\n# Copyright 2018 Division of Medical Image Computing, German Cancer Research Center (DKFZ).\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://... | [
[
"numpy.random.choice",
"numpy.load",
"numpy.min",
"numpy.mean",
"numpy.concatenate",
"numpy.max",
"matplotlib.pyplot.savefig",
"numpy.arange",
"numpy.transpose",
"matplotlib.pyplot.yscale",
"numpy.expand_dims",
"matplotlib.pyplot.subplot",
"matplotlib.use",
... |
skang29/GANs | [
"83e3338bf3611aafbd75f0df1272276e3bc07d46"
] | [
"Pytorch/SNDCGAN/metrics/fid_score.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Calculates the Frechet Inception Distance (FID) to evalulate GANs\n\nThe FID metric calculates the distance between two distributions of images.\nTypically, we have summary statistics (mean & covariance matrix) of one\nof these distributions, while the 2nd distribution is given by a G... | [
[
"numpy.concatenate",
"numpy.empty",
"numpy.trace",
"numpy.cov",
"numpy.load",
"torch.nn.functional.adaptive_avg_pool2d",
"numpy.mean",
"torch.cuda.device_count",
"numpy.eye",
"torch.from_numpy",
"numpy.diagonal",
"numpy.iscomplexobj",
"numpy.atleast_1d",
"to... |
DimaZzZz101/Optimization_Methods | [
"bb5cf122e643fd69c5f117554d9bbeff0a3266d8"
] | [
"lab6/main.py"
] | [
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom tabulate import tabulate\nimport functions as fn\nimport numpy as np\n\n\n# Функция формирования таблицы.\ndef create_table_final(_data):\n pd.set_option('display.width', None)\n table = pd.DataFrame(data=_data)\n print(tabulate(table, tablefmt='p... | [
[
"numpy.sin",
"matplotlib.pyplot.xscale",
"pandas.set_option",
"matplotlib.pyplot.xlabel",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.scatt... |
smasoka/codex-africanus | [
"3763696e23550abf45630468026eb99232c31767"
] | [
"africanus/model/spi/component_spi.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nimport numpy as np\n\nfrom africanus.util.docs import DocstringTemplate\nfrom africanus.util.numba import jit\n\n\n@jit(nopython=True, nogil=True, cache=True)\ndef _fit_spi_components_impl(data, weights, freqs, freq0, out,\n jac, ncomp... | [
[
"numpy.log",
"numpy.abs",
"numpy.ones",
"numpy.zeros"
]
] |
bruce1408/detectron2_modify | [
"be0d7283297f6314c8e683e0d1ff80b668aa9f4a",
"815df8c3cd68b1450e039fbafc27c6ab302d620b"
] | [
"tests/structures/test_instances.py",
"detectron2/data/detection_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport unittest\nimport torch\n\nfrom detectron2.structures import Instances\n\n\nclass TestInstancesIndexing(unittest.TestCase):\n def test_int_indexing(self):\n attr1 = torch.tensor([[0.0, 0.0, 1.0], [0.0, 0.0, 0.5], [0.0, 0.0, 1.0... | [
[
"torch.tensor"
],
[
"numpy.ceil",
"numpy.array",
"numpy.asarray",
"numpy.ascontiguousarray",
"numpy.random.randint",
"torch.tensor",
"numpy.expand_dims",
"numpy.floor"
]
] |
thalvari/ray | [
"24ee496b8959f48cd4e5829700b9fc089b12ea12"
] | [
"python/ray/tests/test_metrics.py"
] | [
"import os\nimport json\nimport grpc\nimport pytest\nimport requests\nimport time\nimport numpy as np\n\nimport ray\nfrom ray.core.generated import node_manager_pb2\nfrom ray.core.generated import node_manager_pb2_grpc\nfrom ray.core.generated import reporter_pb2\nfrom ray.core.generated import reporter_pb2_grpc\nf... | [
[
"numpy.zeros"
]
] |
ecs-vlc/opponency | [
"f2eae25818be6c9c6e6541802b04b6c5e56112a2",
"f2eae25818be6c9c6e6541802b04b6c5e56112a2"
] | [
"statistics/gratings.py",
"statistics/runner.py"
] | [
"import torch\nfrom torchvision import transforms\nimport psychopy.visual\nimport psychopy.event\n\n\ndef make_grating(freq, theta, phase, sz=32, grating=None, win=None):\n was_none = False\n if win is None:\n was_none = True\n win = psychopy.visual.Window(\n size=(sz, sz),\n ... | [
[
"torch.is_tensor",
"torch.ones",
"torch.linspace",
"torch.zeros"
],
[
"torch.load",
"pandas.concat"
]
] |
frillecode/CDS-spring-2021-visual | [
"e4bac31a97ff109073d121e1a8a05c23b3f354cf"
] | [
"src/assignment4/lr-mnist.py"
] | [
"#!/usr/bin/python\n\n# Import necessary libraries/modules\nimport os\nimport sys\nsys.path.append(os.path.join(\"..\", \"..\"))\nimport argparse\nimport numpy as np\nfrom sklearn import metrics\nfrom sklearn import datasets\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import Log... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LogisticRegression",
"sklearn.metrics.classification_report",
"sklearn.datasets.load_digits"
]
] |
preetkhaturia/Udacity_Behavior_Cloning | [
"17b11d53da9b0c0472c32983af656c0443442027"
] | [
"model2.py"
] | [
"import csv\nimport cv2\nimport sklearn\nimport numpy as np\nimport matplotlib.image as mpimg\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation, Lambda, Convolution2D, MaxPooling2D\nfrom sklearn.model_selection import train_test_split\n\npath ='/home/workspace/CarND-Behavioral-Cloning... | [
[
"sklearn.model_selection.train_test_split",
"numpy.array",
"sklearn.utils.shuffle"
]
] |
sharadmv/kmeans-representations | [
"9ee1d7d2e164deb8369a50b757983c76dc53af11"
] | [
"plot.py"
] | [
"import matplotlib.pyplot as plt\nimport seaborn as sns\nfrom argparse import ArgumentParser\nfrom itertools import cycle\n\ndef parse_args():\n argparser = ArgumentParser()\n argparser.add_argument('file')\n return argparser.parse_args()\n\nif __name__ == \"__main__\":\n args = parse_args()\n experi... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
best08618/tensorflow | [
"44245e23aa014380a70b51b3c2371ec77f140f71"
] | [
"tensorflow/examples/tutorials/word2vec/word2vec_basic.py"
] | [
"# Copyright 2015 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... | [
[
"matplotlib.pyplot.annotate",
"numpy.random.choice",
"tensorflow.matmul",
"tensorflow.contrib.tensorboard.plugins.projector.ProjectorConfig",
"tensorflow.nn.embedding_lookup",
"tensorflow.global_variables_initializer",
"tensorflow.nn.nce_loss",
"tensorflow.train.GradientDescentOpti... |
wchen459/airfoil-opt-gan | [
"34be0dd5c8bce6c714f806e6ee8a575e29a95cb7"
] | [
"manifold_evaluation/consistency.py"
] | [
"\"\"\"\nEstimates likelihood of generated data using kernel density estimation \n\nAuthor(s): Wei Chen (wchen459@umd.edu)\n\"\"\"\n\nimport numpy as np\nfrom utils import mean_err\n\ndef sample_line(d, m, bounds):\n # Sample m points along a line parallel to a d-dimensional space's basis\n basis = np.random.... | [
[
"numpy.linalg.norm",
"numpy.random.choice",
"numpy.random.rand",
"numpy.zeros",
"numpy.corrcoef",
"numpy.linspace"
]
] |
GustavHenning/DeepLearning18 | [
"9489208a41822a41ff87af19dac9f06ad30ac3ea"
] | [
"lab3/main.py"
] | [
"import matplotlib\nmatplotlib.use('Agg')\nimport itertools\nimport pickle\nimport scipy\nimport sys\n\nimport pandas as pd\nfrom pandas import DataFrame as df\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom net import Net\n\nfrom tqdm import tqdm\nfrom sklearn import preprocessing\nfrom laplotter import... | [
[
"numpy.random.choice",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks",
"numpy.divide",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"sklearn.preprocessing.LabelBinarizer",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.use... |
Swall0w/cougar | [
"9161b2b1d0c256f4bb952ec190351684f28ec1b7"
] | [
"tests/graphs/module/test_l2norm.py"
] | [
"from cougar.graphs.modules import L2Norm\nimport torch\n\n\ndef test_L2Norm():\n input = torch.randn(1, 512, 38, 38)\n m = L2Norm(n_channels=512, scale=20)\n out = m(input)\n assert out.shape == input.shape\n"
] | [
[
"torch.randn"
]
] |
zerostarm/Physics-2.0 | [
"731f1f4aba014bef7ae44279de5fb85fc404dbfe"
] | [
"src/core/Body.py"
] | [
"from .constants import *\nfrom numpy import random\nimport cmath\n\n\nclass Body:\n def __init__(self, mass, position, velocity, density=Density, color=None, name=None, charge=None):\n self.mass = mass \n self.mass0 = mass\n self.density = density\n self.radius = int((mass / density)... | [
[
"numpy.random.randint"
]
] |
bibek22/einsteinpy | [
"78bf5d942cbb12393852f8e4d7a8426f1ffe6f23"
] | [
"tests/test_symbolic/test_einstein.py"
] | [
"import numpy as np\nimport pytest\nimport sympy\nfrom sympy import cos, cosh, simplify, sin, sinh, symbols, tensorcontraction\n\nfrom einsteinpy.symbolic import (\n EinsteinTensor,\n MetricTensor,\n RicciScalar,\n simplify_sympy_array,\n)\n\n\ndef schwarzschild_metric():\n symbolstr = \"t r theta ph... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
DeNeutoy/flowseq | [
"8cb4ae00c26fbeb3e1459e3b3b90e7e9a84c3d2b"
] | [
"experiments/slurm.py"
] | [
"import sys\nimport os\n\ncurrent_path = os.path.dirname(os.path.realpath(__file__))\nroot_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))\nsys.path.append(root_path)\n\nimport torch.multiprocessing as mp\n\nimport experiments.options as options\nfrom experiments.nmt import main as single_proces... | [
[
"torch.multiprocessing.set_start_method"
]
] |
ak47mrj/arkouda | [
"a9167e674aff57e02e1bed49fbb0c3cf1b2f2707"
] | [
"benchmarks/noop.py"
] | [
"#!/usr/bin/env python3\n\nimport time, argparse\nimport numpy as np\nimport arkouda as ak\nimport arkouda.client\n\ndef time_ak_noop(trial_time):\n print(\">>> arkouda noop\")\n start = time.time()\n trials = 0\n while time.time() - start < trial_time:\n trials += 1\n arkouda.client._no_o... | [
[
"numpy.get_include"
]
] |
imvladikon/string-embed | [
"49e5ab0ada37b497dac51974aff16eeac65627a0"
] | [
"distance_estimation_l2.py"
] | [
"import numpy as np\nfrom utils import l2_dist\nfrom nns import linear_fit, load_vec, get_args\n\n\n\nthreshold = 1000\n\nargs = get_args()\n\n# args.embed = 'gru'\n# xq_gru, xb_gru, xt_gru, train_dist, query_dist = load_vec(args)\n# query_dist = query_dist[:, :50000]\n# xb_gru = xb_gru[:50000, :]\n#\n# train_idx =... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.... |
meetbawankar/ga-learner-dsmp-repo | [
"807eac1f533527b6676f17887078373f03e69115"
] | [
"insurance-claim-prediction(logistic-regression)/code.py"
] | [
"# --------------\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom sklearn.model_selection import train_test_split\nimport warnings\nwarnings.filterwarnings('ignore')\n\n# Code starts here\ndf = pd.read_csv(path)\nprint(df.head(5))\nX = df.drop('insuranceclaim',axis=1)\ny = df['insuranceclaim']... | [
[
"sklearn.model_selection.GridSearchCV",
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.subplots",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.metrics.roc_auc_score",
"sklea... |
guialba/incubator-marvin | [
"f0edb74813d1e7ce6d4a8d1cff5ebd93defae0b0"
] | [
"public-engines/iris-h2o-automl/marvin_iris_h2o_automl/training/metrics_evaluator.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\n\n\"\"\"MetricsEvaluator engine action.\n\nUse this module to add the project main code.\n\"\"\"\n\nfrom .._compatibility import six\nfrom .._logging import get_logger\n\nfrom marvin_python_toolbox.engine_base import EngineBaseTraining\nfrom ..model_serializer import ModelSer... | [
[
"sklearn.metrics.accuracy_score"
]
] |
terryli710/CS229 | [
"c07be2953257bd54f99629a24ba59d6aa4a1d919"
] | [
"ps3/src/k_means/k_means.py"
] | [
"from __future__ import division, print_function\nimport argparse\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport random\n\n\ndef init_centroids(num_clusters, image):\n \"\"\"\n Initialize a `num_clusters` x image_shape[-1] nparray to RGB\n values o... | [
[
"numpy.zeros",
"matplotlib.pyplot.savefig",
"numpy.sum",
"matplotlib.pyplot.title",
"matplotlib.image.imread",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.random.uniform",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.ims... |
giannislelekas/topdown | [
"c247b39dcc1a74f2a459346cf71fe36e45764baf"
] | [
"src/scripts/run_adversarial_attacks.py"
] | [
"import os\nimport re\n\nimport foolbox\nfrom foolbox.distances import Linf\nfrom foolbox.criteria import TargetClass\nimport numpy as np\n\nimport tensorflow as tf\nfrom sklearn.utils.multiclass import unique_labels\nfrom tensorflow.python.keras import backend as K\nfrom tensorflow.python.keras.models import load_... | [
[
"numpy.ones_like",
"numpy.load",
"numpy.mean",
"numpy.where",
"numpy.zeros_like",
"tensorflow.python.keras.models.load_model",
"numpy.arange",
"numpy.greater",
"numpy.logical_or",
"numpy.array",
"tensorflow.keras.datasets.mnist.load_data",
"sklearn.utils.multiclass.... |
khloe-zhang/libai | [
"1787a6d920b09d3aed8b04cecb84535612f388b8"
] | [
"libai/data/data_utils/reindexed_dataset.py"
] | [
"# coding=utf-8\n# Copyright 2021 The OneFlow 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... | [
[
"numpy.concatenate",
"numpy.sum",
"numpy.load",
"numpy.save"
]
] |
wooduk/deeptracktorch | [
"a026a7e35c6871ea1efa9d7de4b20b238e279d46"
] | [
"deeptracktorch/measures.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/03_Measures.ipynb (unless otherwise specified).\n\n__all__ = ['lsradialcenterfit', 'radialcenter']\n\n# Cell\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom numpy.matlib import repmat\nfrom PIL import Image\nfrom torch import Tensor\n\n# Cell\ndef lsradial... | [
[
"numpy.isinf",
"numpy.isnan",
"numpy.ones",
"numpy.seterr",
"numpy.arange",
"numpy.sqrt",
"scipy.signal.convolve2d"
]
] |
theo-dim/cash-gels-thesis | [
"de8c1b20f766aa1c58d8f692373c76683d165a66"
] | [
"sample_0000.py"
] | [
"print(__doc__)\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import datasets, linear_model\n\n# Load the sample dataset\nsample = datasets.load_diabetes()\nprint(sample)\n# Use only one feature\nsample_x = sample.data[:, np.newaxis, 2]\n\n# Split the data into training/testing sets\nsample_x... | [
[
"sklearn.linear_model.LinearRegression",
"sklearn.datasets.load_diabetes",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.xticks"
]
] |
neodev-ab/NeoGame | [
"f2c0c010b2ea13d99e23ecd2f59592433fbd2385"
] | [
"AI/pyneogame/Agent/QTableAgent.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom . import BaseAgent\n\n\nclass QTableAgent(BaseAgent.BaseAgent):\n\n def __init__(self,\n learning_rate=0.05,\n lr_decay=False,\n epsilon=0.9,\n decay_rate=1e-5,\n unexplored=0,\n ... | [
[
"numpy.random.choice",
"pandas.DataFrame.from_dict",
"numpy.exp",
"numpy.random.uniform",
"pandas.read_csv"
]
] |
ignatovmg/mhcflurry | [
"a4b0ac96ebe7f8be7e4b37f21c430f567ac630e6",
"a4b0ac96ebe7f8be7e4b37f21c430f567ac630e6"
] | [
"test/test_class1_neural_network.py",
"mhcflurry/encodable_sequences.py"
] | [
"import logging\nlogging.getLogger('tensorflow').disabled = True\nlogging.getLogger('matplotlib').disabled = True\n\nimport numpy\nfrom numpy import testing\nnumpy.random.seed(0)\nfrom tensorflow.random import set_seed\nset_seed(2)\n\nfrom nose.tools import eq_, assert_less, assert_greater, assert_almost_equal\n\ni... | [
[
"numpy.testing.assert_allclose",
"numpy.log",
"numpy.random.seed",
"pandas.DataFrame",
"tensorflow.random.set_seed",
"numpy.testing.assert_array_less",
"pandas.concat"
],
[
"pandas.DataFrame",
"numpy.array",
"pandas.Series"
]
] |
maxtnuk/incubator-tvm | [
"050a836b18c419213f34b8ac76afced425d9d70e"
] | [
"tests/python/frontend/mxnet/test_forward.py"
] | [
"# 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 you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.pad",
"numpy.array",
"numpy.asarray",
"numpy.random.uniform",
"numpy.random.randint"
]
] |
cc-a/devito | [
"24ede9131473f69c1e44ba3b852f8654d3fd953e"
] | [
"devito/finite_differences/tools.py"
] | [
"from functools import wraps, partial\nfrom itertools import product\n\nimport numpy as np\nfrom sympy import S\n\nfrom devito.tools import Tag, as_tuple\nfrom devito.finite_differences import Differentiable\n\n\nclass Transpose(Tag):\n \"\"\"\n Utility class to change the sign of a derivative. This is only n... | [
[
"numpy.max"
]
] |
tucan9389/mobile-pose-estimation-for-TF2 | [
"82a01359820c1797505a13bc663df49b717cc696"
] | [
"evaluate.py"
] | [
"# Copyright 2019 Doyoung Gwak (tucan.dev@gmail.com)\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... | [
[
"numpy.array",
"tensorflow.io.gfile.GFile",
"numpy.reshape",
"tensorflow.random.set_seed",
"tensorflow.lite.TFLiteConverter.from_saved_model",
"numpy.mean",
"numpy.argmax",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
zd-daniel/GANs-ZOO | [
"fe72391e1db46616f97d1dec62441a299aa9c636"
] | [
"ACGAN/train.py"
] | [
"# -*- coding: utf-8 -*-\r\n# @Time : 2021/5/5 0005 14:18\r\n# @Author : Daniel Zhang\r\n# @Email : zhangdan_nuaa@163.com\r\n# @File : train.py\r\n# @Software: PyCharm\r\n\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torchvision.utils import save_image\r\n\r\n\r\nlogit_criterion = nn.BCEWithLogitsL... | [
[
"torch.zeros",
"torch.ones_like",
"torch.nn.BCEWithLogitsLoss",
"torch.zeros_like",
"torch.nn.CrossEntropyLoss"
]
] |
donbreum/AI4-Object-Recognition | [
"e4fced35bdd508f1be9aea0712a399c71a13f9a5"
] | [
"object_recognition/training_images/draw_boxes_for_training.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport scandir\nimport matplotlib.pyplot as plt\nimport cv2\nfrom matplotlib.widgets import RectangleSelector\nfrom generate_xml import write_xml\n\n# global constants\nimg = None\ntl_list = []\nbr_list = []\nobject_list = []\n\n# constants\nimage_folder = 'temp_images'\nsavedir... | [
[
"matplotlib.widgets.RectangleSelector",
"matplotlib.pyplot.get_current_fig_manager",
"matplotlib.pyplot.connect",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
]
] |
jmoldon/verification_sdc2 | [
"16f61d62b1cfc8c3cd52317ec1a3f20bd39e5244"
] | [
"scripts/analysis.py"
] | [
"import os\nimport sys\nimport shutil\nimport re\nfrom datetime import datetime\nimport numpy as np\nimport pandas as pd\n#import matplotlib.pyplot as plt\nimport yaml\nfrom astropy.io import fits\nfrom astropy.wcs import WCS\nfrom shutil import which\n\n\nset_type ='evaluation'\n#set_type ='development_small'\n#se... | [
[
"numpy.log",
"pandas.DataFrame",
"numpy.mean",
"numpy.arctan2",
"numpy.sqrt",
"pandas.read_csv"
]
] |
thimper/PySudouStock | [
"afa1c8cffd1632e944f4da5ab77288b49140327b"
] | [
"doublePrice.py"
] | [
"# -*- coding: utf-8 -*-\n \nimport os\nimport sys\nimport pickle\nimport math\nimport datetime\nimport matplotlib\n \nmatplotlib.use(\"WXAgg\", warn=True) # 这个要紧跟在 import matplotlib 之后,而且必须安装了 wxpython 2.8 才行。\n \nimport matplotlib.pyplot as pyplot\nimport matplotlib.font_manager as font_manager \n \nimport numpy... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.font_manager.FontProperties",
"matplotlib.ticker.MultipleLocator",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.ticker.NullFormatter",
"matplotlib.ticker.FuncFormatter"
]
] |
baoqianyue/DFC2021-Track-MSD | [
"d707f7601c6caa0d0f0e6013d493e66059d23d49"
] | [
"models.py"
] | [
"import functools\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport segmentation_models_pytorch as smp\n\nimport utils\n\n\nclass FCN(nn.Module):\n\n def __init__(self, num_input_channels, num_output_classes, num_filters=64):\n super(FCN, self).__init_... | [
[
"torch.nn.Conv2d"
]
] |
Sumanmhalsank02/Correlation-in-Stock-Market | [
"24660aca10d099043e7e3be47b801446c8f64d0e"
] | [
"Correlation1.py"
] | [
"import pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\n\r\n# Load Stocks in to different dataframes\r\ndata1 = pd.read_csv(r'C:\\Users\\TATAPOWER.csv')\r\ndata2 = pd.read_csv(r'C:\\Users\\VOLTAS.csv')\r\ndata3 = pd.read_csv(r'C:\\Users\\APOLLOTYRE.csv')\r\ndata4 = pd.read_csv(r'C:\\User... | [
[
"matplotlib.pyplot.show",
"pandas.read_csv",
"pandas.concat"
]
] |
ChihHsuLin/cellular_image_classification | [
"5ea81b4a0f42d17ecb95c41ff4349ef610841394"
] | [
"src/models/print_log.py"
] | [
"import argparse\nimport glob\nimport numpy as np\nimport os\n\nimport torch\n\nimport constants as c\n\n\ndef get_best_epoch_cell(ckpt_path, cell_type):\n model_ckpt = torch.load(ckpt_path)\n loss_history = model_ckpt['loss']\n acc_history = model_ckpt['acc']\n pp_acc_history = model_ckpt['pp_acc']\n ... | [
[
"torch.load"
]
] |
Jin-Xi/TS-Forecasting | [
"4c00d7c5da527f46b82d225c9328aef88525ae9d"
] | [
"model/N_Beats.py"
] | [
"import pickle\nimport random\nfrom time import time\nfrom typing import Union\n\nimport numpy as np\nimport torch\nfrom torch import nn, optim\nfrom torch.nn import functional as F\nfrom torch.nn.functional import mse_loss, l1_loss, binary_cross_entropy, cross_entropy\nfrom torch.optim import Optimizer\n\ndevice =... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.ParameterList",
"numpy.sin",
"torch.save",
"torch.cuda.is_available",
"numpy.arange",
"torch.tensor",
"torch.load",
"numpy.cos",
"numpy.expand_dims",
"torch.randn",
"numpy.flip"
]
] |
JayLago/DLDMD | [
"756e48386ed1c339976bcbb574a9075ac51263ee"
] | [
"examples/pendulum/Train_Pendulum.py"
] | [
"\"\"\"\n Author:\n Jay Lago, NIWC/SDSU, 2021\n\"\"\"\nimport tensorflow as tf\nimport pickle\nimport datetime as dt\nimport os\nimport sys\nsys.path.insert(0, '../../')\nimport DLDMD as dl\nimport LossDLDMD as lf\nimport Data as dat\nimport Training as tr\n\n\n# ==========================================... | [
[
"tensorflow.keras.backend.set_floatx",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.constant",
"tensorflow.executing_eagerly",
"tensorflow.keras.backend.floatx",
"tensorflow.config.experimental.list_physical_devices",
... |
babaozhouy5/Neural_Language_Correction-chinese- | [
"64ac8bd387735d4066e7940b5b2594ff77c3dacb"
] | [
"util.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2016 Stanford University\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.array"
]
] |
sooftware/datasets | [
"9b532f2290a3bb20370082ad76e1d5475b91e795"
] | [
"src/datasets/arrow_dataset.py"
] | [
"# coding=utf-8\n# Copyright 2020 The HuggingFace 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... | [
[
"tensorflow.train.Int64List",
"tensorflow.train.Features",
"tensorflow.reshape",
"tensorflow.py_function",
"numpy.random.random",
"numpy.issubdtype",
"numpy.dtype",
"tensorflow.train.FloatList",
"tensorflow.shape",
"numpy.arange",
"tensorflow.data.experimental.TFRecordW... |
hoangvu01/deck.gl | [
"920a4d78096db7dd00e75c89bc0da53298e76978"
] | [
"bindings/pydeck/examples/icon_layer.py"
] | [
"\"\"\"\nIconLayer\n=========\n\nLocation of biergartens in Germany listed on OpenStreetMap as of early 2020.\n\"\"\"\n\nimport pydeck\nimport pandas as pd\n\n\n# Data from OpenStreetMap, accessed via osmpy\nDATA_URL = \"https://raw.githubusercontent.com/ajduberstein/geo_datasets/master/biergartens.json\"\nICON_URL... | [
[
"pandas.read_json"
]
] |
17Skye17/2nd-YouTube8M | [
"26b77c014485c8c9a94270d151eab1993394058f"
] | [
"Ensemble/Ensemble/video_level_models.py"
] | [
"# Copyright 2016 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 app... | [
[
"tensorflow.multiply",
"tensorflow.contrib.slim.l2_regularizer",
"tensorflow.flags.DEFINE_string",
"tensorflow.matrix_diag_part",
"tensorflow.sigmoid",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.flags.DEFINE_float",
"tensorflow.reduce_sum",
"tensorflow.flags.DEF... |
olgatsiouri1996/bioinfo_Gooey_scripts | [
"234a42e8367e8032bf1fb451716c7aa53e2f3e31"
] | [
"src/sequence_statistics/proteins/all_aas_content_multifasta_gui.py"
] | [
"# python3\nfrom gooey import *\nfrom Bio import SeqIO\nimport pandas as pd\n# input parameters\n@Gooey(required_cols=2, program_name='calculate all amino acids content from multi-fasta', header_bg_color= '#DCDCDC', terminal_font_color= '#DCDCDC', terminal_panel_color= '#DCDCDC')\ndef main():\n ap = GooeyParser(... | [
[
"pandas.DataFrame"
]
] |
adityabalu/DiffNet | [
"a21e024ad9948fa76fe73796e216a0a6601f2c7c"
] | [
"examples/eiqonal/single_instance/02_2d_curve_recon.py"
] | [
"import os\nimport sys\nimport json\nimport torch\nimport numpy as np\n\nimport scipy.io\nfrom scipy import ndimage\nimport matplotlib\nfrom skimage import io\n# matplotlib.use(\"pgf\")\nmatplotlib.rcParams.update({\n # 'font.family': 'serif',\n 'font.size':12,\n})\nfrom matplotlib import pyplot as plt\n\nimp... | [
[
"scipy.ndimage.convolve",
"numpy.array",
"numpy.ones_like",
"numpy.zeros_like",
"numpy.asarray",
"torch.FloatTensor",
"numpy.ones",
"numpy.random.randn",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"torch.nn.functional.mse_loss",
"matplotlib.rcParams.up... |
stroxler/la | [
"c6b3c7574c07c47c1d3edae151c76fa4f790d9bd",
"c6b3c7574c07c47c1d3edae151c76fa4f790d9bd"
] | [
"la/tests/all_nan_test.py",
"la/flarry.py"
] | [
"\"Test larry methods for proper handling of all NaN input\"\n\n# For support of python 2.5\nfrom __future__ import with_statement\n\nimport numpy as np\nfrom numpy.testing import assert_equal\n\nfrom la import larry, nan\nfrom la.util.testing import assert_larry_equal\n\n\ndef lar(): \n return larry([nan, na... | [
[
"numpy.errstate"
],
[
"numpy.product",
"numpy.empty",
"numpy.putmask",
"numpy.ones",
"numpy.arange",
"numpy.all",
"numpy.unique"
]
] |
jarvisqi/deep_learning | [
"988a5b0551ccf2c480a519c66aca149053826d30"
] | [
"dl_tensorLayer/tl_vgg16.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nVGG-16 for ImageNet.\n\nIntroduction\n----------------\nVGG is a convolutional neural network model proposed by K. Simonyan and A. Zisserman\nfrom the University of Oxford in the paper “Very Deep Convolutional Networks for\nLarge-Scale Image Recognition” . The model achieves 92.7%... | [
[
"numpy.load",
"scipy.misc.imresize",
"scipy.misc.imread",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.name_scope",
"numpy.argsort",
"tensorflow.nn.softmax",
"tensorflow.InteractiveSession"
]
] |
uwsampl/dtr-prototype | [
"eff53cc4804cc7d6246a6e5086861ce2b846f62b"
] | [
"checkmate_comp/experiments/common/load_keras_model.py"
] | [
"import re\nfrom typing import Optional, List\n\nimport keras_segmentation\nimport tensorflow as tf\n\nKERAS_APPLICATION_MODEL_NAMES = ['InceptionV3', 'VGG16', 'VGG19', 'ResNet50',\n 'Xception', 'MobileNet', 'MobileNetV2', 'DenseNet121',\n 'DenseNet169... | [
[
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Model",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.Input"
]
] |
carlospereiraf/PyFR | [
"5666fa5bc9013932c339ec766887f47023482f5b"
] | [
"pyfr/integrators/dual/pseudo/pseudosteppers.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom pkg_resources import resource_string\n\nimport numpy as np\n\nfrom pyfr.integrators.dual.pseudo.base import BaseDualPseudoIntegrator\nfrom pyfr.util import memoize\n\n\ndef _get_coefficients_from_txt(scheme):\n coeffs_mat = []\n\n for i, l in enumerate(scheme.splitlines(), sta... | [
[
"numpy.ones"
]
] |
johnnylu305/deeplab-imagenet-pytorch | [
"d6ebd912622b2fd8d3614866082793a0c4e211e4"
] | [
"libs/models/deeplabv2.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n#\n# Author: Kazuto Nakashima\n# URL: http://kazuto1011.github.io\n# Created: 2017-11-19\n\n# Author: Johnnylu305\n\nfrom __future__ import absolute_import, print_function\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .resnet import ... | [
[
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.randn",
"torch.nn.init.constant_"
]
] |
vlingenfelter/scikit-mobility | [
"d9a7bbcac30efbf5bd834c2e5e3a3264c3d9dbc1"
] | [
"skmob/preprocessing/tests/test_detection.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom skmob.core.trajectorydataframe import TrajDataFrame\nfrom skmob.preprocessing import detection\nfrom skmob.utils import constants\n\n\nclass TestDetection:\n def setup_method(self):\n latitude = constants.LATITUDE\n longitude = constants.LONGITUDE\n ... | [
[
"pandas.to_datetime",
"numpy.array",
"pandas.testing.assert_frame_equal",
"pandas.DataFrame",
"pandas.Timestamp"
]
] |
hieubkvn123/Diffusion-Handwriting-Generation | [
"489f38e7f5d95b62d4b02632f747c6d125d41cd9"
] | [
"nn.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom tensorflow.keras import Model, Sequential\nfrom tensorflow.keras.applications import MobileNetV2\nfrom tensorflow.keras.layers import (Dense, Conv1D, Embedding, UpSampling1D, AveragePooling1D, \nAveragePooling2D, GlobalAveragePooling2D, Activation, LayerNormalizati... | [
[
"tensorflow.keras.layers.Conv1D",
"tensorflow.nn.swish",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.layers.Activation",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.Dense",
"tensorflow.sqrt",
"tensorfl... |
dbr/polars | [
"49e0fa3f277eafb78d7313630eae71114f3de7d3"
] | [
"py-polars/polars/utils.py"
] | [
"import ctypes\nimport typing as tp\nfrom datetime import date, datetime, timedelta, timezone\nfrom typing import Any, Dict, Tuple, Union\n\nimport numpy as np\n\n\ndef _process_null_values(\n null_values: Union[None, str, tp.List[str], Dict[str, str]] = None,\n) -> Union[None, str, tp.List[str], tp.List[Tuple[s... | [
[
"numpy.ctypeslib.as_array"
]
] |
arfu2016/DuReader | [
"66934852c508bff5540596aa71d5ce40c828b37d"
] | [
"text-classification/lstm_sentiment.py"
] | [
"\"\"\"\n@Project : DuReader\n@Module : lstm_sentiment.py\n@Author : Deco [deco@cubee.com]\n@Created : 5/17/18 4:33 PM\n@Desc : \n\"\"\"\n\nimport numpy as np\nimport tensorflow as tf\nimport os\n\nfile_dir = os.path.dirname(os.path.abspath(__file__))\nfn_review = os.path.join(file_dir, 'data/reviews... | [
[
"tensorflow.contrib.rnn.DropoutWrapper",
"numpy.array",
"tensorflow.train.AdamOptimizer",
"tensorflow.round",
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.Graph",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.train.Saver",
"tensorflow.Session",
"tensorflow... |
MKesenheimer/tensorflow | [
"345788754c025534d487bb8cd01f535b840474b4"
] | [
"tensorflow/python/keras/layers/recurrent.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.gen_cudnn_rnn_ops.cudnn_rnn",
"tensorflow.python.ops.state_ops.assign",
"tensorflow.python.ops.array_ops.unstack",
"tensorflow.python.keras.backend.bias_add",
"tensorflow.python.keras.backend.flatten",
"tensorflow.python.keras.engine.input_spec.InputSpec",
"tenso... |
dobos/pysynphot | [
"5d2e0b52ceda78890940ac9239c2d88e149e0bed"
] | [
"pysynphot/test/test_ticket161.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport numpy as np\nimport pytest\n\nfrom ..obsbandpass import ObsBandpass\n\n\n@pytest.mark.remote_data\ndef test_err_col():\n \"\"\"Test that this obsmode does not raise exception.\"\"\"\n obs = ObsBandpass('stis,ccd,50ccd,mjd#55000')\n ... | [
[
"numpy.any"
]
] |
huangheruhai/TaxiFlowPredictor | [
"f5e34785a0f87362aea27bf229fe61daf1865173"
] | [
"tfpredictor/preprecessing/TaxiBJ.py"
] | [
"#!/usr/bin/env python\n#-*- coding: utf-8 -*-\n# -*- coding: utf-8 -*-\n\"\"\"\n load BJ Data from multiple sources as follows:\n meteorologic data\n\"\"\"\nfrom __future__ import print_function\n\nimport os\n\nimport pickle\nfrom copy import copy\nimport numpy as np\nimport h5py\nfrom tfpredictor.prepre... | [
[
"numpy.hstack",
"numpy.asarray",
"numpy.vstack"
]
] |
jkomoros/sudoku | [
"9c5e517359a63c77ef974618152574eae4f46375"
] | [
"cmd/dokugen-analysis/util/weights.py"
] | [
"#originally inspired by http://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html ,\n#but substantially modified from that\n\nimport numpy as np\nfrom sklearn import datasets, linear_model\nfrom sklearn.cross_validation import cross_val_score, KFold\n\nimport csv\n\n#Load the data\n\n#TODO: allow loa... | [
[
"numpy.array",
"sklearn.cross_validation.KFold",
"sklearn.linear_model.Ridge"
]
] |
Genlovy-Hoo/dramkit | [
"fa3d2f35ebe9effea88a19e49d876b43d3c5c4c7"
] | [
"dramkit/fintools/barra.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport time\nimport numpy as np\nimport pandas as pd\nimport statsmodels.api as sm\nfrom sklearn.linear_model import LinearRegression as lr\n\nfrom dramkit.logtools.utils_logger import logger_show\n\n#%%\ndef get_exp_decay_weight(n, adjust=True, logger=None, **kwargs):\n '''\n 计算指数... | [
[
"numpy.array",
"pandas.DataFrame.ewm",
"numpy.cov",
"numpy.zeros",
"sklearn.linear_model.LinearRegression",
"numpy.random.seed",
"pandas.DataFrame",
"pandas.date_range",
"numpy.sum",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.var"
]
] |
sethupathi-r/Object-Detection | [
"859b385480e16de16cc4c4adb57f49e98bfd3ade"
] | [
"builders/image_resizer_builder_test.py"
] | [
"# Copyright 2017 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.random_uniform",
"tensorflow.test.main"
]
] |
RomeroBarata/bottom-up-attention.pytorch | [
"a8ad05eaef0e75956df056588d789d595d2c4a24"
] | [
"bua/caffe/modeling/rcnn.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\r\nimport logging, os\r\nimport torch\r\nfrom torch import nn\r\nimport torch.nn.functional as F\r\n\r\nfrom detectron2.structures import ImageList\r\nfrom detectron2.utils.logger import log_first_n\r\n\r\nfrom detectron2.modeling.backbone imp... | [
[
"torch.device",
"torch.nn.functional.relu_"
]
] |
TomAugspurger/scipy | [
"c81cb557d85d3b6a68b079a4053994e4d9955bf7"
] | [
"scipy/interpolate/__init__.py"
] | [
"\"\"\"========================================\nInterpolation (:mod:`scipy.interpolate`)\n========================================\n\n.. currentmodule:: scipy.interpolate\n\nSub-package for objects used in interpolation.\n\nAs listed below, this sub-package contains spline functions and classes,\none-dimensional a... | [
[
"numpy.testing.Tester"
]
] |
zhandand/MolRep | [
"d81de22000f1245e1d9280af0cb329e745ce4bde"
] | [
"MolRep/Models/metrics.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 2020.05.19\n\n@author: Jiahua Rao, Weiming Li, Hui Yang, Jiancong Xie\n\nCode based on:\nErrica, Federico, et al. \"A fair comparison of graph neural networks for graph classification.\" (ICLR 2020).\n -> https://github.com/diningphil/gnn-comparison\n\"\"\"\nimport numpy... | [
[
"sklearn.metrics.mean_squared_error",
"sklearn.metrics.precision_recall_curve",
"numpy.sum",
"numpy.rint",
"scipy.stats.spearmanr",
"scipy.stats.pearsonr",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.mean_absolute_error",
"sklearn.metrics.r2_score",
"sklearn.metrics.... |
generalova-kate/nncf | [
"a2ec7bca7167318c5b1436199a4c7449a9c064e9"
] | [
"tests/tensorflow/quantization/test_algorithm_quantization.py"
] | [
"\"\"\"\n Copyright (c) 2020 Intel Corporation\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agr... | [
[
"tensorflow.reshape",
"tensorflow.keras.Model",
"tensorflow.python.keras.layers.Dense",
"tensorflow.math.reduce_all",
"tensorflow.concat",
"tensorflow.python.keras.layers.Conv2D",
"tensorflow.python.keras.layers.MaxPool2D",
"tensorflow.transpose",
"tensorflow.python.keras.layer... |
slf12/Paddle | [
"fa43d74a3a16ac696db5dc893c9a7b1c6913dc85"
] | [
"python/paddle/fluid/tests/unittests/dygraph_to_static/test_dict.py"
] | [
"# Copyright (c) 2020 PaddlePaddle 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 re... | [
[
"numpy.random.random"
]
] |
btaute/pvlib-python | [
"70f2fa83c98683eb2b6004e12acbd25a15727b6c"
] | [
"docs/examples/plot_transposition_gain.py"
] | [
"\"\"\"\nModeling Transposition Gain\n===========================\n\nCalculating the gain in insolation of a tilted module over a flat module.\n\"\"\"\n\n# %%\n# This example shows how to evaluate the transposition gain of a racking\n# strategy. The transposition gain is the additional insolation collected\n# by o... | [
[
"pandas.Timedelta",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
Gonm1/smalldata | [
"ba781aa832275bd9608596be5af857b123b1ccdc"
] | [
"fmnist/dropout.py"
] | [
"import os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # ignore tf warnings about cuda\nfrom keras.layers import Conv2D, MaxPooling2D, Dropout, Dense, Flatten\nfrom keras.metrics import CategoricalAccuracy\nfrom sklearn.metrics import classification_report, matthews_corrcoef\nfrom keras.losses import CategoricalCross... | [
[
"numpy.random.seed",
"sklearn.metrics.matthews_corrcoef",
"tensorflow.random.set_seed",
"sklearn.metrics.classification_report",
"numpy.argmax"
]
] |
ksang/cs231n-assignments | [
"3199a03c6bcf7332845820d389517c079d0a3e1e"
] | [
"assignment3/cs231n/classifiers/rnn.py"
] | [
"from builtins import range\nfrom builtins import object\nimport numpy as np\n\nfrom cs231n.layers import *\nfrom cs231n.rnn_layers import *\n\n\nclass CaptioningRNN(object):\n \"\"\"\n A CaptioningRNN produces captions from image features using a recurrent\n neural network.\n\n The RNN receives input v... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.ones",
"numpy.random.randn",
"numpy.argmax",
"numpy.sqrt"
]
] |
oliujunk/yolov4-tiny-pytorch | [
"d5f5839ddbfa7710c7d80a1664246ce5bc4a34f1"
] | [
"get_dr_txt.py"
] | [
"#-------------------------------------#\r\n# mAP所需文件计算代码\r\n# 具体教程请查看Bilibili\r\n# Bubbliiiing\r\n#-------------------------------------#\r\nimport cv2\r\nimport numpy as np\r\nimport colorsys\r\nimport os\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.backends.cudnn as cudnn\r\nfrom to... | [
[
"numpy.array",
"torch.cat",
"numpy.asarray",
"torch.no_grad",
"numpy.shape",
"torch.from_numpy",
"numpy.transpose",
"numpy.expand_dims"
]
] |
Aadesh-1404/image-enhancement-verilog | [
"6155ab9472bf25af307ed349afabd604bdc61ced",
"6155ab9472bf25af307ed349afabd604bdc61ced"
] | [
"Week1/Histogram Equalisation/histequal.py",
"Week1/Histogram Matching/histmatch.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Oct 7 00:44:48 2020\r\n\r\n@author: saagar.parikh\r\n\"\"\"\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\nimport cv2\r\n\r\npath = \"8.png\" # Path of original image\r\nimg_orig = cv2.imread(path) ... | [
[
"matplotlib.pyplot.xlim",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"numpy.ma.masked_equal",
"numpy.ma.filled",
"matplotlib.pyplot.show"
],
[
"matplotlib.pyplot.xlim",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title"... |
quanchao/database-implementation | [
"f1a215cc6607a96e05345604ae7b6197f4474c49"
] | [
"test/integration_tests/test_select_executor.py"
] | [
"# coding=utf-8\n# Copyright 2018-2020 EVA\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"pandas.DataFrame",
"numpy.ones"
]
] |
sanchitchip/BR_AI | [
"053a33041f682d79e9ff05d540e4bce2b851292c"
] | [
"functions/get_coord.py"
] | [
"import numpy as np\nimport sys\nsys.path.insert(1,'../functions')\nfrom matplotlib import pyplot as plt\nfrom sentinelhub import BBox, CRS, DataCollection, SHConfig\n\n\n## -- for testing \n# 1.) check type of image_height,width\n# 2.) check type of bbox\n# 3.) if any input value is None return value error.\n\ndef... | [
[
"numpy.linspace"
]
] |
captain695/pytorch-lightning | [
"df91aa5d77cae876171b55cd063b8ff8ac7026e1"
] | [
"pytorch_lightning/trainer/trainer.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.set_grad_enabled"
]
] |
rnagumo/dgm_vae | [
"ea9e1a39f0018c9ed55f13f0b88f4afc4657d7e4"
] | [
"dgmvae/datasets/cars3d.py"
] | [
"\n\"\"\"Dataset class for cars3d\n\nref)\nhttps://github.com/google-research/disentanglement_lib/blob/master/disentanglement_lib/data/ground_truth/cars3d.py\n\"\"\"\n\nimport pathlib\nfrom PIL import Image\n\nimport numpy as np\nimport scipy.io as sio\nimport torch\n\nfrom .base_data import BaseDataset\n\n\nclass ... | [
[
"numpy.array",
"torch.stack",
"numpy.zeros",
"scipy.io.loadmat",
"numpy.arange"
]
] |
yjt2018/change_detection.pytorch | [
"cbd6150708eeddbd66e30e311f2482d43334b738"
] | [
"change_detection_pytorch/base/decoder.py"
] | [
"import torch\n\n\nclass Decoder(torch.nn.Module):\n # TODO: support learnable fusion modules\n def __init__(self):\n super().__init__()\n self.FUSION_DIC = {\"2to1_fusion\": [\"sum\", \"diff\", \"abs_diff\"],\n \"2to2_fusion\": [\"concat\"]}\n\n def fusion(self, x1,... | [
[
"torch.abs",
"torch.cat"
]
] |
microsoft/intrinsic-private-sgd | [
"2e48a3186f6c8613d1b0b5ada4448cb28b19b011"
] | [
"aDPSGD/test_private_model.py"
] | [
"#!/usr/bin/env ipython\n# The functions in this file relate to evaluating the performance of the model\n# Specifically we are interested in the utility of models with different privacy levels\n\nimport numpy as np\n\nfrom sklearn.metrics import log_loss\nimport data_utils\nimport model_utils\nfrom results_utils im... | [
[
"numpy.random.normal",
"numpy.ceil",
"numpy.log",
"numpy.any",
"numpy.arange",
"sklearn.metrics.log_loss",
"numpy.sqrt",
"numpy.abs",
"numpy.hstack"
]
] |
kzk-IS/MWSCUP2020_server | [
"6fc8874b5926ea7c9170d0eaee8d434a6eb0042c"
] | [
"model_mws/ELM.py"
] | [
"import numpy as np\nimport h5py\nimport tensorflow as tf\nimport tensorflowjs as tfjs\nimport json\nimport math\nclass ExtremeLearningMachine(object):\n def __init__(self, n_unit, activation=None):\n self._activation = self._sig if activation is None else activation\n self._n_unit = n_unit\n\n ... | [
[
"numpy.concatenate",
"numpy.array",
"sklearn.preprocessing.StandardScaler",
"numpy.ones",
"numpy.exp",
"tensorflow.keras.layers.Dense",
"numpy.linalg.lstsq",
"numpy.argmax",
"numpy.random.random",
"sklearn.datasets.load_iris"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.