repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
chhzh123/heterocl | [
"856e9b8ad877d11280a7e457e91ca89803c05570",
"856e9b8ad877d11280a7e457e91ca89803c05570"
] | [
"tests/mlir/test_dtype.py",
"tests/mlir/test_schedule_compute.py"
] | [
"import heterocl as hcl\nimport numpy as np\nimport pytest\n\ndef test_dtype_basic_uint():\n\n def _test_dtype(dtype):\n hcl.init(dtype)\n np_a = np.random.randint(0, 1<<63, 100)\n hcl_a = hcl.asarray(np_a)\n np_a2 = hcl_a.asnumpy()\n def cast(val):\n sb = 1 << dtype... | [
[
"numpy.allclose",
"numpy.vectorize",
"numpy.random.rand",
"numpy.zeros",
"numpy.random.randint"
],
[
"numpy.fromfunction",
"numpy.sum",
"numpy.zeros",
"numpy.random.randint"
]
] |
m-wiesner/lhotse | [
"a9c26ba39bc56d27130ff8600c1796db08038c48"
] | [
"test/dataset/test_speech_recognition_dataset.py"
] | [
"import pytest\nimport torch\nfrom torch import tensor\nfrom torch.utils.data import DataLoader\n\nfrom lhotse import Fbank\nfrom lhotse.cut import CutSet\nfrom lhotse.dataset import RandomizedSmoothing\nfrom lhotse.dataset.cut_transforms import CutConcatenate, CutMix\nfrom lhotse.dataset.cut_transforms.extra_paddi... | [
[
"torch.set_num_interop_threads",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.linalg.norm",
"torch.tensor",
"torch.set_num_threads"
]
] |
sfoucher/geo-deep-learning | [
"c9803bcf18f2899d52b48a54f9c165d266f49304"
] | [
"utils/create_dataset.py"
] | [
"import collections\nimport os\nimport warnings\nfrom typing import List\n\nimport h5py\nfrom torch.utils.data import Dataset\nimport numpy as np\n\nimport models.coordconv\nfrom utils.utils import get_key_def, ordereddict_eval\nfrom utils.geoutils import get_key_recursive\n\n# These two import statements prevent e... | [
[
"numpy.unique",
"numpy.full",
"numpy.insert",
"numpy.isscalar",
"numpy.float32"
]
] |
joshua049/Stereo-360-Layout | [
"8a1dcffb231128c144507b186b925c1e3f313db9"
] | [
"eval_general.py"
] | [
"import os\nimport json\nimport glob\nimport argparse\nimport numpy as np\nfrom tqdm import tqdm\nfrom shapely.geometry import Polygon\nfrom dataset import cor_2_1d\nfrom misc import post_proc\n\n\ndef layout_2_depth(cor_id, h, w, return_mask=False):\n # Convert corners to per-column boundary first\n # Up -pi... | [
[
"numpy.maximum",
"numpy.arange",
"numpy.cos",
"numpy.sin",
"numpy.tan",
"numpy.zeros_like",
"numpy.repeat",
"numpy.array",
"numpy.zeros"
]
] |
wcyjames/dgl | [
"00a668ac6898971aa154a8a3fe851010034fd6bf"
] | [
"benchmarks/benchmarks/api/bench_knn_graph.py"
] | [
"import time\nimport dgl\nimport torch\nimport numpy as np\n\nfrom .. import utils\n\n\n@utils.benchmark('time', timeout=60)\n@utils.parametrize('k', [3, 5, 10])\n@utils.parametrize('size', [50, 200, ])\n@utils.parametrize('dim', [16, 64, 128])\ndef track_time(size, dim, k):\n device = utils.get_bench_device()\n... | [
[
"numpy.random.randn",
"torch.tensor"
]
] |
JulianGiles/climate_indices | [
"4d3a04d4290ad3738999ac1c4de8a31ad5c1d938"
] | [
"src/climate_indices/indices.py"
] | [
"from enum import Enum\nimport logging\nfrom typing import Dict\n\nimport numba\nimport numpy as np\n\nfrom climate_indices import compute, eto, palmer, utils\n\n# declare the names that should be included in the public API for this module\n__all__ = [\"pdsi\", \"percentage_of_normal\", \"pet\", \"scpdsi\", \"spei\... | [
[
"numpy.ma.isMaskedArray",
"numpy.clip",
"numpy.amin",
"numpy.isnan",
"numpy.full",
"numpy.nanmean",
"numpy.ma.is_masked"
]
] |
rogeriochaves/tranX | [
"fe927f32bc281bf62e0741e659ba5f677c5ca81b"
] | [
"model/seq2seq.py"
] | [
"# coding=utf-8\nfrom itertools import chain\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.utils\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence\n\nfrom model import nn_utils\n\n\nclass Seq2SeqModel(nn.Module):... | [
[
"torch.nn.Dropout",
"torch.nn.functional.softmax",
"torch.nn.functional.log_softmax",
"torch.nn.LSTM",
"torch.cat",
"torch.zeros",
"torch.topk",
"torch.eq",
"torch.gather",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.multinomial",
"torch.nn.LSTMCell",
"tor... |
deepeshdm/Object_Detection_YOLOV1 | [
"ba7963d2e4305efcdad256038e354910c472c18c"
] | [
"model.py"
] | [
"\r\n\"\"\"\r\nImplementation of Yolo (v1) architecture\r\nwith slight modification with added BatchNorm.\r\n\r\n==> MODEL SUMMARY :\r\n----------------------------------------------------------------\r\n Layer (type) Output Shape Param #\r\n=============================================... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.Conv2d",
"torch.nn.Flatten",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.flatten"
]
] |
tmbern/DS-Unit-3-Sprint-2-SQL-and-Databases | [
"a0c6bc33819d067868526a7a094eec4c6bf319e4"
] | [
"app/insert_titanic.py"
] | [
"import os\nfrom dotenv import load_dotenv\nimport psycopg2\nfrom psycopg2.extras import execute_values\nimport json\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\nCSV_filepath = os.path.join(os.path.dirname(__file__), \"..\", \"module2-sql-for-analysis\", \"titanic.csv\")\ndf = pd.read_csv(CSV_filep... | [
[
"pandas.read_csv"
]
] |
psyllost/semantic-object-accuracy-for-generative-text-to-image-synthesis | [
"7ecf668fe8424ce851b4f88e4453f14a1f4fee85"
] | [
"SOA/calculate_soa.py"
] | [
"from __future__ import division\nimport torch\nimport torch.nn as nn\nimport torchvision\nimport torchvision.transforms as transforms\nimport numpy as np\nimport argparse\nimport os\nimport pickle as pkl\nfrom tqdm import tqdm\nimport glob\nimport shutil\n\nfrom darknet import Darknet\nfrom dataset import YoloData... | [
[
"torch.no_grad",
"torch.cuda.set_device",
"torch.utils.data.DataLoader",
"torch.cuda.is_available"
]
] |
999wwx/mindgo_quantitative_investment | [
"c3eb158052481209770c251733e1f66bb5231601"
] | [
"Quantitative_investment.py"
] | [
"# 股票策略模版\n# 初始化函数,全局只运行一次\n\ndef init(context):\n # 设置基准收益:沪深300指数\n set_benchmark('000300.SH')\n # 打印日志\n log.info('策略开始运行,初始化函数全局只运行一次')\n # 设置股票每笔交易的手续费为万分之二(手续费在买卖成交后扣除,不包括税费,税费在卖出成交后扣除)\n set_commission(PerShare(type='stock',cost=0.0002))\n # 设置股票交易滑点0.5%,表示买入价为实际价格乘1.005,卖出价为实际价格乘0.995\n... | [
[
"numpy.reshape",
"numpy.isnan",
"numpy.concatenate",
"numpy.delete",
"sklearn.tree.DecisionTreeClassifier",
"numpy.count_nonzero",
"numpy.zeros",
"sklearn.decomposition.PCA"
]
] |
essamabas/CarND-Capstone | [
"93bc68ff3491fbc699dab1dfa564930dab1ab598"
] | [
"ros/src/tl_detector/light_classification/training/utils/label_map_util_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\... | [
[
"tensorflow.test.main",
"tensorflow.gfile.Open"
]
] |
Kitware/kwimage | [
"76c043359dc47f804e155a060caa375cc2a714f7",
"76c043359dc47f804e155a060caa375cc2a714f7"
] | [
"kwimage/im_cv2.py",
"dev/bench_imread.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nWrappers around cv2 functions\n\nNote: all functions in kwimage work with RGB input by default instead of BGR.\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport cv2\nimport six\nimport numpy as np\nimport ubelt as ub\nimport numbers... | [
[
"numpy.split",
"numpy.log2",
"numpy.ones_like",
"numpy.linspace",
"numpy.asarray",
"numpy.full",
"numpy.round",
"numpy.concatenate",
"numpy.ceil",
"numpy.iinfo",
"numpy.floor",
"numpy.array",
"numpy.zeros",
"numpy.where"
],
[
"numpy.asarray",
"nu... |
alayah2626517/enmspring | [
"c77c86de2254177863c344c566ef0791306a5112"
] | [
"enmspring/k_b0_plot.py"
] | [
"from os import path\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy import stats\nfrom enmspring.spring import Spring\nfrom enmspring import k_b0_util\n\nplt.rcParams['font.family'] = 'sans-serif'\n\nclass ScatterPlot:\n# hosts = ['21_nome', '21_allme']\n# n_bp = 21\n hosts = ['nome', '... | [
[
"numpy.median",
"numpy.save",
"scipy.stats.linregress",
"numpy.mean",
"numpy.load",
"numpy.array"
]
] |
tjlaboss/tasty_treat | [
"5a137b49c6648eda6500025de8bab9c8dcc78d45"
] | [
"treat/mcm2d.py"
] | [
"# MCM 2D\n#\n# New 2D Minimum Critical Mass core builder\n# Uses 4 types of elements:\n# fuel, control rod fuel (with zircaloy-clad graphite follower),\n# aluminum-clad dummies, and zirc-clad dummies\n\nimport numpy\nimport openmc\nimport elements\nimport constants\nimport common_layers\nimport crd\nimport treat_l... | [
[
"numpy.array"
]
] |
kunalgupta02209/Contactless_attendance | [
"e4b7debe4bcb5f25f28190e2bc0950e03cf7a2cd"
] | [
"face_recogniser.py"
] | [
"import cv2\nimport numpy as np\nfrom keras.models import load_model\nfrom db_util import database\nimport pymongo\nfrom pymongo.errors import DuplicateKeyError\nfrom collections import Counter\n\nclass face:\n def __init__(self):\n self.cascade=cv2.CascadeClassifier('faces.xml')\n self.x=None\n ... | [
[
"numpy.max",
"numpy.expand_dims",
"numpy.argmax"
]
] |
yusanshi/easy-rec | [
"86db0bbd1eb0caf94c4b0ec4198bf49e64f65f24"
] | [
"src/rechub/model/general/predictor/dot.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass DotPredictor(nn.Module):\n def __init__(self):\n super().__init__()\n\n def forward(self, first_vector, second_vector):\n '''\n Args:\n first_vector: (shape) batch_size, *, dim\n second_vector: (shape) batch_size, *, d... | [
[
"torch.mul",
"torch.rand"
]
] |
nerji/FF-Bingo | [
"b052df84914ce8becd3482c57b58c421417d699c"
] | [
"utilities/generate_card_data.py"
] | [
"import numpy as np\nimport json\n\n\ndef generate_card_data(guild, x_cells=5, y_cells=5, free_x=2, free_y=2, beeg=False):\n # number of images to generate and bool to determine if free space is taken from seperate list\n free_space_bool = True\n\n list_path = \"./lists/\" + guild + \"/list.txt\"\n free... | [
[
"numpy.loadtxt",
"numpy.random.choice"
]
] |
www516717402/MQBench | [
"8519ae6db18c3d09ec5dcc50a7e76349738ee819"
] | [
"mqbench/fake_quantize/tqt.py"
] | [
"from functools import partial\n\nimport torch\n\nfrom mqbench.fake_quantize.quantize_base import QuantizeBase\nfrom mqbench.utils import is_symmetric_quant\n\n\nclass TqtFakeQuantize(QuantizeBase):\n def __init__(self, observer, scale=1., zero_point=0., **observer_kwargs):\n super(TqtFakeQuantize, self).... | [
[
"torch.ceil",
"torch.floor",
"torch.round",
"torch.tensor",
"torch.where",
"torch.finfo",
"torch.clamp",
"torch.ones_like"
]
] |
kasra-hosseini/synthetic_data_release | [
"768fe15cae6a033a17390d8dc2152bb75a083ca2"
] | [
"synthetic_data/utils/evaluation_framework.py"
] | [
"\"\"\"\nProcedures for running a privacy evaluation on a generative model\n\"\"\"\n\nfrom sklearn.metrics import roc_curve, auc\nfrom os import path\nfrom numpy import concatenate, mean, ndarray\nfrom pandas import DataFrame\nfrom pandas.api.types import is_numeric_dtype\nfrom multiprocessing import Pool\n\nfrom s... | [
[
"sklearn.metrics.roc_curve",
"pandas.api.types.is_numeric_dtype",
"numpy.concatenate",
"numpy.mean",
"sklearn.metrics.auc"
]
] |
syuntoku14/pytorch-rl-il | [
"e613b73acdb634f2f7a00ac88e7aa3431c1852bf"
] | [
"rlil/agents/brac.py"
] | [
"import os\nimport torch\nimport numpy as np\nfrom torch.distributions.normal import Normal\nfrom torch.nn.functional import mse_loss\nfrom copy import deepcopy\nfrom rlil.environments import State, action_decorator, Action\nfrom rlil.initializer import get_writer, get_device, get_replay_buffer\nfrom rlil import nn... | [
[
"torch.nn.functional.mse_loss",
"torch.no_grad"
]
] |
chiragob/keras | [
"00dad79c19aacb375b76b09d7cb522035551b863"
] | [
"binary-classification.py"
] | [
"from keras.models import Sequential\nfrom keras.layers import Dense, Activation\n\nmodel = Sequential()\nmodel.add(Dense(32, activation='relu', input_dim=100))\nmodel.add(Dense(1, activation='sigmoid'))\nmodel.compile(optimizer='rmsprop',\n loss='binary_crossentropy',\n metrics=['accuracy... | [
[
"numpy.random.random",
"numpy.random.randint"
]
] |
heechan95/Mask_RCNN | [
"e21f3349f659723e955e925372013bc942351d56"
] | [
"Baseline MaskRCNN.py"
] | [
"import sys\nimport numpy as np\nimport tensorflow as tf\nfrom datetime import datetime\nimport os \nimport sys\nimport random\nimport math\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nplt.rcParams[\"font.size\"] = 15\n#import seaborn as sns\nimport json\nfrom tqdm import tqdm\nimport pandas as... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.stack",
"pandas.set_option",
"numpy.array",
"numpy.zeros"
]
] |
stanislavfort/markov_language_model | [
"fa25dab246668761ed90bcd95fea1981b7d9f492"
] | [
"generate_sequence.py"
] | [
"import pickle\nimport numpy as np\nimport os.path\n\nnp.random.seed(123)\n\n#filepath to the text form which probabilities were extracted\nfilepath = \"data/50shades.txt\"\n\n#maximal order of the Markov chain probabilities to extract\n#order = 1 => looks at 1 previous character\nmaxorder = 10\n\nexists = [False f... | [
[
"numpy.random.rand",
"numpy.array",
"numpy.sum",
"numpy.random.seed"
]
] |
ArdalanM/pyLightGBM | [
"cb8bb4a8904dc541af579691ab100ca0466eb098"
] | [
"tests/test_models.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@author: Ardalan MEHRANI <ardalan77400@gmail.com>\n@brief:\n\"\"\"\n\nimport pytest\nimport pickle\nimport numpy as np\nimport scipy.sparse as sps\nfrom sklearn import datasets, metrics, model_selection\nfrom pylightgbm.models import GBMClassifier, GBMRegressor\n\n# Params\npath_to... | [
[
"sklearn.model_selection.GridSearchCV",
"sklearn.datasets.make_classification",
"numpy.random.seed",
"sklearn.model_selection.train_test_split",
"scipy.sparse.csr_matrix",
"sklearn.datasets.make_regression",
"sklearn.datasets.make_multilabel_classification",
"sklearn.metrics.make_s... |
fancent/PHY407 | [
"38ce8badb9537060becc255ec64e6de2968ca73c"
] | [
"Lab2/lab2_Q2.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n#define function of p(u)\r\ndef p(u):\r\n return (1-u)**8\r\n\r\n#define function of q(u)\r\ndef q(u):\r\n return (1 - 8*u + 28*u**2 - 56*u**3 + 70*u**4 -56*u**5 +28*u**6 -8*u**7 +u**8)\r\n\r\n#create data set for (a) of about 500 elements\r\ndata ... | [
[
"numpy.sqrt",
"numpy.arange",
"matplotlib.pyplot.subplots",
"numpy.std",
"matplotlib.pyplot.show"
]
] |
kyzhouhzau/Machine-learning | [
"8647df5046c64e2a5791bec238e966aca79c15a9"
] | [
"AdaBoost.py"
] | [
"#! usr/bin/env python3\n# -*- coding:utf-8 -*-\n\"\"\"\n@Author:zhoukaiyin\n\"\"\"\n#! usr/bin/env python3\n# -*- coding:utf-8 -*-\n\"\"\"\n@Author:zhoukaiyin\nEmpirical good default values are max_features=n_features for regression problems, \nand max_features=sqrt(n_features) for classification tasks (where n_fe... | [
[
"numpy.array",
"sklearn.model_selection.LeaveOneOut",
"sklearn.metrics.precision_score",
"sklearn.model_selection.train_test_split",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.ensemble.AdaBoostClassifier",
"numpy.mean",
"sklearn.model_selection.cross_validate",
"sklearn.me... |
alontalmor/allennlp | [
"3beb3ffff3ef45311c148301e91562b2000dff3b"
] | [
"external/AIGame/transformer_binary_qa_model.py"
] | [
"from typing import Dict, Optional, List, Any\n\nfrom transformers.modeling_roberta import RobertaModel\nfrom transformers.modeling_xlnet import XLNetModel\nfrom transformers.modeling_bert import BertModel\nfrom transformers.modeling_albert import AlbertModel\nfrom transformers.modeling_utils import SequenceSummary... | [
[
"torch.nn.Dropout",
"torch.sigmoid",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.modules.linear.Linear"
]
] |
ulysses4ever/Frames | [
"943a35909ffed052dd7a4eb406cd3fa07f15a0da"
] | [
"benchmarks/pandas_joins.py"
] | [
"# Demonstration of data frame joins with pandas. Build with\n# cabal, then run in bash with something like\n#\n# $ /usr/bin/time -l python benchmarks/pandas_joins.py 2>&1 | head -n 4\n#\n# Or\n# nix-shell -p 'python.withPackages (p: [p.pandas])' --run '/usr/bin/time -l python benchmarks/pandas_joins.py 2>&1 | head... | [
[
"pandas.merge",
"pandas.read_csv"
]
] |
fruttasecca/hay_checker | [
"2bbf4e8e90e0abc590dd74080fb6e4f445056354"
] | [
"haychecker/_test/chc/task_test.py"
] | [
"import unittest\n\nimport pandas as pd\n\nfrom haychecker.chc.metrics import completeness, deduplication, timeliness, rule, grouprule\nfrom haychecker.chc.task import Task\n\n\nclass TestTask(unittest.TestCase):\n def test_groping_multile_columns(self):\n df = pd.DataFrame()\n c1 = [0, 0, 1, 1, 2,... | [
[
"pandas.DataFrame"
]
] |
nirajankeybridge/Spectrum-Access-System | [
"e4e157f3b8fc9f29cb6fbb283acc3a7cbb1212e1"
] | [
"src/harness/reference_models/antenna/antenna.py"
] | [
"# Copyright 2017 SAS Project 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.radians",
"numpy.abs",
"numpy.cos",
"numpy.ones",
"numpy.atleast_1d",
"numpy.sin",
"numpy.log10",
"numpy.isscalar",
"numpy.where"
]
] |
zhanghaobin/news-crawler | [
"c8dd59790c8dd1d3eae2614faee0a5250dcf9db8"
] | [
"crawler.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom parsers.index_parser import *\nfrom parsers.news_parser import *\n\nfrom pandas import DataFrame\n\nfrom typing import Union\nfrom http import HTTPStatus\nfrom requests import request\nfrom requests.exceptions import RequestException, RetryError\n\n\nclass Crawler:\n\n URL_INDEX ... | [
[
"pandas.DataFrame"
]
] |
ajinkya48765/Duties-Made-Easy | [
"b8376f8c2467699d2069d2a72850000a92513b77"
] | [
"test.py"
] | [
"import os\nimport pandas as pd\nfilepath=\"C:/Users/ajink/Duties_made_easy\"\nprint(\"The file path is : \")\nos.chdir(filepath)\nfile=pd.read_excel(\"DataFile.xlsx\",sheet_name=\"Sheet1\",na_values=\" \")\n#print(file)\n\n\n####################### Accissing the Required Data ########################\n\n\nde... | [
[
"pandas.read_excel",
"pandas.DataFrame",
"pandas.ExcelWriter"
]
] |
adowu/sweetie | [
"a99b02070c88baaa90d25f914d82bac3c73dd030"
] | [
"snippets.py"
] | [
"# -*- encoding: utf-8 -*-\n'''\n@Email : wushaojun0107@gmail.com\n@Time : 02-04 2021\n'''\nimport numpy as np\n\n\nclass BaseGenerator(object):\n \"\"\"数据生成器模版\"\"\"\n\n def __init__(self, data, batch_size, buffer_size, random, mode='train'):\n self.data = data\n self.mode = mode\n se... | [
[
"numpy.random.shuffle"
]
] |
Praneet1997/weed-gan | [
"d80dad9c8dde606ba0eebbdb4f32a65763ff5692"
] | [
"HistoGAN/Accuracy Testing/compare_images.py"
] | [
"import scipy\nfrom scipy.misc import imsave\nimport os\nimport cv2\nimport numpy as tf\n\n\n# Removes items that appear in a listmore than once\ndef remove_duplicates(image_list):\n return list(set(image_list))\n\n\n# Gets a list of all images (including if it's used multiple times)\ndef find_images(list_of_fol... | [
[
"scipy.misc.imsave",
"numpy.zeros",
"numpy.ones"
]
] |
hwidong-na/fairseq | [
"c699eb054e2782e2ae4e1d85d1fff5a724dc5c0e"
] | [
"fairseq/sequence_generator.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\n\nimport torch\n\nfrom fairseq import search, utils\nfrom fairseq.data import data_utils\nfrom fairseq.models import Fa... | [
[
"torch.nn.ModuleList",
"torch.gather",
"torch.no_grad",
"torch.arange",
"torch.topk",
"torch.masked_select",
"torch.index_select",
"torch.stack"
]
] |
nyee/RMG-Py | [
"1c8816af340c106967bc877bee0ff9fe71607d7a"
] | [
"rmgpy/cantherm/pdep.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\n################################################################################\n#\n# RMG - Reaction Mechanism Generator\n#\n# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the\n# RMG Team (rmg_dev@mit.edu)\n#\n# Permission is hereby grant... | [
[
"numpy.max",
"numpy.zeros",
"numpy.linspace",
"numpy.min"
]
] |
nialky/DrTel | [
"8123c4465a4c2b82410a027669fb81d30b6f20a0"
] | [
"altAngle.py"
] | [
"import math\nfrom scipy.spatial import distance\ndef get_angle(p1, p2, p3):\n dot_product = (p1[0] - p2[0]) * (p3[0] - p2[0]) + (p1[1] - p2[1]) * (p3[1] - p2[1])\n denominator = max(distance.euclidean(p1, p2) * distance.euclidean(p2, p3), 0.1)\n ratio = dot_product / denominator\n if ratio > 1:\n ratio = 1\... | [
[
"scipy.spatial.distance.euclidean"
]
] |
luizvbo/press-start | [
"02590c2176a4ae53287fe5a9b5c6a1ecd30bcdb6"
] | [
"src/press_start/pipelines/feature_selection/nodes.py"
] | [
"import pandas as pd\nfrom typing import Dict, Union, Tuple\nfrom sklearn.feature_selection import SelectKBest, chi2, RFE\nfrom sklearn.ensemble import RandomForestClassifier\nfrom press_start.params import (\n GeneralParams,\n ParamsFeatSelectionKBest,\n ParamsFeatSelectionRFE,\n)\n\n\ndef get_metrics(\n ... | [
[
"sklearn.feature_selection.SelectKBest",
"pandas.concat",
"sklearn.ensemble.RandomForestClassifier",
"pandas.DataFrame"
]
] |
tskTNK/LunarHopperSimulation | [
"2299ba7bf1bf73bd81b63175e17d1fc3af08fa04"
] | [
"lunar_hopper_LQT.py"
] | [
"\"\"\"\r\nRocket trajectory optimization is a classic topic in Optimal Control.\r\n\r\nAccording to Pontryagin's maximum principle it's optimal to fire engine full throttle or\r\nturn it off. That's the reason this environment is OK to have discreet actions (engine on or off).\r\n\r\nThe landing pad is always at c... | [
[
"numpy.dot",
"scipy.linalg.solve_continuous_are",
"numpy.abs",
"numpy.clip",
"numpy.linalg.inv",
"numpy.linalg.eig",
"numpy.sqrt",
"numpy.sort",
"numpy.sign",
"numpy.array"
]
] |
ankitvaibhava/Peak_Stress_in_Microstructures | [
"f4db973ab788dd5e3a8fdb76de692357113206b6"
] | [
"utils/helper.py"
] | [
"import h5py\nimport numpy as np\n\n\ndef store_data_in_hdffile(name_, data, hf, start, end, Total_no_sample=10000):\n if (name_ not in hf):\n hf.create_dataset(name_, (np.append(Total_no_sample, data[0].shape)),\n 'float64')\n\n hf[name_][start:end] = data\n\n\ndef scale01(M):... | [
[
"numpy.max",
"numpy.append",
"numpy.zeros",
"numpy.min"
]
] |
zhangshoug/czipline | [
"6bce0abd4772443547f44669c0adb2b5c63f64db"
] | [
"zipline/optimize/utils/data_management.py"
] | [
"\"\"\"\nTODO:去掉参数t\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\n__all__ = [\n 'check_series_or_dict', 'get_ix', 'time_matrix_locator', 'time_locator',\n 'null_checker', 'non_null_data_args'\n]\n\n\nclass NotFoundAsset(Exception):\n \"\"\"找不到对应资产异常\"\"\"\n pass\n\n\ndef check_series_or_dict(x, ... | [
[
"numpy.isnan",
"pandas.isnull",
"pandas.Index",
"numpy.isscalar"
]
] |
tangxiaomi888/beta-recsys | [
"41a9b30fb12e9eec6dd18b9fb9835b1b4babbbd7"
] | [
"beta_rec/datasets/dunnhumby.py"
] | [
"import os\n\nimport pandas as pd\n\nfrom ..datasets.dataset_base import DatasetBase\nfrom ..utils.common_util import timeit, un_zip\nfrom ..utils.constants import (\n DEFAULT_FLAG_COL,\n DEFAULT_ITEM_COL,\n DEFAULT_ORDER_COL,\n DEFAULT_RATING_COL,\n DEFAULT_TIMESTAMP_COL,\n DEFAULT_USER_COL,\n)\n... | [
[
"pandas.read_csv"
]
] |
gimmy49699/Capsule-MLTC | [
"30e43fddf9041fef1c863d1c7ea4ef5334b6650a"
] | [
"model/caps.py"
] | [
"import tensorflow as tf\r\nfrom keras import backend as K\r\nfrom model.utils import _get_uhat, _conv2d\r\n\r\nepsilon = 1e-9\r\n\r\n\r\n# define Squash function\r\ndef squash(x, axis=-1):\r\n s_squared_norm = tf.reduce_sum(tf.square(x), axis, keepdims=True) + epsilon\r\n scale = tf.sqrt(s_squared_norm) / (0... | [
[
"tensorflow.nn.softmax",
"tensorflow.layers.batch_normalization",
"tensorflow.concat",
"tensorflow.multiply",
"tensorflow.split",
"tensorflow.reshape",
"tensorflow.expand_dims",
"tensorflow.zeros_like",
"tensorflow.square",
"tensorflow.variable_scope",
"tensorflow.sqrt"... |
qute012/Korean-Speech-Recognition | [
"0e037fd03df1ad6bf1084ee748781cdf4d428940"
] | [
"package/evaluator.py"
] | [
"import torch\nfrom package.definition import logger, id2char, EOS_TOKEN\nfrom package.utils import get_distance\n\n\ndef evaluate(model, queue, criterion, device):\n r\"\"\"\n Args:\n model (torch.nn.Module): Model to be evaluated\n queue (queue): queue for threading\n criterion (torch.n... | [
[
"torch.no_grad"
]
] |
t-martyniuk/DeblurGAN | [
"4b637bb0e19c446e7dbf63383eb5081a8c3b1804"
] | [
"models/fpn.py"
] | [
"import torch\nimport torch.nn as nn\nfrom models.senet import se_resnext50_32x4d\nfrom torchvision.models import resnet50, densenet121, densenet201\n\nclass FPNHead(nn.Module):\n def __init__(self, num_in, num_mid, num_out):\n super().__init__()\n\n self.block0 = nn.Conv2d(num_in, num_mid, kernel_... | [
[
"torch.nn.functional.upsample",
"torch.cat",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.tanh",
"torch.clamp"
]
] |
tcezard/eva-accession | [
"3828aa25160e738cec54eb186525c577bc4dc835"
] | [
"eva-accession-import-automation/generate_custom_assembly_report.py"
] | [
"# Copyright 2019 EMBL - European Bioinformatics Institute\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 require... | [
[
"pandas.read_csv"
]
] |
liliangbin/keras-learn | [
"f60270577635bdc50ba5ff38d8c63c9865029b5c"
] | [
"test/test2.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom keras.layers import Dense\nfrom keras.models import Sequential\n\nx_data = np.linspace(-0.5, 0.5, 200)\nnoise = np.random.normal(0, 0.02, x_data.shape)\ny_data = np.square(x_data) + noise\nplt.scatter(x_data, y_data)\nplt.show()\n"
] | [
[
"numpy.square",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"numpy.random.normal",
"matplotlib.pyplot.show"
]
] |
waynegm/OpendTect-External-Attributes | [
"7caaf69ee71cc3375fcd9e4d656c669ca01dc469"
] | [
"Python_3/Experimental/DipAndAzimuth/ex_gradient_to_st_dip.py"
] | [
"#\n# Calculate Orientation attributes from pre-calculated gradients using the Gradient Structure Tensor (GST)\n# Inputs: Inline, Crossline and Z gradients\n# Outputs: Inline, Crossline, True dip, Dip Azimuth and GST Coherency/Saliency\n#\nimport sys,os\nimport numpy as np\n#\n# Import the module with the I/O scaff... | [
[
"numpy.sqrt",
"numpy.arange",
"numpy.arctan2",
"numpy.linalg.eigh",
"numpy.array"
]
] |
vstadnytskyi/dataq-di-245 | [
"9670383537eb33179210dcdc0deb58ab3936448e"
] | [
"dataq_di_245/driver.py"
] | [
"# -*- coding: utf-8 -*-\n####!/bin/env python\n\"\"\"\nFour-channel USB Voltage and Thermocouple DAQ driver,\nResolution: 14-bit\nSampleling rate: 8000 Hz max\nRange: +/- 50 V to +/- 10 mV, in 3 steps per decade (1,2.5,5)\nbuild in cold junction compensation (CJC) for thermocouples\n\nReference:\nDI-245 Communicat... | [
[
"numpy.zeros",
"numpy.mean"
]
] |
joaopamaral/deep-learning-v2-pytorch | [
"baf6d0adfd79fc6d7418de9c0f2a52c44b6e3cfc"
] | [
"project-bikesharing/my_answers.py"
] | [
"import numpy as np\n\n\nclass NeuralNetwork(object):\n def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):\n # Set number of nodes in input, hidden and output layers.\n self.input_nodes = input_nodes\n self.hidden_nodes = hidden_nodes\n self.output_nodes = out... | [
[
"numpy.dot",
"numpy.random.normal",
"numpy.exp",
"numpy.zeros"
]
] |
AlfredoCU/Generalization | [
"28ba8710e99965eebfc21db91f60e3c33e4bd71e"
] | [
"model-linear.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 8 18:33:44 2020\n\n@author: alfredocu\n\"\"\"\n\n# Modelo lineal, caracteristicas polinomicas. sobreentrenamiento.\n\n# Bibliotecas.\nimport numpy as np\nimport numpy.random as rnd\nimport matplotlib.pyplot as plt\n\n# Algoritmos.\nfrom sk... | [
[
"numpy.random.seed",
"numpy.linspace",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.PolynomialFeatures",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"numpy.random.rand",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.axis",
"matplotlib... |
fadamsyah/final-project | [
"636aa6c5fbb84a1325b662c48b52b5065f4c16c5"
] | [
"Archieved FP/pkg_ta/scripts/Archieved/8 September 2020/lib_ta_py/new_ekf_imu_2d.py"
] | [
"import numpy as np\nfrom numba import float64, int64\nfrom numba.experimental import jitclass\n\nspec = [('p', float64[:]), ('v', float64[:]), ('yaw', float64),\n ('ba', float64[:]), ('bw', float64),\n ('Q', float64[:,:]), ('P', float64[:,:]), ('yawc', float64),\n ('H_gnss', float64[:,:]), ('H... | [
[
"numpy.dot",
"numpy.linalg.inv",
"numpy.eye",
"numpy.cos",
"numpy.sin",
"numpy.copy",
"numpy.array",
"numpy.zeros"
]
] |
kl2806/jiant | [
"1cae1e0c96d22ba906d7078b337aa986321c8c7f"
] | [
"jiant/trainer.py"
] | [
"\"\"\" Trainer \"\"\"\nimport copy\nimport glob\nimport itertools\nimport logging as log\nimport math\nimport os\nimport random\nimport re\nimport time\n\nimport numpy as np\nimport torch\nfrom allennlp.common import Params # pylint: disable=import-error\nfrom allennlp.common.checks import ConfigurationError # p... | [
[
"numpy.log",
"torch.isnan",
"torch.load",
"numpy.max",
"numpy.array_str",
"torch.no_grad",
"numpy.exp",
"numpy.array",
"torch.save"
]
] |
munnamila/ilcs_5 | [
"ecff852a29ba56ddba1e0b3687325781e3764311"
] | [
"code/04_keypoints_from_images.py"
] | [
"# From Python\n# It requires OpenCV installed for Python\nimport sys\nimport cv2\nimport os\nfrom sys import platform\nimport argparse\nimport time\nimport numpy as np\n\nimport func\n\ntry:\n # Import Openpose (Windows/Ubuntu/OSX)\n dir_path = os.path.dirname(os.path.realpath(__file__))\n try:\n #... | [
[
"numpy.zeros"
]
] |
101arrowz/clodius | [
"27197f61d75b3b837c0c57e4e526a23a34e08c73"
] | [
"clodius/tiles/bigbed.py"
] | [
"import bbi\nimport functools as ft\nimport logging\nimport numpy as np\nimport pandas as pd\nimport random\nimport clodius.tiles.bigwig as hgbi\nfrom .utils import abs2genomic, get_quadtree_depth\n\nfrom concurrent.futures import ThreadPoolExecutor\n\nDEFAULT_RANGE_MODE = \"significant\"\nMIN_ELEMENTS = 1\nMAX_ELE... | [
[
"numpy.quantile",
"pandas.Series"
]
] |
dmund95/CheerMeUp | [
"0cef7e204872158a7afd14d596d154e7089da491"
] | [
"models/feature_axis.py"
] | [
"\"\"\" module of functions related to discovering feature axis \"\"\"\n\nimport time\nimport numpy as np\nimport sklearn.linear_model as linear_model\n\n\n\ndef feature_axis(z, y, method = 'linear'):\n \n model = linear_model.LinearRegression()\n \n if method == 'linear':\n model = linear_model.... | [
[
"matplotlib.pyplot.gca",
"numpy.dot",
"numpy.abs",
"numpy.arange",
"numpy.linalg.norm",
"matplotlib.pyplot.colorbar",
"sklearn.linear_model.LinearRegression",
"numpy.tanh",
"matplotlib.pyplot.show"
]
] |
ShadenSmith/sparse | [
"c1a2bfaec2505e55f1ec0409a4df13a70b88cb90",
"c1a2bfaec2505e55f1ec0409a4df13a70b88cb90"
] | [
"sparse/coo/core.py",
"sparse/coo/common.py"
] | [
"import copy as _copy\nimport operator\nfrom collections import Iterable, Iterator, Sized, defaultdict, deque\nfrom functools import reduce\n\nimport numpy as np\nimport scipy.sparse\nfrom numpy.lib.mixins import NDArrayOperatorsMixin\n\nfrom .common import dot, matmul\nfrom .indexing import getitem\nfrom .umath im... | [
[
"numpy.true_divide",
"numpy.asarray",
"numpy.issubdtype",
"numpy.dtype",
"numpy.all",
"numpy.unique",
"numpy.add.reduce",
"numpy.logical_and.reduce",
"numpy.stack",
"numpy.full",
"numpy.flatnonzero",
"numpy.logical_or.reduce",
"numpy.asanyarray",
"numpy.diff... |
AngelRuizMoreno/Jupyter_Dock_devel | [
"6d23bc174d5294d1e9909a0a1f9da0713042339e"
] | [
"bin/ADFRsuite/CCSBpckgs/prody/atomic/atom.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"This module defines classes to handle individual atoms.\"\"\"\n\nimport numpy as np\n\nfrom . import flags\nfrom .fields import ATOMIC_FIELDS, READONLY\nfrom .fields import wrapGetMethod, wrapSetMethod\nfrom .pointer import AtomPointer\nfrom .bond import Bond\n\n__all__ = ['Atom']\n\... | [
[
"numpy.array"
]
] |
SHA256orBUST/GamestonkTerminal | [
"7a8a4f868c548505c36287d16f969e80daeed431"
] | [
"gamestonk_terminal/options/op_controller.py"
] | [
"\"\"\"Options Controller Module.\"\"\"\n__docformat__ = \"numpy\"\n\nimport argparse\nimport os\nfrom typing import List\nimport matplotlib.pyplot as plt\n\nfrom prompt_toolkit.completion import NestedCompleter\nfrom gamestonk_terminal.helper_funcs import get_flair\nfrom gamestonk_terminal import feature_flags as ... | [
[
"matplotlib.pyplot.close"
]
] |
carloslme/course-machinelearning-az | [
"44ac8e44579c11a02791ba7acaa71b90d5ab4e0a"
] | [
"datasets/Part 2 - Regression/Section 5 - Multiple Linear Regression/multiple_linear_regression_example_automatic.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jan 4 19:19:31 2020\n\n@author: Usuario\n\"\"\"\n\n\n# Regresion Lineal Multiple\n\n# =============================================================================\n# Cómo importar las librerías\n# ====================================================================... | [
[
"pandas.read_csv",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.LabelEncoder"
]
] |
raminBadri/python-DataMining | [
"7aa3623e16c82796c2b43c1133518c4227dba1c8"
] | [
"k-means by ramin badri.py"
] | [
"import pandas as pd\r\nimport nltk\r\nfrom nltk.stem.porter import *\r\nimport string\r\nfrom sklearn.feature_extraction.text import TfidfVectorizer\r\nfrom sklearn.cluster import KMeans\r\nimport os\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.manifold import MDS\r\nfrom sklearn.metrics.pairwise import cosi... | [
[
"sklearn.cluster.KMeans",
"sklearn.metrics.pairwise.cosine_similarity",
"matplotlib.pyplot.subplots",
"sklearn.manifold.MDS",
"matplotlib.pyplot.close",
"scipy.cluster.hierarchy.dendrogram",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tick_params",
"sklearn.feature_extraction.... |
snatchysquid/IML.HUJI | [
"4742dd4a3526577e3c297455440cafd4fb3497e9"
] | [
"exercises/house_price_prediction.py"
] | [
"from IMLearn.utils import split_train_test\nfrom IMLearn.learners.regressors import LinearRegression\n\nfrom typing import NoReturn\nimport numpy as np\nimport pandas as pd\nimport plotly.graph_objects as go\nimport plotly.express as px\nimport plotly.io as pio\npio.templates.default = \"simple_white\"\n\nfrom plo... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.to_datetime",
"numpy.random.seed",
"numpy.round",
"numpy.std",
"numpy.mean",
"numpy.zeros",
"pandas.get_dummies"
]
] |
clarencechen/CapsGen | [
"06840bf5b7ff23268020722473ef2e24a047dc40"
] | [
"snorbdata.py"
] | [
"import struct\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.misc\nfrom tqdm import tqdm\nfrom os import makedirs\nfrom os.path import join\nfrom os.path import exists\nfrom itertools import groupby\n\nclass SmallNORBExample:\n\n\tdef __init__(self):\n\t\tself.image_lt = None\n\t\tself.image_r... | [
[
"numpy.reshape",
"numpy.eye",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.subplots",
"numpy.random.permutation",
"matplotlib.pyplot.waitforbuttonpress",
"numpy.array",
"numpy.zeros"
]
] |
vpeopleonatank/segmentation | [
"6c93e14f465117ca1818e7d9cdd95ffc37e15f45",
"6c93e14f465117ca1818e7d9cdd95ffc37e15f45"
] | [
"src/models/pytorch_models_crf.py",
"src/losses/lovasz.py"
] | [
"# mypy: ignore-errors\nfrom typing import Tuple, Dict\n\nimport torch\nfrom torch import nn\nfrom torchcrf import CRF\n\nfrom src.models.layers.layers import SpatialDropout\n\n\nclass BiLSTMCRF(nn.Module):\n \"\"\"\n New model without nn.Embedding layer\n \"\"\"\n\n def __init__(\n self, tag_to_... | [
[
"torch.nn.LSTM",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.utils.rnn.pad_packed_sequence"
],
[
"torch.nn.functional.relu",
"torch.movedim",
"torch.sort",
"torch.autograd.Variable"
]
] |
gits00/raspberry-pi-computer-vision-programming | [
"dfd5588c5d3e410945f862427c0f987536b04d9f",
"dfd5588c5d3e410945f862427c0f987536b04d9f"
] | [
"Chapter07/programs/prog04.py",
"Chapter07/programs/prog02.py"
] | [
"import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nimg = cv2.imread('/home/pi/book/dataset/4.1.03.tiff', 0)\nimg = img.astype(np.float32)\nrow, col = img.shape\nrand_noise = np.random.randn(row, col)\nrand_noise = rand_noise.reshape(row, col)\nnoisy = img + img * rand_noise\nprint(abs(noisy-img))\npl... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"numpy.random.randn",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show"
],
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"numpy.random.normal",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show"
]
] |
shawnclq/Adversarial-Threat-Detector | [
"fb5cc98ed46138e6630989721f6b4481cf1879a5"
] | [
"util.py"
] | [
"#!/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport sys\nimport string\nimport random\nimport configparser\nimport numpy as np\nfrom datetime import datetime\nfrom PIL import Image\nfrom logging import getLogger, FileHandler, Formatter\n\n# torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom to... | [
[
"tensorflow.keras.models.load_model",
"numpy.amax",
"numpy.savez",
"torch.max",
"torch.load",
"torch.utils.data.DataLoader",
"torch.sum",
"numpy.max",
"numpy.mean",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"torch.nn.CrossEntropyLoss",
"num... |
katetolstaya/kernelrl | [
"963d72a4912faffeaab2627f16e6c103a7678fc4"
] | [
"algs/kq_tabular.py"
] | [
"import pickle\nimport random\n\nimport numpy as np\n\nfrom corerl.core import ScheduledParameter\n\n\n# ==================================================\n# A POLK Policy improvements Model\n\nclass KQTabModel(object):\n def __init__(self, config):\n\n # Learning rate\n self.eta = ScheduledParame... | [
[
"numpy.random.uniform",
"numpy.random.normal",
"numpy.array",
"numpy.argmax"
]
] |
dreaquil/cvat | [
"156ddae1224713d12ed3cb24768827651ab2b139"
] | [
"cvat/apps/engine/media_extractors.py"
] | [
"# Copyright (C) 2019-2020 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport os\nimport tempfile\nimport shutil\nimport zipfile\nimport io\nimport itertools\nimport struct\nfrom abc import ABC, abstractmethod\nfrom contextlib import closing\n\nimport av\nimport numpy as np\nfrom pyunpack import Archive... | [
[
"numpy.asarray",
"numpy.array"
]
] |
kendrick90/iPERCore | [
"fe78f311bae32d9441f249452347faa9656a5658"
] | [
"iPERCore/tools/utils/visualizers/skeleton_visualizer.py"
] | [
"# Copyright (c) 2020-2021 impersonator.org authors (Wen Liu and Zhixin Piao). All rights reserved.\n\nimport numpy as np\nimport cv2\nfrom tqdm import tqdm\n\nfrom ..multimedia.video import convert_avi_to_mp4\n\n\ncolors = {\n \"pink\": [197, 27, 125], # L lower leg\n \"Violet\": [238, 130, 238],\n \"Dar... | [
[
"numpy.issubdtype",
"numpy.array",
"numpy.transpose"
]
] |
feketeimre/pyqtgraph | [
"b421cc27905338438e99cf19d4962c51e64079bd"
] | [
"pyqtgraph/exporters/ImageExporter.py"
] | [
"from .Exporter import Exporter\nfrom ..parametertree import Parameter\nfrom ..Qt import QtGui, QtCore, QtSvg, USE_PYSIDE\nfrom .. import functions as fn\nimport numpy as np\n\n__all__ = ['ImageExporter']\n\nclass ImageExporter(Exporter):\n Name = \"Image File (PNG, TIF, JPG, ...)\"\n allowCopy = True\n \n... | [
[
"numpy.empty"
]
] |
maheshsoundar/mldeveloper | [
"c43aafc8a0d4e9c126b95c5b6bc7da1c5ae655cf"
] | [
"mldeveloper/src/generate_features.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Dec 15 21:55:28 2019\r\n\r\n@author: maheshsoundar\r\n\"\"\"\r\n\r\nimport pandas as pd\r\nimport random\r\nimport numpy as np\r\nfrom sklearn.decomposition import PCA\r\nfrom .ml_classes.ml_poly import MLPolyFeat\r\nfrom .ml_classes.ml_scaler import MLScaler\r\n... | [
[
"numpy.array",
"sklearn.decomposition.PCA",
"numpy.random.seed"
]
] |
glarbi/Real-time-object-detection | [
"ae9254f21d87fb6cd70891811b1773f81fcef51e"
] | [
"train.py"
] | [
"import cv2\nimport torch\nimport config\nimport warnings\nfrom utils import (\n mean_average_precision,\n get_evaluation_bboxes,\n check_class_accuracy,\n save_checkpoint,\n load_checkpoint,\n get_loaders\n)\nfrom tqdm import tqdm\nfrom model import Yolo\nimport torch.optim as optim\nfrom loss im... | [
[
"torch.tensor",
"torch.cuda.amp.GradScaler",
"torch.cuda.amp.autocast"
]
] |
zhangguobin/fast-neural-style | [
"eefdcc3b6ba5e92bbad24cd20999c71dde4df072"
] | [
"modules/gram_matrix.py"
] | [
"import tensorflow as tf\n\n# see the paper A Neural Algorithm of Artistic Style \n# by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge\ndef gram_matrix(features, normalize=True):\n \"\"\"\n Compute the Gram matrix from features.\n The Gram matrix is an approximation to the covariance matrix\n --... | [
[
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.shape",
"tensorflow.cast",
"tensorflow.reshape"
]
] |
Lemon-L7/efficient-pytorch-ship | [
"05b50517ad00c01ab513e53832e9dd25edace7a0"
] | [
"utils/anchors.py"
] | [
"import itertools\nimport torch\nimport torch.nn as nn\nimport numpy as np\n\nclass Anchors(nn.Module):\n def __init__(self, anchor_scale=4., pyramid_levels=None):\n super().__init__()\n self.anchor_scale = anchor_scale\n\n if pyramid_levels is None:\n self.pyramid_levels = [3, 4,... | [
[
"numpy.swapaxes",
"numpy.expand_dims",
"numpy.meshgrid",
"numpy.arange",
"torch.from_numpy",
"numpy.concatenate",
"numpy.array",
"numpy.vstack"
]
] |
Sprog-gle/Magenta | [
"6d8fac346649596c46f4cb35e27b6bdd3db7aa85"
] | [
"magenta/music/sequence_generator_test.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 appli... | [
[
"tensorflow.test.main"
]
] |
shuaijiang/athena-2 | [
"5d4d6d13075b8ee9fd824ce6258cb8f55dd157eb"
] | [
"athena/models/deep_speech_conv4_pb.py"
] | [
"# Copyright (C) 2019 ATHENA AUTHORS; Xiangang Li\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 appli... | [
[
"tensorflow.nn.log_softmax",
"tensorflow.nn.relu6",
"tensorflow.cast",
"tensorflow.identity",
"tensorflow.keras.Model",
"tensorflow.math.ceil"
]
] |
VisionLearningGroup/SND | [
"6aae970724ebb2c7d4e7c894be20a954079fc48c"
] | [
"nc_ps/models/resnet.py"
] | [
"import torch\nimport torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\n\n\n\nmodel_urls = {\n 'resnet18': 'https://s3.amazonaws.com/pytorch/models/resnet18-5c106cde.pth',\n 'resnet34': 'https://s3.amazonaws.com/pytorch/models/resnet34-333f7ec4.pth',\n 'resnet50': 'https://s3.amazonaw... | [
[
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.Linear",
"torch.nn.InstanceNorm2d",
"torch.FloatTensor",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.utils.model_zoo.load_url"
]
] |
tjkuson/forecaster | [
"c3e4f52af8a10cf95f9cbb3ccadb9495a56e4ba2"
] | [
"mr_forecast.py"
] | [
"import numpy as np\nfrom scipy.stats import norm\nfrom scipy.stats import truncnorm \nimport h5py \n\n## constant\nmearth2mjup = 317.828\nmearth2msun = 333060.4\nrearth2rjup = 11.21\nrearth2rsun = 109.2\n\n## boundary\nmlower = 3e-4\nmupper = 3e5\n\n## number of category\nn_pop = 4\n\n## read parameter file\nhyper... | [
[
"numpy.ones_like",
"numpy.random.random",
"numpy.linspace",
"numpy.random.choice",
"numpy.min",
"numpy.median",
"numpy.percentile",
"numpy.max",
"numpy.log10",
"numpy.shape",
"numpy.array",
"scipy.stats.truncnorm.rvs"
]
] |
Mohanned-Elkholy/Pix2Pix-From-pencil-drawings-to-real-image | [
"5b7eb5f34bc3eb71ab079bbf70a7d73c2f9dca46"
] | [
"src/results_functions/utils.py"
] | [
"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nfrom google.colab.patches import cv2_imshow\nfrom keras.applications.inception_v3 import InceptionV3\nfrom keras.applications.inception_v3 import preprocess_input\nfrom math import floor\nfrom keras.datasets import cifar10\nimport kera... | [
[
"matplotlib.pyplot.imshow",
"numpy.sqrt",
"numpy.min",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplot",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
tilacyn/dsb2018_topcoders | [
"867f5f357179e1c033b50cd93571859b97ad5c22"
] | [
"albu/src/pytorch_utils/callbacks.py"
] | [
"import torch\nfrom copy import deepcopy\nimport os\nfrom tensorboardX import SummaryWriter\nfrom torch.optim.lr_scheduler import _LRScheduler\nfrom bisect import bisect_right\n\nclass Callback(object):\n \"\"\"\n Abstract base class used to build new callbacks.\n \"\"\"\n\n def __init__(self):\n ... | [
[
"torch.save"
]
] |
huikyole/climate | [
"7187cf306877ea471335d8d22704bee7653342e9"
] | [
"examples/simple_model_to_model_bias.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.arange"
]
] |
OmriStein/me-toolbox | [
"254b11538fbf0243f36d5dd7dac28867f213797b"
] | [
"me_toolbox/gears/helical_gear.py"
] | [
"\"\"\"Module containing the HelicalGear class\"\"\"\n# I want the variables names to be the same as in AGMA pylint: disable=invalid-name\nfrom math import sin, cos, radians, pi, tan, atan, sqrt, degrees\nimport os\nimport numpy as np\nfrom me_toolbox.gears import SpurGear # for inheritance\nfrom me_toolbox.tools ... | [
[
"numpy.genfromtxt"
]
] |
hxlnwpu/Sentence_pair_modeling | [
"e0324711e27694ad22e070a118697184d23bca58"
] | [
"Models/RE2/modules/fusion.py"
] | [
"# coding=utf-8\n# Copyright (C) 2019 Alibaba Group Holding Limited\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... | [
[
"torch.nn.functional.dropout",
"torch.cat"
]
] |
gibbons/scikit-rf | [
"7d83373bfd1c27e9a06e1ea97763a6092daa011f"
] | [
"skrf/vi/sa.py"
] | [
"\r\n\r\n'''\r\n.. module:: skrf.vi.sa\r\n=================================================================\r\nSpectrum Analyzers (:mod:`skrf.vi.sa`)\r\n=================================================================\r\n\r\n\r\n.. autosummary::\r\n :toctree: generated/\r\n\r\n HP8500\r\n'''\r\n\r\n\r\nimpo... | [
[
"numpy.array"
]
] |
Haydn-Robinson/Python-Machine-Learning | [
"585f9cd5ca81ef043b2b56879bf4ab95475ed52f"
] | [
"src/hrpyml/utilities/preprocessing.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom math import floor\n\n# Splits pandas dataframe into two numpy arrays of input and target data\ndef dataframe_to_inputs_targets(dataframe, input_count, target_count=1, input_start=0, target_start=None):\n \"\"\"\n dataframe_to_inputs_targets(dataframe, input_colum... | [
[
"numpy.unique",
"numpy.arange",
"numpy.std",
"numpy.mean",
"numpy.argsort",
"numpy.zeros"
]
] |
juniwang/tensorflow-hw | [
"212223b2ea4ffe4f91e7ce2b55ba4f9c6797f767",
"212223b2ea4ffe4f91e7ce2b55ba4f9c6797f767"
] | [
"19_saver.py",
"21_autoencoder.py"
] | [
"# disable warnings which are just informing you if you build TensorFlow from source it can be faster on your machine.\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\n\nimport tensorflow as tf\nimport numpy as np\n\n## save to file\n## remember to define the same dtype and shape when restore\n# W = tf.Variable(... | [
[
"tensorflow.train.Saver",
"numpy.arange",
"tensorflow.Session"
],
[
"tensorflow.matmul",
"tensorflow.__version__.split",
"tensorflow.pow",
"numpy.reshape",
"matplotlib.pyplot.subplots",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow... |
stjordanis/forest-benchmarking | [
"f9ad9701c2d253de1a0c922d7220ed7de75ac685",
"f9ad9701c2d253de1a0c922d7220ed7de75ac685"
] | [
"forest/benchmarking/plotting/hinton.py",
"forest/benchmarking/operator_tools/project_superoperators.py"
] | [
"import numpy as np\nfrom typing import List\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nimport matplotlib as mpl\nfrom matplotlib.colors import Normalize\n\nANGLE_MAPPER = cm.ScalarMappable(norm=Normalize(vmin=-np.pi, vmax=np.pi))\n\n\n# Modified from the SciPy Cookbook.\ndef hinton(matrix, max_we... | [
[
"numpy.matrix",
"matplotlib.colors.BoundaryNorm",
"numpy.sqrt",
"numpy.arctan2",
"matplotlib.pyplot.gca",
"matplotlib.colorbar.ColorbarBase",
"numpy.real",
"matplotlib.pyplot.NullLocator",
"numpy.log",
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.fill",
"n... |
its-dron/models | [
"3dacd474364813781c0154d881055502ce09d79c"
] | [
"official/vision/beta/modeling/backbones/mobilenet.py"
] | [
"# Copyright 2021 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.keras.Input",
"tensorflow.keras.backend.image_data_format",
"tensorflow.keras.layers.Conv2D",
"tensorflow.identity",
"tensorflow.keras.utils.register_keras_serializable"
]
] |
luke-stpierre/lstp-ds34-spotapp | [
"ffa4c3758bd44d8ee0366697c46b192c16f5de20"
] | [
"backapp/backapp/model.py"
] | [
"import tensorflow as tf\nfrom backapp.list_var import SONG_LIST, SONG_URI_KEY\nimport pandas as pd\nimport numpy as np\n\n# Loading the pre-built model \nMODEL = tf.keras.models.load_model('/app/backapp/music_autoencoder')\n\n\ndef transform(data_dict):\n # Create empty dictionary\n query_df = pd.DataFrame(d... | [
[
"tensorflow.keras.models.load_model",
"numpy.zeros",
"pandas.DataFrame"
]
] |
bayesimpact/readmission-risk | [
"5b0f6c93826601e2dbb9c8c276e92801772e17c4"
] | [
"features/extraction/3_extraction/feature_extractors/admission.py"
] | [
"\"\"\"A feature extractor for admission.\"\"\"\n\nfrom __future__ import absolute_import\n\nimport pandas as pd\n\nfrom sutter.lib import postgres\nfrom sutter.lib.feature_extractor import FeatureExtractor\n\n\nclass AdmissionExtractor(FeatureExtractor):\n \"\"\"\n Generates features related to admission cir... | [
[
"pandas.read_sql"
]
] |
apmcleod/pretty-midi | [
"66e44ab2abacefa62a989cc99dc798f753b5235e"
] | [
"pretty_midi/pretty_midi.py"
] | [
"\"\"\"Utility functions for handling MIDI data in an easy to read/manipulate\nformat\n\n\"\"\"\nfrom __future__ import print_function\n\nimport mido\nimport numpy as np\nimport math\nimport warnings\nimport collections\nimport copy\nimport functools\nimport six\n\nfrom .instrument import Instrument\nfrom .containe... | [
[
"numpy.dot",
"numpy.asarray",
"numpy.concatenate",
"numpy.max",
"numpy.argmin",
"numpy.searchsorted",
"numpy.unique",
"numpy.arange",
"numpy.argmax",
"numpy.diff",
"numpy.interp",
"numpy.zeros",
"numpy.isclose",
"numpy.append",
"numpy.argsort",
"nump... |
rmkeezer/groupme_stats | [
"c5909c444908fa391c7c97b1b26a8eab08bf9bea"
] | [
"imgmarkov.py"
] | [
"from PIL import Image\nimport numpy as np\nimport pyprind\nimport random\nimport os\nimport pygame\nfrom collections import defaultdict, Counter\n\n\nclass MarkovChain(object):\n def __init__(self, bucket_size=10, four_neighbour=True):\n self.weights = defaultdict(Counter)\n self.bucket_size = buc... | [
[
"numpy.random.choice",
"numpy.array",
"numpy.random.shuffle",
"numpy.random.randint"
]
] |
hatake77/MWP-stackLSTM | [
"20e58c9f9635c526d2bcf000a74086229cfc9489"
] | [
"src/train/pre_seq2eq_trainer.py"
] | [
"import sys\nimport random\nimport numpy as np\nimport json\nsys.path.append('/home/demolwang/demolwang/math_word_problem/critical-based/auto_mwp/seq2seq_v2/src')\nfrom model import EncoderRNN, DecoderRNN_1, Seq2seq\nfrom utils import NLLLoss, Optimizer, Checkpoint, Evaluator\n\nimport torch\nfrom torch import opti... | [
[
"torch.manual_seed",
"torch.LongTensor",
"numpy.array",
"torch.cat"
]
] |
makar21/core | [
"e6a0c8d5456567dd3139ee3fd3cf6cd4acdd4a05"
] | [
"examples/torch/cifar10/resnet_fastai.py"
] | [
"from torch import nn\nimport math\nfrom tatau_core.nn.torch import model\nimport torch.optim as optim\nfrom torchvision import transforms\n\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,\n ... | [
[
"torch.nn.Sequential",
"torch.nn.CrossEntropyLoss",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
wbengine/lingvo | [
"4891d579a0110df9c49994b5b8142723c5d9fb49"
] | [
"lingvo/tasks/asr/decoder.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.concat",
"tensorflow.nn.log_softmax",
"tensorflow.reduce_sum",
"tensorflow.stack",
"tensorflow.minimum",
"tensorflow.to_int32",
"tensorflow.summary.scalar",
"tensorflow.while_loop",
"tensorflow.stop_gradient",
... |
isbobby/CS4278-5478-Project-Materials | [
"31d8619f33d79cbf9eb8e8d1ae1d60395679ae25"
] | [
"example.py"
] | [
"import argparse\n\nimport cv2\nimport numpy as np\nfrom gym_duckietown.envs import DuckietownEnv\n# declare the arguments\nparser = argparse.ArgumentParser()\n\n# Do not change this\nparser.add_argument('--max_steps', type=int, default=1500, help='max_steps')\n\n# You should set them to different map name and seed... | [
[
"numpy.savetxt",
"numpy.loadtxt"
]
] |
ozmig77/StyleCLIP-1 | [
"57b887bba971ef86c107f4805785ce44fca3efef"
] | [
"optimization/run_optimization.py"
] | [
"import argparse\nimport math\nimport os\n\nimport torch\nimport torchvision\nfrom torch import optim\nfrom tqdm import tqdm\n\nfrom criteria.clip_loss import CLIPLoss\nfrom criteria.id_loss import IDLoss\nfrom mapper.training.train_utils import STYLESPACE_DIMENSIONS\nfrom models.stylegan2.model import Generator\ni... | [
[
"torch.optim.Adam",
"torch.load",
"torch.cat",
"torch.randn",
"torch.no_grad"
]
] |
KirillYashin/dpctl | [
"00bc959877eb91169be78ef968ed558dd07ae180"
] | [
"dpctl/tensor/_reshape.py"
] | [
"# Data Parallel Control (dpctl)\n#\n# Copyright 2020-2021 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.or... | [
[
"numpy.unravel_index",
"numpy.zeros",
"numpy.prod",
"numpy.ravel_multi_index"
]
] |
vaishnavighiradkar/pytorch | [
"2431218ee4ac1d2f016188c29869d817f6e3c70c"
] | [
"test/test_jit.py"
] | [
"# -*- coding: utf-8 -*-\n# Owner(s): [\"oncall: jit\"]\n\nimport torch\n\n# This is how we include tests located in test/jit/...\n# They are included here so that they are invoked when you call `test_jit.py`,\n# do not run these test files directly.\nfrom jit.test_tracer import TestTracer, TestMixTracingScripting ... | [
[
"torch.BoolTensor",
"torch.jit.load",
"torch.randint",
"torch.lu_unpack",
"torch._C.PyTorchFileWriter",
"torch.testing._internal.jit_utils.get_execution_plan",
"torch.zeros",
"torch.nn.functional.dropout",
"torch.max",
"torch.nn.GRU",
"torch.neg",
"torch.testing._in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.