repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
krematas/scanner | [
"1fc94a908e1059b60d0f10872324f183d3f00514"
] | [
"examples/apps/soccer/depth/estimate_depth.py"
] | [
"import scannerpy\nimport numpy as np\nimport os\nfrom scannerpy import Database, DeviceType, Job, ColumnType, FrameType\n\nfrom os.path import join\nimport glob\n\nimport torch\nimport torch.nn as nn\nfrom torchvision import transforms\n\nfrom hourglass import hg8\nimport matplotlib.pyplot as plt\nfrom scipy.misc ... | [
[
"torch.nn.LogSoftmax",
"scipy.misc.imresize",
"torch.from_numpy",
"numpy.argmax",
"torch.load"
]
] |
qq1418381215/caat | [
"1422707bef7a2aeca272fa085f410bff07ced760"
] | [
"warp_transducer/pytorch_binding/tune_rnnt.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom warprnnt_pytorch import DelayTLoss, RNNTLoss\nimport time\ndevice=0\nimport os,psutil\n\nprocess = psutil.Process(os.getpid())\n\n\ndef main(src_len=1000, tgt_len=100, voc=30000, bsz=1):\n \n cuda= True\n rnnt_loss=DelayTLoss(blank=0, delay_scale=1., red... | [
[
"torch.rand",
"torch.cuda.memory_summary",
"torch.manual_seed",
"torch.abs",
"torch.randn"
]
] |
zkzcx/RFFnet | [
"8981a22956b37405c3bb5e465f1d99fbe92ab536"
] | [
"train_test_vgg.py"
] | [
"from __future__ import print_function\n\nimport argparse\nimport pickle\nimport time\n\nimport numpy as np\nimport os\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn.init as init\nimport torch.optim as optim\nimport torch.utils.data as data\nfrom torch.autograd import Variable\n\nfrom data imp... | [
[
"torch.zeros",
"numpy.empty",
"torch.nn.init.xavier_uniform",
"torch.no_grad",
"torch.randperm",
"torch.ones",
"numpy.where",
"numpy.random.beta",
"torch.utils.data.DataLoader",
"torch.load",
"numpy.sort",
"numpy.hstack",
"torch.Tensor"
]
] |
Skeftical/modelbasedaqp | [
"1dbba997c16493e0344aaa95901f3de5e670c352",
"5f49653e48fc5a4ec1f1eb44e2a96787876681f4"
] | [
"code/Performance_Storage/verdict-perf-build-samples.py",
"sql_parser/parser.py"
] | [
"import pyverdict\nimport argparse\nimport logging\nimport os\nimport sys\nimport time\nimport pandas as pd\nimport pickle\nimport re\nos.chdir('../../')\n#print(os.listdir('.'))\nsys.path.append('.')\n\nif not os.path.exists('output/performance'):\n print('creating ', 'performance')\n os.makedirs('ou... | [
[
"pandas.DataFrame"
],
[
"scipy.sparse.csr_matrix"
]
] |
LiQiang0307/yolov4-pytorch | [
"06e5a1bdb8700b58820db9403b639b7311434fc9"
] | [
"train.py"
] | [
"#-------------------------------------#\r\n# 对数据集进行训练\r\n#-------------------------------------#\r\nimport os\r\nimport time\r\n\r\nimport numpy as np\r\nimport torch\r\nimport torch.backends.cudnn as cudnn\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport torch.optim as optim\r\nfrom tor... | [
[
"numpy.array",
"torch.optim.lr_scheduler.StepLR",
"numpy.reshape",
"numpy.random.seed",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.no_grad",
"numpy.random.shuffle",
"numpy.shape",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
... |
shreyanshsatvik/cardetection_and_localization | [
"38f70442de310abb193b53083482078c094aff2e"
] | [
"yolonew.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Apr 27 14:15:06 2020\r\n\r\n@author: Shreyansh Satvik\r\n\"\"\"\r\nfrom keras.models import load_model\r\nfrom glob import glob\r\nimport argparse\r\nimport os\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.pyplot import imshow\r\nimport scipy.io\r\nimport... | [
[
"tensorflow.variables_initializer",
"tensorflow.boolean_mask",
"tensorflow.image.non_max_suppression",
"matplotlib.pyplot.imshow"
]
] |
lesepuise/cryptHero | [
"2d4157d5f0a3afee440bc74d2199543b50aac8f9"
] | [
"map_objects/generator.py"
] | [
"import copy\nimport random\n\nimport numpy as np\nimport tcod\n\n\nclass BSPGenerator():\n def __init__(self, width, height):\n self.width = width\n self.height = height\n self.bsp = tcod.bsp.BSP(1, 1, width - 1, height - 1)\n self.map = np.zeros(\n (width, height), dtype=... | [
[
"numpy.zeros"
]
] |
SysBioChalmers/Multi_scale_evolution | [
"b5f28ead733872519bc0758df034a076224c4253"
] | [
"evolution_analysis/code/ortholog_subset/Z4_Extract_non_duplicated_seq_from_OGs.py"
] | [
"#!/usr/bin/python\n\n# Note\n# The script is to analyze the duplicated gene seq for the 1011 sce sequence project.\n\nimport os\nimport pandas as pd\n\ninput0 = \"/media/luhongzhong/newdisk/Genomics_data/cds_align_unify/\"\nos.system(\"mkdir /media/luhongzhong/newdisk/Genomics_data/cds_align_unify_remove_duplicate... | [
[
"pandas.DataFrame"
]
] |
YurongYou/Hindsight | [
"94b3d2a388d357b0abf01192088f6f7d7de16aa6"
] | [
"downstream/OpenPCDet/tools/train.py"
] | [
"import argparse\nimport datetime\nimport glob\nimport os\nfrom pathlib import Path\nfrom test import repeat_eval_ckpt\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nfrom tensorboardX import SummaryWriter\nimport wandb\n\nfrom pcdet.config import cfg, cfg_from_list, cfg_from_yaml_file, lo... | [
[
"torch.nn.SyncBatchNorm.convert_sync_batchnorm",
"torch.cuda.device_count"
]
] |
victor-marchesini/covid | [
"454fd525c462c1a199322d96eed897eab8da36fe"
] | [
"_notebooks/update_srag_database.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\nimport os\nimport sqlite3 as sql\nimport pandas as pd\n\nfrom srag_functions import *\n\n\n# In[2]:\n\n\n# df_srag = get_srag_data(years=[2019,2020,2021],update=False,treat=True,save_local=True)\n\nframes = []\nfor year in [2019,2020,2021]:\n df = get_srag_d... | [
[
"pandas.concat"
]
] |
ruanyangry/Machine-Learning-in-Materials-Characterization | [
"ac00fddd1dee0745079deefd4e13a4ea0d631815"
] | [
"FFT-Filter-STEM/scripts/pycroscopy-fft.py"
] | [
"# _*_ coding:utf-8 _*_\r\n\r\n'''\r\nAuthor: Ruan Yang\r\nEmail: ruanyang_njut@163.com\r\n\r\nReference: https://pycroscopy.github.io/pycroscopy/auto_examples/\\\r\nplot_fft_2d_filtering.html#sphx-glr-auto-examples-plot-fft-2d-filtering-py\r\n\r\nPurpose: FFT & Filtering of Atomically Resolved Images\r\n\r\nFFT ad... | [
[
"numpy.array",
"numpy.sin",
"numpy.fft.fft2",
"matplotlib.pyplot.savefig",
"numpy.fft.ifftshift",
"numpy.real",
"numpy.shape",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.loadtxt",
"numpy.abs",
"numpy.sqrt",
"numpy.fft.fftshift",
"matplotlib.pyplot.sh... |
guildai/guild-cli | [
"d3db493fb7a4952a334684e36578dd4b18afa124"
] | [
"examples/tensorflow-versions/summary1.py"
] | [
"# Uses TF 1.x summary writer to log a scalar.\n#\n# Guild should extend the logged data with system scalars.\n\nimport sys\n\nimport tensorflow as tf\n\nassert len(sys.argv) >= 2, \"usage: summary1.py LOGDIR\"\n\nwriter = tf.summary.FileWriter(sys.argv[1])\n\n\ndef scalar_summary(tag, val):\n return tf.Summary(... | [
[
"tensorflow.summary.FileWriter",
"tensorflow.Summary.Value"
]
] |
suhitaghosh10/UATS | [
"fe295ca2e16e1b7404398b3b62e404778900d958",
"fe295ca2e16e1b7404398b3b62e404778900d958"
] | [
"dataset_specific/kits/generate_data_uats.py",
"dataset_specific/prostate/expts/prostate_temporal.py"
] | [
"import os\nfrom shutil import copyfile\n\nimport numpy as np\n\nfrom dataset_specific.kits import utils\n\nroot_path = '/cache/suhita/data/kits/'\nperc = 1.0\n# training\n\n\nfold_num = 1\nlabelled_path = '/data/suhita/temporal/kits/preprocessed_labeled_train'\nlabelled_fold_num = '/data/suhita/temporal/kits/Folds... | [
[
"numpy.random.seed",
"numpy.load",
"numpy.random.shuffle"
],
[
"tensorflow.compat.v1.ConfigProto"
]
] |
ichcanziho/SentimentAnalysisForClimateChange | [
"7e1d7dc95b4db5fac1fbef97c1adf20041a29717"
] | [
"core/corr_caus.py"
] | [
"###############################################################################\n# Functions to perform Spearman N-lag cross correlation of the sentiment time #\n# lines. Saves the obtained correlation matrices as SVG files. Also obtains #\n# the Granger causality between the time series. ... | [
[
"numpy.zeros_like",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"numpy.triu_indices_from",
"numpy.min",
"matplotlib.pyplot.figure",
"pandas.concat",
"pandas.read_csv"
]
] |
MarioCSilva/Space_Saving_Count | [
"eee32865e390bc10d81881cff836557e679fe261"
] | [
"src/tests.py"
] | [
"from collections import defaultdict\nfrom exact_counter import ExactCounter\nfrom space_saving_counter import SpaceSavingCounter\nimport time\nfrom math import sqrt\nfrom tabulate import tabulate\nfrom utils import *\nimport matplotlib.pyplot as plt\n\n\nclass Test():\n def __init__(self, fname=\"datasets/en_bi... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks"
]
] |
yhhhli/pytorch-cifar | [
"699c68a3b77e780591539d1a5d1a1d96bc63d0fb"
] | [
"weight_scale.py"
] | [
"from torch.nn.parameter import Parameter\nfrom torch import _weight_norm, norm_except_dim\nimport torch\n\nclass WeightScale(object):\n def __init__(self, name, dim):\n if dim is None:\n dim = -1\n self.name = name\n self.dim = dim\n\n def compute_weight(self, module):\n ... | [
[
"torch.nn.parameter.Parameter"
]
] |
OpheliaLjh/analytics-zoo | [
"bb3aa8cf8d109df960b352b1bdee23ef98c2a25a"
] | [
"pyzoo/test/zoo/orca/automl/autoestimator/test_autoestimator_keras.py"
] | [
"#\n# Copyright 2018 Analytics Zoo Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"tensorflow.keras.optimizers.SGD",
"numpy.random.rand",
"tensorflow.keras.layers.Dense"
]
] |
prisae/empymod | [
"c01eae0ac51b37864c0b68bf0c207c1bd7c7e585"
] | [
"examples/educational/random_noise_f_domain.py"
] | [
"r\"\"\"\nAdding random noise to frequency-domain CSEM data\n=================================================\n\nAdding random noise to frequency-domain CSEM data is not a trivial task, and\nthere are many different ways how it can be done. The problem comes from the\nfact that we live in the time domain, we do ou... | [
[
"numpy.array",
"numpy.ones",
"numpy.random.default_rng",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.use",
"numpy.linspace",
"numpy.logspace"
]
] |
arsen-sheverdin/CloakingNet | [
"5c2b882dcff3c6347eeacb53270690fb6fefa301"
] | [
"model.py"
] | [
"\nimport torch\nfrom torch import nn\nclass NN(nn.Module):\n def __init__(self, layer_size ):\n super(NN, self).__init__()\n self.main = nn.Sequential(\n# nn.BatchNorm1d(151),\n nn.Linear(151,layer_size),\n nn.LeakyReLU(0.3),\n# nn.BatchNorm1d(self... | [
[
"torch.nn.init.xavier_uniform",
"torch.nn.LeakyReLU",
"torch.nn.Linear"
]
] |
etspaceman/spark | [
"155a67d00cb2f12aad179f6df2d992feca8e003e"
] | [
"python/pyspark/sql/dataframe.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.DataFrame.from_records"
]
] |
simoncometto/PID | [
"b6ea1c4ff44f64cae6c0f90542bcda5de5599de1"
] | [
"PID.py"
] | [
"import numpy as np\nfrom time import time\nimport matplotlib.pyplot as plt\n\nclass pid:\n '''\n \"Dsicret PID controller\"\n '''\n\n def __init__(self,\n Kp=1.0, Ki=0, Kd=0,\n setpoint=0,\n output_limits=(None, None),\n integrate_meth... | [
[
"numpy.concatenate",
"numpy.zeros",
"matplotlib.pyplot.step",
"matplotlib.pyplot.legend",
"numpy.roll",
"numpy.arange",
"matplotlib.pyplot.show"
]
] |
silky/QuCumber | [
"f0dd8725b8dd3a0c94f10f1a3b88a769c63a567f"
] | [
"tests/grads_utils.py"
] | [
"# Copyright 2018 PIQuIL - All Rights Reserved\n\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Ap... | [
[
"torch.zeros",
"numpy.array",
"torch.tensor",
"torch.stack"
]
] |
findepi/spark | [
"1a3f621c20a1be0670b59a692e0ea5297dd6202f"
] | [
"python/pyspark/pandas/indexes/base.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.Index",
"pandas.api.types.is_list_like",
"pandas.api.types.is_hashable",
"pandas.api.types.is_interval_dtype",
"pandas.api.types.is_float_dtype",
"pandas.core.accessor.CachedAccessor",
"pandas.api.types.is_numeric_dtype",
"pandas.io.formats.printing.pprint_thing",
"pand... |
ponxosio/Dynamic-communitie-Immigrants-MOGA | [
"990a7e00a24b574be4d135eeee5ef08af3a86c49"
] | [
"jupyter_home/sources/gas/dcd_gas_immigrants_combine_reparators.py"
] | [
"import math\n\nimport numpy as np\nfrom deap import tools\n\nimport sources.gas.auxiliary_funtions as auxf\nfrom sources.gas import RANDOM, IMMIGRANT\nfrom sources.gas.dynamic_communities_ga_standard import DynamicCommunitiesGAStandard\nfrom sources.gas.dcd_gas_immigrants_combine_reparators_config import DCDGasImm... | [
[
"numpy.array",
"numpy.zeros"
]
] |
xhabara/quickai | [
"212b6b83d01e5ffdfa2f1f9740547886aec4b077"
] | [
"quickai/yolo/detect.py"
] | [
"\"\"\"\nfrom quickai import YOLOV4\n\"\"\"\n\nimport time\nimport numpy as np\nimport cv2\nimport tensorflow as tf\n# noinspection PyUnresolvedReferences\nfrom tensorflow.compat.v1 import InteractiveSession\n# noinspection PyUnresolvedReferences\nfrom tensorflow.compat.v1 import ConfigProto\nfrom PIL import Image\... | [
[
"numpy.array",
"tensorflow.shape",
"numpy.asarray",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.InteractiveSession",
"tensorflow.lite.Interpreter",
"tensorflow.constant",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.saved_model.load"
]
] |
lql341/BladeDISC | [
"94342afbfb2a94cfc412d7b0fc776de768e5448d"
] | [
"pytorch_blade/tests/mlir/test_disc_tensor.py"
] | [
"# Copyright 2021 The BladeDISC Authors. All rights reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applic... | [
[
"torch.randint",
"torch.cat",
"torch.tensor",
"torch.randn"
]
] |
CesareMagnetti/RL | [
"cd77e3b4f8ecaa1ca0131cdf60c2381478a252e0"
] | [
"src/RL/agent.py"
] | [
"import torch, os, six, random\nimport numpy as np\nfrom abc import abstractmethod, ABCMeta\n\n\n@six.add_metaclass(ABCMeta)\nclass BaseAgent(object):\n \"\"\"\n base class for all agents\n \"\"\"\n\n def __init__(\n self,\n name,\n trainer,\n action_size,\n n_episodes... | [
[
"torch.no_grad",
"numpy.arange",
"torch.argmax"
]
] |
cvangysel/cuNVSM | [
"3663244fce84dd83816df2ed71b94cc4ebb78a18"
] | [
"py/nvsm/base.py"
] | [
"import h5py\nimport heapq\nimport itertools\nimport numpy as np\nimport logging\nimport scipy.spatial.distance\nimport sklearn.neighbors\n\nfrom cvangysel import sklearn_utils\nfrom nvsm_pb2 import Metadata\n\n\ndef load_meta(path):\n meta = Metadata()\n\n with open('{}_meta'.format(path), 'rb') as f_meta:\n... | [
[
"numpy.dot",
"numpy.log",
"numpy.mean",
"numpy.power",
"numpy.average",
"numpy.vstack"
]
] |
fdelgados/Disaster-Response-Pipeline-Project | [
"9c2c74f74f8b6d55ed09056debc6ab5aeb2f37da"
] | [
"data/process_data.py"
] | [
"import re\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\n\ndef load_data(messages_filepath, categories_filepath):\n \"\"\"Loads messages and categories data and creates a merged dataframe\n\n Args:\n messages_filepath (str): Path to the messages file\n ... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
DemoUser11221/jax | [
"a7e2f170a4c34e177406d39a24055952f0401629"
] | [
"jax/core.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.result_type",
"numpy.prod",
"numpy.dtype",
"numpy.shape"
]
] |
Jean1dev/MachineLearning_dataScience | [
"a77cb60b29dd37ee039082e7318fca61322ffecb"
] | [
"scripts/naive-bayes-census.py"
] | [
"import pandas as pd\n\nbase = pd.read_csv('census.csv')\n\nprevisores = base.iloc[:, 0:14].values\nclasse = base.iloc[:, 14].values\n \nfrom sklearn.preprocessing import LabelEncoder, OneHotEncoder\nlabelencoder_previsores = LabelEncoder()\nprevisores[:, 1] = labelencoder_previsores.fit_transform(pr... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.confusion_matrix",
"sklearn.preprocessing.StandardScaler",
"sklearn.naive_bayes.GaussianNB",
"sklearn.metrics.accuracy_score",
"pandas.read_csv",
"sklearn.cross_validation.train_test_split",
"sklearn.preprocessing.OneHotEncoder... |
RicoFerdian/smallopticalsorter | [
"835d5b696b586e532b35fff2c9fcd95b648a6442"
] | [
"utils/prepare-beans.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"create-bean-images\n\nUsage:\n prepare-beans.py --resolution=<res> [--debug] <file>\n prepare-beans.py (-h | --help)\n prepare-beans.py --version\n\nOptions:\n -r <res>, --resolution=<res> Image file resolution in px/mm.\n -d, --debug Also write an image show... | [
[
"numpy.zeros"
]
] |
Ulian7/DeepCTR | [
"d8f519a722a4d6a4f1fe18e04af54cfd1369c9a5"
] | [
"deepctr_torch/models/din.py"
] | [
"# -*- coding:utf-8 -*-\n\"\"\"\nAuthor:\n Yuef Zhang\nReference:\n [1] Zhou G, Zhu X, Song C, et al. Deep interest network for click-through rate prediction[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2018: 1059-1068. (https://arxiv.org/pdf/1706.... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.stack",
"torch.nn.MSELoss",
"torch.nn.ELU",
"torch.nn.Sigmoid",
"torch.bmm",
"torch.nn.BCELoss",
"torch.nn.CrossEntropyLoss",
"torch.sum"
]
] |
TensorMSA/hoyai_docker | [
"12f0041e6306d8a6421585a4b51666bad30be442"
] | [
"skp_edu_docker/code/third_party/yolo/yolo/net/yolo_tiny_net.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nimport re\n\nfrom third_party.yolo.yolo.net.net import Net\n\nclass YoloTinyNet(Net):\n\n def __init__(self, common_params, net_params, test=False):\n \... | [
[
"tensorflow.ones",
"tensorflow.ones_like",
"tensorflow.reshape",
"numpy.resize",
"tensorflow.stack",
"tensorflow.ceil",
"tensorflow.add_to_collection",
"tensorflow.cast",
"tensorflow.concat",
"tensorflow.transpose",
"tensorflow.constant",
"tensorflow.pad",
"tens... |
seanxcwang/TRTorch | [
"76ba62a0d5a258219bedee507e7678e9c5d09763"
] | [
"tests/modules/hub.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models as models\nimport timm\n\ntorch.hub._validate_not_a_forked_repo = lambda a, b, c: True\n\nmodels = {\n \"alexnet\": {\n \"model\": models.alexnet(pretrained=True),\n \"path\": \"both\"\n },\n \"vg... | [
[
"torch.nn.functional.adaptive_avg_pool2d",
"torch.ones",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.jit.save",
"torch.nn.LogSigmoid",
"torch.jit.trace",
"torch.jit.script",
"torch.hub.load"
]
] |
horacioMartinez/L2RPN | [
"11e13a60a568b8ad7f9c6de060ac8c41784ced96"
] | [
"old/src/preprocess_data.py"
] | [
"from os import listdir\nfrom os.path import isfile, join\nimport gc\nimport copy\nimport pickle\nimport math\nimport sys\nimport random\nimport resource\nfrom random import randrange, seed\nfrom threading import current_thread\nimport os\nimport time\nimport numpy as np\nfrom multiprocessing import cpu_count\n\n# ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros_like",
"numpy.isnan",
"numpy.random.seed",
"numpy.set_printoptions",
"numpy.random.shuffle"
]
] |
pysg/pyther | [
"6a47fc41533cc50bc64134e42ddd3ed8d54d75c7"
] | [
"constants.py"
] | [
"import numpy as np\n\n# Constante universal de los gases R [=] definir las unidades #####\nRGAS = 0.08314472\n# Definir el significado fisicoquímico\n\nA0, B0, C0 = 0.0017, 1.9681, -2.7238\n# Definir el significado fisicoquímico\n\nA1, B1, C1 = -2.4407, 7.4513, 12.504\n# Definir el significado fisicoquímico\n\nD =... | [
[
"numpy.array"
]
] |
oshaikh13/audio-reactive-led-strip | [
"f486f705989acc5e2b8f2d89f99e85b306908b69"
] | [
"python/led.py"
] | [
"from __future__ import print_function\nfrom __future__ import division\n\nimport platform\nimport numpy as np\nimport config\nimport time\n\nfrom pySerialTransfer import pySerialTransfer as txfer\nlink = txfer.SerialTransfer('COM3')\nlink.open()\ntime.sleep(2)\n\n_gamma = np.load(config.GAMMA_TABLE_PATH)\n\"\"\"Ga... | [
[
"numpy.copy",
"numpy.load",
"numpy.tile",
"numpy.roll",
"numpy.clip"
]
] |
epgreig/robo-advisor | [
"f4429ddf5f3917330c2675fcb807de5c894db9b4"
] | [
"instrument.py"
] | [
"\nfrom environment import Environment\nimport numpy as np\nfrom scipy.stats import norm\nfrom scipy.optimize import minimize\nfrom datetime import timedelta\nfrom pandas._libs.tslibs.timestamps import Timestamp, Timedelta\n\n\nclass Instrument:\n def __init__(self):\n self.ccy = None\n self.type =... | [
[
"scipy.stats.norm.pdf",
"numpy.log",
"numpy.exp",
"numpy.sqrt",
"scipy.stats.norm.cdf"
]
] |
parkermac/LO | [
"09e0197de7f2166bfa835ec62018b7a8fbfa7379"
] | [
"extract/tef/extract_segment_one_time.py"
] | [
"\"\"\"\nThis code extracts all needed segment data for one history file,\nlooping over all variables and all segments.\n\nTo test on mac:\nrun extract_segment_one_time.py -pth /Users/pm8/Documents/LiveOcean_roms/output -out_dir /Users/pm8/Documents/LO_output/extract/cas6_v3_lo8b/segment_temp_2019.07.04_2019.07.04 ... | [
[
"pandas.read_pickle",
"pandas.DataFrame",
"numpy.diff"
]
] |
ddutt/modin | [
"11581d552493c7caf42b25d8af2408b75c008a10"
] | [
"modin/pandas/groupby.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pandas\nimport pandas.core.groupby\nfrom pandas.core.dtypes.common import is_list_like\nimport pandas.core.common as com\nimport sys\n\nfrom modin.error_message import ErrorMessage\nfrom .utils ... | [
[
"pandas.core.dtypes.common.is_list_like",
"pandas.core.common._pipe",
"pandas.Series"
]
] |
sveta-egorova/dlcourse_ai | [
"53c216e6116fd5a55fe5f99450451a784addbc80"
] | [
"assignments/assignment2/model.py"
] | [
"import numpy as np\n\nfrom layers import FullyConnectedLayer, ReLULayer, softmax_with_cross_entropy, l2_regularization\n\n\nclass TwoLayerNet:\n \"\"\" Neural network with two fully connected layers \"\"\"\n\n def __init__(self, n_input, n_output, hidden_layer_size, reg):\n \"\"\"\n Initializes... | [
[
"numpy.max",
"numpy.zeros",
"numpy.sum",
"numpy.exp",
"numpy.argmax"
]
] |
CaptainSharf/chapel | [
"0659db4128ee8e324f2a987d4f48666961db513b"
] | [
"third-party/llvm/llvm-src/utils/llvm-locstats/llvm-locstats.py"
] | [
"#!/usr/bin/env python\n#\n# This is a tool that works like debug location coverage calculator.\n# It parses the llvm-dwarfdump --statistics output by reporting it\n# in a more human readable way.\n#\n\nfrom __future__ import print_function\nimport argparse\nimport os\nimport sys\nfrom json import loads\nfrom math ... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xticks"
... |
ajeffries0492/DocProj | [
"75ac03ed195f966b607a45b04c7dd76f18efe6d6"
] | [
"eval.py"
] | [
"import os\r\nimport cv2\r\nimport shutil\r\nimport numpy as np\r\nimport skimage\r\nfrom skimage import io\r\nfrom skimage import transform as tf\r\nfrom skimage import img_as_ubyte\r\nimport argparse\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch.autograd import Variable\r\nfrom torchvision import tra... | [
[
"numpy.zeros",
"torch.autograd.Variable",
"numpy.save",
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.load",
"torch.nn.DataParallel"
]
] |
cuihantao/steps | [
"60327bf42299cb7117ed5907a931583d7cdf590d"
] | [
"python/stepspy-current/stepspy/pouch.py"
] | [
"#coding=utf-8\nimport time\nimport struct\nimport csv\nimport os.path\nimport math\n\ntry:\n import numpy\nexcept ImportError:\n print(\"pouch is dependent on module numpy which is missing. please install numpy before use pouch\")\n\ndef __is_filename_ends_with(filename, surfix):\n filename = filename.upp... | [
[
"numpy.array"
]
] |
mightmay/Mien-TTS | [
"8a22ff0a79558b3cf4981ce1b63f4d1485ea6338"
] | [
"TTS/tts/tf/utils/convert_torch_to_tf_utils.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\n# NOTE: linter has a problem with the current TF release\n#pylint: disable=no-value-for-parameter\n#pylint: disable=unexpected-keyword-arg\n\ndef tf_create_dummy_inputs():\n \"\"\" Create dummy inputs for TF Tacotron2 model \"\"\"\n batch_size = 4\n max_input... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.keras.backend.set_value",
"tensorflow.random.uniform",
"numpy.random.randint",
"numpy.all"
]
] |
mikael-jorda/geomstats-robotic-example | [
"e51634ade6b2dbae8103cc987fac6874daa5a1ef"
] | [
"robot_so3.py"
] | [
"\"\"\"\nGenerate a geodesic of SO(3) equipped\nwith its left-invariant canonical METRIC\nfor trajectory generation for a robotic manipulator\nand sends the trajectory through a redis server at a selected rate\n\"\"\"\n\nimport time\n\nfrom geomstats.special_orthogonal_group import SpecialOrthogonalGroup\n\nimport ... | [
[
"numpy.array",
"numpy.linspace"
]
] |
zeitlinv/pandas | [
"08d296f1278e08b407448c95086589e1d10285f9"
] | [
"pandas/tests/window/test_groupby.py"
] | [
"import numpy as np\nimport pytest\n\nfrom pandas import (\n DataFrame,\n Index,\n MultiIndex,\n Series,\n Timestamp,\n date_range,\n to_datetime,\n)\nimport pandas._testing as tm\nfrom pandas.api.indexers import BaseIndexer\nfrom pandas.core.groupby.groupby import get_groupby\n\n\nclass TestRo... | [
[
"pandas.to_datetime",
"numpy.array",
"pandas.Index",
"pandas.DataFrame",
"pandas.date_range",
"pandas.MultiIndex.from_tuples",
"pandas.core.groupby.groupby.get_groupby",
"pandas._testing.assert_frame_equal",
"pandas.MultiIndex.from_arrays",
"pandas.Timestamp",
"numpy.ar... |
shib0li/BMBO-DARN | [
"68f889ac8a1a2051754920fabff9e56f667b1cab"
] | [
"main.py"
] | [
"import fire\nimport numpy as np\nimport torch\nimport os \nimport pickle5 as pickle\nimport subprocess\nfrom datetime import datetime\nfrom time import time\n\nimport hamiltorch\n# import logging\n# import ExpConfigs as exp_configs\n# import Misc as misc\n# import data.Dataset as Dataset\n# import data.Functions a... | [
[
"torch.device",
"numpy.array",
"numpy.random.randint",
"numpy.array2string"
]
] |
czbiohub/scRFE | [
"716b0f59b4b949e6842af3080276c7ea835618a9"
] | [
"scripts/practiceScripts/scRFE 9.56.52 PM.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # scRFE\n\n# In[ ]:\n\n\n\n\n\n# In[84]:\n\n\n# MENTION ONE VS ALL CLASSIFICATION in description\n\n\n# In[117]:\n\n\n# Imports \nimport numpy as np\nimport pandas as pd\nimport scanpy as sc\nimport random\nfrom anndata import read_h5ad\nfrom sklearn.ensemble import Rand... | [
[
"sklearn.feature_selection.RFECV",
"numpy.random.seed",
"pandas.DataFrame",
"sklearn.ensemble.RandomForestClassifier",
"pandas.concat",
"numpy.unique"
]
] |
apatlpo/dask | [
"1fd5f14af228d3f9b90b9f96213a55a014178a05"
] | [
"dask/dataframe/io/tests/test_demo.py"
] | [
"import pandas.util.testing as tm\nimport pandas as pd\nimport pytest\n\nimport dask.dataframe as dd\nfrom dask.dataframe.utils import assert_eq\n\n\ndef test_make_timeseries():\n df = dd.demo.make_timeseries('2000', '2015', {'A': float, 'B': int, 'C': str},\n freq='2D', partition... | [
[
"pandas.Timestamp",
"pandas.Index",
"pandas.DatetimeIndex"
]
] |
jin-s13/mmaction2 | [
"ffa678c675744fea99246446c63177d947faea83"
] | [
"tests/test_data/test_loading.py"
] | [
"import copy\nimport os.path as osp\n\nimport mmcv\nimport numpy as np\nimport pytest\nimport torch\nfrom numpy.testing import assert_array_almost_equal, assert_array_equal\n\n# yapf: disable\nfrom mmaction.datasets.pipelines import (AudioDecode, AudioDecodeInit,\n AudioFeatu... | [
[
"torch.zeros",
"numpy.max",
"numpy.array",
"torch.eq",
"numpy.testing.assert_array_equal",
"numpy.random.randn",
"numpy.min",
"numpy.shape",
"numpy.testing.assert_array_almost_equal",
"numpy.arange"
]
] |
shantanuwadnerkar/deepdrive-zero | [
"3134a5b092a53ff60e4207d7419fd6a19cb5a6e9"
] | [
"deepdrive_zero/player.py"
] | [
"import math\nfrom math import cos, sin, pi\nimport os\nimport sys\nfrom random import random\nfrom typing import List\n\nimport numpy as np\n\nfrom loguru import logger as log\n\nimport arcade\nimport arcade.color as color\nfrom deepdrive_zero.constants import SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_MARGIN, \\\n MA... | [
[
"numpy.array"
]
] |
GillianGrayson/qs | [
"e3d80b75dc4879bd1deb9e46b17583a452c2ccab"
] | [
"scripts/netket/mbl/cluster/submit_rhos.py"
] | [
"import pathlib\nimport os.path\nimport pandas as pd\nimport numpy as np\nimport socket\n\nhost_name = socket.gethostname()\nprint(host_name)\n\nrun_type = 'short'\n\nif host_name == \"newton\":\n path = '/data/biophys/denysov/yusipov/qs'\nelif host_name == \"master\":\n path = '/common/home/yusipov_i/data/qs... | [
[
"pandas.DataFrame",
"numpy.linspace",
"pandas.read_excel"
]
] |
LawrenceDior/thetis | [
"fa4b14eeac1063f922ba24f03ebf7ecdf80b82ff"
] | [
"test/bottomFriction/test_ekman_surface.py"
] | [
"\"\"\"\nBottom Ekman layer test\n=======================\n\nSteady state flow in a channel subject to bottom friction and rotation.\nVertical viscosity is assumed to be constant to allow simple analytical\nsolution.\n\"\"\"\nfrom thetis import *\nimport numpy\nimport pytest\n\n\ndef run_test(layers=25, tolerance=0... | [
[
"numpy.sqrt"
]
] |
ericf900/pvlib-python | [
"64a6498b689d27d77bb5967e13eab9bc0018d68e"
] | [
"docs/examples/plot_greensboro_kimber_soiling.py"
] | [
"\"\"\"\nKimber Soiling Model\n====================\n\nExamples of soiling using the Kimber model [1]_.\n\nReferences\n----------\n.. [1] \"The Effect of Soiling on Large Grid-Connected Photovoltaic Systems\n in California and the Southwest Region of the United States,\" Adrianne\n Kimber, et al., IEEE 4th Worl... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
Yuran-Zhao/bert-nmt | [
"e5095860e59b305bdcf1264ad117e67d3d97e705"
] | [
"fairseq/models/transformer.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport math\n\nimport ... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.nn.functional.dropout",
"torch.FloatTensor",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.normal_",
"torch.nn.functional.linear",
"numpy.random.uniform",
"torch.Tensor",
"torch.nn.Embedding"
... |
silveto/pandas | [
"fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e"
] | [
"pandas/compat/pickle_compat.py"
] | [
"\"\"\" support pre 0.12 series pickle compatibility \"\"\"\n\nimport sys\nimport numpy as np\nimport pandas\nimport copy\nimport pickle as pkl\nfrom pandas import compat\nfrom pandas.compat import u, string_types\nfrom pandas.core.series import Series, TimeSeries\nfrom pandas.sparse.series import SparseSeries, Spa... | [
[
"pandas.compat.u"
]
] |
udellgroup/GaussianCopulaImp | [
"237945f139bf0ba53e8d462b48c5683c45b2ce79"
] | [
"gcimpute/helper_evaluation.py"
] | [
"import numpy as np \nfrom scipy.stats import random_correlation, norm, expon\nfrom scipy.linalg import svdvals\nimport warnings\nwarnings.filterwarnings(\"error\")\nfrom collections import defaultdict\n\ndef get_mae(x_imp, x_true, x_obs=None):\n \"\"\"\n gets Mean Absolute Error (MAE) between x_imp and x_tru... | [
[
"numpy.arccos",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.zeros",
"numpy.dot",
"numpy.nanquantile",
"numpy.sum",
"numpy.isnan",
"numpy.power",
"numpy.linalg.svd",
"numpy.sqrt",
"numpy.abs",
"numpy.linspace",
"numpy.nanmedian"
]
] |
JimmyZhang12/predict-T | [
"8ae818b0791104de20633ce91e6d633cda7445b3"
] | [
"python/jimmy_plot/deprecated/front_end_preds/supply_voltage_over_cycles.py"
] | [
"#ASSUMES DATA WITH THROTTLING, NO DECOR STALL\n\nimport os\nimport matplotlib\nmatplotlib.use('Agg')\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nclass Cycle_Dump:\n def __init__(self):\n self.ve_count = 0\n self.action_count = 0\n return\n\n def reset(self):\n self.v... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axes"
]
] |
AlvinIsonomia/darts.pytorch1.3_MultiGPU | [
"826843454cd1ace9cbb0410981856e51000b407e"
] | [
"rnn/architect.py"
] | [
"import torch\nimport numpy as np\nimport torch.nn as nn\n\ndef _concat(xs):\n return torch.cat([x.view(-1) for x in xs])\n\n\ndef _clip(grads, max_norm):\n total_norm = 0\n for g in grads:\n param_norm = g.data.norm(2)\n total_norm += param_norm ** 2\n total_norm = total_norm ** 0.5\n cl... | [
[
"torch.nn.DataParallel"
]
] |
lmjohns3/cube-experiment | [
"ab6d1a9df95efebc369d184ab1c748d73d5c3313"
] | [
"analysis/03-fill-dropouts-svt.py"
] | [
"#!/usr/bin/env python\n\nimport climate\nimport lmj.cubes\nimport lmj.cubes.fill\nimport numpy as np\nimport pandas as pd\n\nlogging = climate.get_logger('fill')\n\ndef svt(dfs, threshold, window):\n '''Complete missing marker data using singular value thresholding.\n\n This method alters the given `dfs` in-... | [
[
"numpy.zeros_like",
"numpy.dot",
"numpy.linalg.svd",
"numpy.clip"
]
] |
dorcoh/scikit-learn | [
"374bc511540ef995b2a693ffc5334a71f723619f"
] | [
"sklearn/utils/estimator_checks.py"
] | [
"import types\nimport warnings\nimport pickle\nimport re\nfrom copy import deepcopy\nfrom functools import partial, wraps\nfrom inspect import signature\n\nimport numpy as np\nfrom scipy import sparse\nfrom scipy.stats import rankdata\nimport joblib\n\nfrom . import IS_PYPY\nfrom .. import config_context\nfrom ._te... | [
[
"numpy.mean",
"numpy.where",
"numpy.finfo",
"numpy.sort",
"scipy.stats.rankdata",
"numpy.issubdtype",
"numpy.dtype",
"numpy.full",
"numpy.empty",
"numpy.log",
"pandas.DataFrame",
"numpy.core.numerictypes.allTypes.values",
"numpy.take",
"numpy.arange",
"n... |
edwinmwiti/Robotic_Arm_Control | [
"471a8d095e6484f17fa6d27bc8420c66e859bd9c"
] | [
"main.py"
] | [
"\"\"\"\nIntelligent Robotic Servicing System\nMain Interface For the Robotic Arm Control Software\nAuthor: Edwin Mwiti\nCopyright: 2020\n\"\"\"\n\n# imports\nfrom tkinter import *\nfrom tkinter import messagebox\nfrom tkinter import ttk\nimport Pmw\nfrom time import time, sleep\nfrom datetime import datetime\nimpo... | [
[
"matplotlib.figure.Figure",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
]
] |
6Ulm/unbalanced_gromov_wasserstein | [
"be23571f653dab16fd0722cb1ec2c3412a1e3f30"
] | [
"experiments_pu/compute_prediction.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Feb 12 10:58:27 2020\n\nExperiments where one marginal is fixed\n\"\"\"\n\nimport os\nimport numpy as np\nfrom joblib import Parallel, delayed\nimport torch\nimport ot\n\nfrom unbalancedgw.batch_stable_ugw_solver import log_batch_ugw_sinkhorn\... | [
[
"torch.zeros",
"torch.isnan",
"torch.set_default_tensor_type",
"numpy.save",
"torch.cuda.device_count",
"torch.ones",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.tensor"
]
] |
Yash-10/numbakit-ode | [
"aa5a0f417a2218bd471db754b35cc61996b2461e"
] | [
"nbkode/nbcompat/common.py"
] | [
"\"\"\"\n nbkode.nbcompat.common\n ~~~~~~~~~~~~~~~~~~~~~~\n\n Common methods.\n\n :copyright: 2020 by nbkode Authors, see AUTHORS for more details.\n :license: BSD, see LICENSE for more details.\n\"\"\"\n\nimport numpy as np\n\nfrom .nb_to_import import numba\n\n\n@numba.njit()\ndef isclose(a, b, ato... | [
[
"numpy.abs"
]
] |
youssriaboelseod/deep-learning-v2-pytorch | [
"db0cf684d58ed660a1d3b334661bbc88050e4dc1"
] | [
"gan-mnist/MNIST_GAN_Exercise.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Generative Adversarial Network\n# \n# In this notebook, we'll be building a generative adversarial network (GAN) trained on the MNIST dataset. From this, we'll be able to generate new handwritten digits!\n# \n# GANs were [first reported on](https://arxiv.org/abs/1406.2... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"matplotlib.pyplot.figure",
"torch.utils.data.DataLoader",
"numpy.squeeze"
]
] |
apodemus/pysalt3 | [
"97bb790ad7bcf1137e3ffd2a7b32840ae7167358"
] | [
"proptools/optimizetab.py"
] | [
"# -*- coding: utf-8 -*-\nimport os, sys\nimport numpy as np\n\nfrom PyQt4 import QtCore, QtGui\n\nfrom slitlets import Slitlets\nimport pyslit_optimize as opt\n\nclass OptimizeTab:\n def __init__(self, ui, default_yspacing=1., default_iter=10):\n print('loading OPT')\n self.ui = ui\n self.s... | [
[
"numpy.where"
]
] |
teuben/QAC | [
"7ec92dcdfdeb1b71dd13bd6fd47f29b634b7a488"
] | [
"src/plot.py"
] | [
"#\n# Version: 31-jan-2018\n#\n# In this version we use plot= to denote te plotfile name. in the \"au\" tools the \"figfile=\"\n# keyword is used. In imview() they use the \"out=\". Go figure for standardization, but we\n# should probably assume something standard.\n#\n# Also: plot=None could be used to ... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.hist",
... |
Inkln/catalyst | [
"37ff273a223df3bc70411cd79a79d1b038ba8f9b",
"37ff273a223df3bc70411cd79a79d1b038ba8f9b"
] | [
"catalyst/contrib/nn/criterion/triplet.py",
"tests/_tests_scripts/dl_z_mvp_mnist.py"
] | [
"# flake8: noqa\nfrom typing import List, TYPE_CHECKING, Union\n\nimport torch\nfrom torch import nn, Tensor\nfrom torch.nn import TripletMarginLoss\n\nfrom catalyst.contrib.nn.criterion.functional import triplet_loss\nfrom catalyst.data.utils import convert_labels2list\n\nif TYPE_CHECKING:\n from catalyst.data.... | [
[
"torch.nn.MarginRankingLoss",
"torch.nn.TripletMarginLoss",
"torch.sqrt",
"torch.relu",
"torch.arange",
"torch.einsum",
"torch.full",
"torch.diag",
"torch.sum"
],
[
"torch.nn.Linear",
"torch.nn.functional.cross_entropy"
]
] |
openPMD/openPMD-CCD | [
"ab529c47d310da72405fee3daa1c3e246c2c1265"
] | [
"tests/test_write.py"
] | [
"\"\"\"\nThis test file is part of the openPMD-CCD.\n\nCopyright 2020 openPMD contributors\nAuthors: Axel Huebl\nLicense: BSD-3-Clause-LBNL\n\"\"\"\nfrom PIL import Image\nimport io\nimport numpy as np\nimport os\nimport pytest\n\nfrom openpmd_ccd import CCD\n\n\nFIXTURE_DIR = os.path.join(\n os.path.dirname(os.... | [
[
"numpy.array"
]
] |
Morgan-Stanley/Testplan | [
"9374d6e0da6ae9aa7a1b5e08b42cd21993485837"
] | [
"tests/unit/testplan/testing/multitest/test_result.py"
] | [
"\"\"\"\nUnit tests for the testplan.testing.multitest.result module.\n\"\"\"\n\nimport collections\nimport copy\nimport hashlib\nimport inspect\nimport os\nimport re\nfrom unittest import mock\n\nimport matplotlib\nimport pytest\nimport matplotlib.pyplot as plot\n\nfrom testplan.common.utils import comparison\nfro... | [
[
"matplotlib.use",
"matplotlib.pyplot.plot"
]
] |
ImmortalTurtle/robot-surgery-segmentation | [
"dd86cec33d800c1104e9f89296ef8b1d38e968e2"
] | [
"train.py"
] | [
"import argparse\nimport json\nfrom pathlib import Path\nfrom validation import validation_binary, validation_multi\n\nimport torch\nfrom torch import nn\nfrom torch.optim import Adam\nfrom torch.utils.data import DataLoader\nimport torch.backends.cudnn as cudnn\nimport torch.backends.cudnn\n\nfrom models import UN... | [
[
"torch.cuda.is_available",
"torch.nn.DataParallel"
]
] |
clintonjwang/cbct-recon | [
"75d5458188d3e1f663b22f64d6aa1306e5da6d11"
] | [
"cnn_builder.py"
] | [
"\"\"\"\nAuthor: Clinton Wang, E-mail: `clintonjwang@gmail.com`, Github: `https://github.com/clintonjwang/lipiodol`\nAuthor: David G Ellis (https://github.com/ellisdg/3DUnetCNN)\n\"\"\"\n\nimport keras.backend as K\nfrom keras_contrib.layers.normalization import InstanceNormalization\nfrom keras.layers import Input... | [
[
"numpy.concatenate",
"numpy.empty",
"numpy.zeros",
"numpy.load",
"numpy.random.uniform",
"numpy.random.randint"
]
] |
glotzerlab/rowan | [
"c17147859432d3dc2b023e086632afa8f447f190"
] | [
"rowan/functions.py"
] | [
"# Copyright (c) 2019 The Regents of the University of Michigan\n# All rights reserved.\n# This software is licensed under the BSD 3-Clause License.\nr\"\"\"Submodule containing all standard functions.\"\"\"\n\nimport numpy as np\n\n\ndef exp(q):\n r\"\"\"Compute the natural exponential function :math:`e^q`.\n\n... | [
[
"numpy.isclose",
"numpy.arccos",
"numpy.dot",
"numpy.exp",
"numpy.where",
"numpy.cos",
"numpy.broadcast_to",
"numpy.concatenate",
"numpy.sin",
"numpy.linalg.norm",
"numpy.empty",
"numpy.log",
"numpy.arcsin",
"numpy.linalg.eigh",
"numpy.isfinite",
"nu... |
maria-cardona/Hippocampal-Volume-Quantification-in-Alzheimer-s-Progression | [
"e4ec762ca78f63dd15850f638c0e6a04e6ab3ba4"
] | [
"section 3/src/inference_dcm.py"
] | [
"\"\"\"\nHere we do inference on a DICOM volume, constructing the volume first, and then sending it to the\nclinical archive\n\nThis code will do the following:\n 1. Identify the series to run HippoCrop.AI algorithm on from a folder containing multiple studies\n 2. Construct a NumPy volume from a set of DICOM... | [
[
"numpy.max",
"numpy.array",
"numpy.sum",
"numpy.stack",
"numpy.flip"
]
] |
prasoongoyal/rl-learn | [
"0401ca8c60b11adbc6fddfda12c03876a45c2ad0"
] | [
"rl/environment.py"
] | [
"import gym\nimport sys\nimport random\nimport numpy as np\nfrom scipy.misc import imresize\nfrom utils import *\nfrom PIL import Image\nfrom copy import deepcopy\nimport tensorflow as tf\nfrom itertools import groupby\nimport pdb\nimport pickle\nimport torch\nsys.path.insert(0, 'learn/')\nfrom learn_model import L... | [
[
"numpy.max",
"numpy.random.normal",
"numpy.zeros",
"tensorflow.Graph",
"numpy.load",
"numpy.save"
]
] |
abhiyerasi/IDV_MaskRCNN_Image_Segmentation | [
"3a873df1f8b46f05131ff93a7e665c6c54b2ad2b"
] | [
"samples/ivddataset.py"
] | [
"import os\nimport sys\nimport json\nimport datetime\nimport numpy as np\nimport skimage.draw\n\n# Root directory of the project\nROOT_DIR = os.path.abspath(\"../../\")\n\n# Import Mask RCNN\nsys.path.append(ROOT_DIR) # To find local version of the library\nfrom mrcnn.config import Config\nfrom mrcnn import model ... | [
[
"numpy.array"
]
] |
ehgp/data_606_capstone | [
"c4b6fef75471b95ec56689bbcaa2a791d01472c3"
] | [
"trade.py"
] | [
"\"\"\"Trade.\n\nThe module will execute the arbitrage opportunities for you as it finds them.\nCurrently two arbitrage models are being used:\n1.Triangular Arbitrage.\n2.Bellman Ford Optimization.\n\"\"\"\nimport os\nimport yaml\nimport pandas as pd\nfrom kucoin.client import Trade\nimport sqlite3\nimport logging\... | [
[
"pandas.set_option",
"pandas.read_sql_query"
]
] |
zhouyuanmin/MyDemo | [
"664977a6243992c77931e58b98f5262745759d1a"
] | [
"2020-12/demo7.py"
] | [
"import cv2\nimport numpy as np\nfrom numpy import ndarray\n\n\ndef face_update(url: str):\n img = cv2.imread(url)\n return img\n\n\ndef face_set(img, scale_factor=1.3, min_neighbors=3, min_size=(32, 32)):\n face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')\n faces = face_casca... | [
[
"numpy.log"
]
] |
ingstra/pennylane | [
"0d416a62728f922f1d261d5000504a0c19765ee5"
] | [
"pennylane/transforms/classical_jacobian.py"
] | [
"# Copyright 2018-2021 Xanadu Quantum Technologies Inc.\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\r\n# Unles... | [
[
"tensorflow.GradientTape",
"torch.autograd.functional.jacobian"
]
] |
BorisPolonsky/KdConv | [
"fcee15bf8d4f6b0a80ffe01a00739755a7f44e0a"
] | [
"benchmark/memseq2seq/model.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport time\n\nfrom tensorflow.python.ops.nn import dynamic_rnn\nfrom utils.output_projection import output_projection_layer, MyDense, MyAttention, MyInferenceHelper\nfrom utils import SummaryHelper\nimport jieba\nimport os\nimport json\n\n\nclass Seq2SeqModel(object):\... | [
[
"tensorflow.ones",
"tensorflow.ones_like",
"numpy.exp",
"tensorflow.gradients",
"numpy.mean",
"numpy.min",
"tensorflow.clip_by_value",
"tensorflow.nn.embedding_lookup",
"tensorflow.greater",
"tensorflow.nn.softmax",
"tensorflow.one_hot",
"numpy.max",
"tensorflow... |
tuanchien/asd | [
"190c1c6d155b16a27717596d6350598e5cd4ffac"
] | [
"ava_asd/static_audio_model.py"
] | [
"# Copyright 2020 Tuan Chien, James Diprose\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 la... | [
[
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D"
]
] |
ViniciusLima94/frites | [
"270230a2b3abeb676211d3dec54ce6d039eb2f91"
] | [
"frites/core/gcmi_1d.py"
] | [
"\"\"\"\nGaussian copula mutual information estimation.\n\n| **Authors** : Robin AA. Ince\n| **Original code** : https://github.com/robince/gcmi\n| **Reference** :\n| RAA Ince, BL Giordano, C Kayser, GA Rousselet, J Gross and PG Schyns\n\"A statistical framework for neuroimaging data analysis based on mutual\ninfor... | [
[
"numpy.dot",
"numpy.median",
"numpy.exp",
"numpy.issubdtype",
"numpy.concatenate",
"numpy.log",
"numpy.arange",
"numpy.sqrt",
"numpy.linalg.cholesky",
"numpy.vstack",
"numpy.atleast_2d",
"numpy.zeros",
"numpy.hstack",
"numpy.squeeze",
"numpy.sum",
"n... |
shilpiBose29/CIS519-Project | [
"e2ce2f3c7e6e313d262d049721c8314ef5595dfa"
] | [
"top_users/find_reviews_by_top_users.py"
] | [
"#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Nov 23 09:56:46 2017\n\n@author: arranzignacio\n\"\"\"\n\nimport pandas as pd\n\nfilename = 'all_reviews.csv'\nall_cities = pd.read_csv(filename, sep=',', header=0)\n\n#unique_listings = all_cities.listing_id.unique()\n#unique_reviewers = all_... | [
[
"pandas.read_csv"
]
] |
cion94/nlp | [
"4a81948a64c0f1c1e7036c25c3a5e9a89b2d074d"
] | [
"labs/lab6.py"
] | [
"# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nimport pandas as pd\nimport csv\nimport numpy as np\nfrom sklearn.decomposition import PCA\nimport matplotlib.pyplot as plt\n\n\n# %%\nglove_data_file = \"glove.6B/glove.6B.50d.txt\"\n\n\n# %%\ndf = pd.read_csv(glove_data... | [
[
"matplotlib.pyplot.scatter",
"pandas.read_csv",
"matplotlib.pyplot.annotate",
"sklearn.decomposition.PCA"
]
] |
Bhaskers-Blu-Org1/visual-insights-custom-models | [
"a92ea6e537c8fc4aa92d9298e628e68a1716a346"
] | [
"object_detection/src/train.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nSource: https://www.ibm.com/support/knowledgecenter/SSRU69_1.2.0/base/vision_prepare_custom_train.html\n\"\"\"\n\nfrom PIL import Image\nimport numpy as np\n# import tensorflow as tf\nimport keras\nfrom sklearn.model_selection import train_test_split\nimpo... | [
[
"sklearn.model_selection.train_test_split",
"numpy.array"
]
] |
lc0/adanet | [
"b5007ae556a7387b9bda340fdf82649edd740a9e"
] | [
"adanet/core/estimator.py"
] | [
"\"\"\"An AdaNet estimator implementation in Tensorflow using a single graph.\n\nCopyright 2018 The AdaNet Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n... | [
[
"tensorflow.io.gfile.GFile",
"tensorflow.train.latest_checkpoint",
"tensorflow.io.gfile.rmtree",
"tensorflow.train.Coordinator",
"tensorflow.train.load_variable",
"tensorflow.Graph",
"tensorflow.train.get_checkpoint_state",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.e... |
cxqj/6-ssn.pytorch | [
"85688f5eda96cdb545f48f03b7fd75a4122fface"
] | [
"ssn_dataset.py"
] | [
"import torch.utils.data as data\n\nimport os\nimport os.path\nfrom numpy.random import randint\nfrom ops.io import load_proposal_file\nfrom transforms import *\nfrom ops.utils import temporal_iou\n\n\nclass SSNInstance:\n\n def __init__(self, start_frame, end_frame, video_frame_count,\n fps=1, l... | [
[
"numpy.random.randint"
]
] |
millerjoey975/usaspending-api | [
"66dd6b231087e92696d0ac09ef7700b6069829ad"
] | [
"usaspending_api/etl/elasticsearch_loader_helpers/delete_data.py"
] | [
"import logging\n\nimport pandas as pd\n\nfrom django.conf import settings\nfrom time import perf_counter\nfrom typing import Optional, Dict, Union, Any\n\nfrom elasticsearch import Elasticsearch\nfrom elasticsearch_dsl import Search\nfrom elasticsearch_dsl.mapping import Mapping\n\nfrom usaspending_api.common.help... | [
[
"pandas.read_csv"
]
] |
NNHieu/cleanrl | [
"6869080f6ec53612734a9f592fc9872bb485f6d3"
] | [
"cleanrl_utils/paper_plot.py"
] | [
"import argparse\nimport os\nimport pickle\nfrom os import path\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport wandb\n\nsns.set_style(\"whitegrid\")\nmpl.rcParams[\"text.usetex\"] = True\nmpl.rcParams[\"text.latex.preamble\"] = r\... | [
[
"pandas.DataFrame.from_records",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylim",
"numpy.mean",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.figure",
"numpy.std",
"matplotlib.pyplot.tight_layout",
"pandas.concat",
"... |
Mars-Rover-Manipal/Active-Suspension | [
"4a73422def896f516b40616f169aae3923f221e1"
] | [
"gym-gazebo/gym_gazebo/envs/lsd_rover/lsd_rover_active_suspension.py"
] | [
"from math import degrees, inf, radians\nimport rospy\nimport numpy as np\nfrom std_msgs.msg import Float64\nfrom nav_msgs.msg import Odometry\nfrom sensor_msgs.msg import Range\nfrom geometry_msgs.msg import Twist\nfrom gazebo_msgs.msg import LinkStates\nfrom std_srvs.srv import Empty\nfrom gym import utils, space... | [
[
"numpy.array"
]
] |
ranocha/BSeries | [
"de42bf03280ef7860ae6ade1d20212906b37a3d4"
] | [
"BSeries/util.py"
] | [
"import numpy as np\n\ndef object_einsum(string, *arrays):\n \"\"\"\n Simplified object einsum, without much error checking.\n Stolen from https://gist.github.com/seberg/5236560, with some modifications.\n We can remove this and rely directly on np.einsum after the related\n PR is merged to numpy.\n ... | [
[
"numpy.nditer",
"numpy.einsum"
]
] |
nikkigabbard/sympy | [
"1819379bdcca733eabc635ca4b3c9ae3deff1205"
] | [
"sympy/matrices/dense.py"
] | [
"from __future__ import division, print_function\n\nimport random\n\nfrom sympy.core import SympifyError\nfrom sympy.core.basic import Basic\nfrom sympy.core.compatibility import is_sequence, range, reduce\nfrom sympy.core.expr import Expr\nfrom sympy.core.function import count_ops, expand_mul\nfrom sympy.core.sing... | [
[
"numpy.ndindex",
"numpy.empty"
]
] |
xujli/cbof_torch | [
"ed8d67dd7a41b6345305d970d0f8fa0892f8ccee"
] | [
"bof_torch.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nimport torch\nfrom sklearn.cluster import KMeans\nfrom sklearn.metrics.pairwise import pairwise_distances\nimport numpy as np\n\nclass BoF_Pooling(nn.Module):\n def __init__(self, n_codewords, features, spatial_level=0, **kwargs):\n super(BoF_Poolin... | [
[
"numpy.concatenate",
"torch.reshape",
"torch.stack",
"torch.nn.Softmax",
"sklearn.cluster.KMeans",
"numpy.ones",
"numpy.random.shuffle",
"torch.ones",
"torch.nn.ReLU",
"numpy.float32",
"torch.cuda.is_available",
"sklearn.metrics.pairwise.pairwise_distances",
"to... |
LiamLYJ/scene_seg | [
"8e0f55f6890ab7b18076650a80a86ccca249940a"
] | [
"test.py"
] | [
"import torch\nimport torch.nn as nn\nimport torchvision\nimport torchvision.models as models\nimport torch.nn.functional as nn_F\nfrom nets import encoder_net, decoder_net\nimport numpy as np\nimport argparse\nfrom data_loader import texture_seg_dataset, get_data_direct\nfrom utils import seg_loss, load_model, rem... | [
[
"torch.device",
"torch.cat",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.nn.AdaptiveAvgPool2d"
]
] |
helloTC/Rest_activation_prediction | [
"f67cfe221d9f63afd67a2a5ef6330b8519ca7641"
] | [
"trt_reliability_region.py"
] | [
"# Calculate test-retest reliability in these 40 subjects across global brain\n\nfrom os.path import join as pjoin\nfrom ATT.algorithm import tools\nimport framework_rt as fr\nimport cifti\nimport numpy as np\n\nparpath = '/nfs/s2/userhome/huangtaicheng/hworkingshop/hcp_test'\n\nwith open(pjoin(parpath, 'tables', '... | [
[
"numpy.mean",
"numpy.arange",
"numpy.zeros",
"numpy.unique"
]
] |
l337x911/inphadel | [
"7d5ad58d90d745ed82226a8b0b983875cbe1d26e"
] | [
"src/svphase/scripts/merge_coords.py"
] | [
"\"Merges bed files based on chr, start, end\" \n\nimport pandas as pd\nimport sys\n\ndef ucsc_fmt(s):\n\treturn \"{0}:{1}-{2}\".format(s.ix[0],s.ix[1],s.ix[2])\n\ndef merge(beda,chain_ab,bedb):\n\t\n\tbeda_df = pd.read_csv(beda, sep='\\t', index_col=None, header=None, names=['chrA','startA','endA','mid'])\n\tchain... | [
[
"pandas.read_csv",
"pandas.merge"
]
] |
AndreFCruz/scikit-multiflow | [
"c4dbbb70d4ed839d95a18ca799f073ac9ff9ba49"
] | [
"tests/data/test_mixed_generator.py"
] | [
"import os\nimport numpy as np\nfrom skmultiflow.data.mixed_generator import MIXEDGenerator\n\n\ndef test_mixed_generator(test_path):\n stream = MIXEDGenerator(classification_function=1, random_state=112, balance_classes=False)\n stream.prepare_for_use()\n\n assert stream.n_remaining_samples() == -1\n\n ... | [
[
"numpy.alltrue",
"numpy.array",
"numpy.load"
]
] |
luketaverne/handcam | [
"e294ebf2be8b5512c8607d3c8ba3f6946f3b8e30"
] | [
"handcam/train_WRN_Keras.py"
] | [
"from datetime import datetime\n\nfrom tensorflow.python.keras.callbacks import Callback\n\nfrom handcam.ltt.datasets.handcam.HandCamDataHandler import HandGenerator\nfrom handcam.ltt.datasets.uw_rgbd.UWDataHandler import (\n TrainGenerator,\n ValidationGenerator,\n)\nfrom handcam.ltt.network.Tools import wri... | [
[
"tensorflow.python.keras.callbacks.ProgbarLogger",
"tensorflow.python.keras.callbacks.ModelCheckpoint",
"tensorflow.python.keras.optimizers.Adam",
"tensorflow.python.keras.callbacks.TensorBoard"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.