repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
cristianmatache/HOLA
[ "28baeae1ee165df702f6e230b29f8433d96c7009" ]
[ "analysis/infra/igr_runner.py" ]
[ "# Copyright 2021 BlackRock, Inc.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in...
[ [ "pandas.concat" ] ]
renqianluo/GBDT-NAS
[ "c3409ddcfcaf8049b5ad4ae7404fc8bb5c118591" ]
[ "imagenet/model.py" ]
[ "import os\nimport sys\nimport math\nimport time\nimport numpy as np\nimport logging\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom layers import set_layer_from_config\nfrom utils import BasicUnit\n \n\nclass MobileInvertedResidualBlock(BasicUnit):\n def __init__(self, mobile_inve...
[ [ "torch.nn.ModuleList", "torch.nn.AdaptiveAvgPool2d" ] ]
usgs/MinVel
[ "c56a247e6b612d81a678ca19b2def64ce3aef107" ]
[ "python/tests/test.py" ]
[ "# Import the modules\nimport sys\nimport MinVel as mv\nimport numpy as np\n\nnMin = 1\nnPT = 1\nfl = 'tests/testInput.dat.DONOTCHANGE'\nprint('Reading input file {0:s}'.format(fl))\nf = open(fl,\"r\")\nif f.mode == \"r\":\n nPT = 0\n ln = 0\n for line in f:\n line = line.strip()\n columns = ...
[ [ "numpy.load", "numpy.zeros" ] ]
theomeb/deepchain-app-pfam-32.0
[ "1397afa0fcd14ce7e0d10ebc14c3159771a3bc62" ]
[ "src/app.py" ]
[ "\"\"\"Template file to develop personal app\nWARNINGS: if you run the app locally and don't have a GPU\n you should choose device='cpu'\n\"\"\"\nfrom pathlib import Path\nfrom typing import Dict, List, Optional\n\nimport torch\nfrom biotransformers import BioTransformers\nfrom deepchain.components import ...
[ [ "torch.max", "torch.tensor" ] ]
HUTTON9453/Adversarial_Domain_Adaptation_for_Low_Resolution
[ "d233037c940885ab4c6fe768e6a8ea2776f8b993" ]
[ "models/discriminator.py" ]
[ "\"\"\"Discriminator model for ADDA.\"\"\"\n\nfrom torch import nn\n\n\nclass Discriminator(nn.Module):\n \"\"\"Discriminator model for source domain.\"\"\"\n\n def __init__(self, input_dims, hidden_dims, output_dims):\n \"\"\"Init discriminator.\"\"\"\n super(Discriminator, self).__init__()\n\n...
[ [ "torch.nn.Linear", "torch.nn.ReLU", "torch.nn.LogSoftmax" ] ]
xiaoyoyoada/MNIST_CIFAR_Classification_TF
[ "edad97f58a5259896b0c2bd677e75c4a703b54cb" ]
[ "cifar_cnn_augment.py" ]
[ "import os\nimport numpy as np\nimport tensorflow as tf\nfrom keras.datasets import cifar10\nfrom sklearn import utils\nfrom sklearn.model_selection import train_test_split\nfrom keras.utils.np_utils import to_categorical\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom cifar_data import batch_featur...
[ [ "tensorflow.get_variable", "tensorflow.nn.max_pool", "tensorflow.layers.dropout", "numpy.concatenate", "tensorflow.nn.l2_loss", "tensorflow.contrib.layers.flatten", "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.nn.conv2d", "tensorflow.Graph", ...
rahulghangas/cogent3
[ "f00cf822efce5f3141b3c7dafac81cb94a311e22" ]
[ "src/cogent3/evolve/simulate.py" ]
[ "#!/usr/bin/env python\n\"\"\"Random sequences and random evolution of sequences in a tree\"\"\"\n\nimport bisect\n\nimport numpy\n\n\n__author__ = \"Peter Maxwell\"\n__copyright__ = \"Copyright 2007-2019, The Cogent Project\"\n__credits__ = [\"Peter Maxwell\"]\n__license__ = \"BSD-3\"\n__version__ = \"2019.9.13a\"...
[ [ "numpy.add.accumulate" ] ]
minhnhatphan/rnsa21-cnn-lstm
[ "77d566d27cf465df0e222721d8fcadcc483a865d" ]
[ "src/data_retriever.py" ]
[ "from torch.utils.data import Dataset\nimport random\nimport torch\nimport glob\nimport os\n\nfrom utils import load_image, uniform_temporal_subsample, load_dicom\n\nclass DataRetriever(Dataset):\n def __init__(self, patient_path, paths, targets, n_frames, img_size, transform=None):\n self.patient_path = ...
[ [ "torch.stack", "torch.zeros", "torch.tensor" ] ]
shivamkejriwal9/algo_ds_101
[ "ba61e729ed99fafd5187cc29c34798d26ab0db17" ]
[ "Maths/Calculus/Runge–Kutta_Method/Runge-Kutta.py" ]
[ "import numpy as np\n\n\ndef dydx(x, y):\n return 2*x + np.sin( x * y )\n\n\nx0 = float(input(\"Enter value of x0:- \"))\ny0 = float(input(\"Enter value oy y0:- \"))\nh = float(input(\"Enter step size:- \"))\nn = int(input(\"Enter number of points.\"))\n\ny_vec = np.zeros((n, 1))\ny_vec[0] = y0\nx_vec = np.zeros...
[ [ "numpy.array", "numpy.zeros", "numpy.sin" ] ]
dazfuller/example-pyspark-unittesting
[ "aabd0815d5c7f125f87d06a8a9a84a24ec9ef02f" ]
[ "demo/dates.py" ]
[ "\"\"\"Provides methods for working with dates in Python.\"\"\"\n\nfrom datetime import date, datetime, time, timedelta, timezone\nfrom typing import Union\n\nimport pandas as pd\nfrom pyspark.sql import DataFrame, SparkSession\nfrom pyspark.sql.functions import (date_format, dayofmonth, from_unixtime,\n ...
[ [ "pandas.isnull" ] ]
tkeskita/phasepy
[ "d5a5573859258857ab1570568ad171c3c9b86d82" ]
[ "phasepy/mixtures.py" ]
[ "from __future__ import division, print_function, absolute_import\nimport numpy as np\nfrom collections import Counter\nfrom pandas import read_excel\nimport os\nfrom copy import copy\nfrom itertools import combinations\nfrom .saft_forcefield import saft_forcefield\nfrom .constants import kb, R\n\n\nclass component...
[ [ "numpy.log", "pandas.read_excel", "numpy.allclose", "numpy.asarray", "numpy.atleast_2d", "numpy.zeros_like", "numpy.zeros", "numpy.exp", "numpy.outer", "numpy.array", "numpy.polyval", "numpy.vstack" ] ]
rakutentech/iterative_training
[ "4bd9b8f64cdf2766af9b6fda0b4cb20d5d75b3bf" ]
[ "main_imagenet_float.py" ]
[ "\"\"\"\nSource: https://github.com/pytorch/examples/tree/master/imagenet\nLicense: BSD 3-clause\n\"\"\"\nimport argparse\nfrom bisect import bisect\nfrom datetime import datetime\nimport json\nimport os\nimport random\nimport shutil\nimport sys\nimport time\nimport warnings\n\nimport torch\nimport torch.nn as nn\n...
[ [ "torch.nn.CrossEntropyLoss", "torch.distributed.init_process_group", "torch.multiprocessing.spawn", "torch.utils.data.distributed.DistributedSampler", "torch.cuda.set_device", "torch.manual_seed", "torch.load", "torch.utils.data.DataLoader", "torch.nn.DataParallel", "torch....
YaGiNA/DLfS2
[ "3dbaba7a62c198b50849de2e3b74d92897a4cae7" ]
[ "ch06/rnn_gradient_graph.py" ]
[ "import numpy as np\r\nimport matplotlib as mpl\r\nmpl.use('Agg')\r\nimport matplotlib.pyplot as plt\r\n\r\nN = 2 # Size of minibatch\r\nH = 3 # Number of dimension of hidden vec\r\nT = 20 # Length of time data\r\n\r\ndh = np.ones((N, H))\r\nnp.random.seed(3) # Set seed of random number due to reproducibilit...
[ [ "numpy.dot", "numpy.random.seed", "matplotlib.use", "matplotlib.pyplot.savefig", "numpy.ones", "numpy.random.randn", "matplotlib.pyplot.xlabel", "numpy.sum", "matplotlib.pyplot.ylabel" ] ]
xapharius/HadoopML
[ "c0129f298007ca89b538eb1a3800f991141ba361" ]
[ "Engine/src/examples/linear_regression.py" ]
[ "import numpy as np\nfrom algorithms.linearRegression.LinearRegressionFactory import LinearRegressionFactory\nfrom algorithms.linearRegression.scipy_linreg import SciPyLinReg\nfrom algorithms.linearRegression.scipy_linreg_factory import SciPyLinRegFactory\nfrom datahandler.numerical.NumericalDataHandler import Nume...
[ [ "matplotlib.pyplot.plot", "numpy.array", "matplotlib.pyplot.show" ] ]
MartinBCN/BasicML
[ "7ad7bd075c62d883143dd10b54c80287d06a99b0" ]
[ "src/classification/classification_base.py" ]
[ "from abc import ABC, abstractmethod\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom src.utils.activation import softmax, cross_entropy\nfrom src.utils.scoring import classification_rate\nfrom src.utils.transform import one_hot\n\nnp.set_printoptions(linewidth=10000)\nimport logging\nlogger = logging...
[ [ "matplotlib.pyplot.legend", "numpy.set_printoptions", "numpy.ones", "matplotlib.pyplot.plot", "numpy.random.permutation", "numpy.zeros_like", "matplotlib.pyplot.subplot", "numpy.mean", "matplotlib.pyplot.show" ] ]
prasad-madhale/machine-learning
[ "bb611f809c16e1425136052e215ca83bd1148652", "bb611f809c16e1425136052e215ca83bd1148652" ]
[ "SVM/SVM_mnist_HAAR.py", "HAAR/HAAR_feature.py" ]
[ "import tensorflow as tf\nfrom HAAR_feature import generate_rectangles, each_item, verify_rectangle, reduce_train\nfrom sklearn.metrics import accuracy_score\nfrom sklearn import svm\nimport numpy as np\n\n\nmnist = tf.keras.datasets.mnist\n\n# get training and testing mnist set\n(x_train, y_train), (x_test, y_test...
[ [ "numpy.load", "sklearn.svm.LinearSVC", "sklearn.metrics.accuracy_score" ], [ "numpy.random.choice", "numpy.concatenate", "numpy.where", "numpy.load", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.zeros", "numpy.roll", "numpy.empty", "numpy.ra...
neuromorphs/LTC21-SNN
[ "c0bcde952fbcb340ac78f5d4b6784e4952ed40ac" ]
[ "models/predictive_model_dl.py" ]
[ "import nengo\nimport numpy as np\nimport pandas as pd\nimport scipy.linalg\nfrom scipy.special import legendre\nimport pickle\nimport nengo_dl\n# TODO MAKE THE MODELS AS OBJECT CLASSES\n# TODO ADD DOCUMENTATION\n\n# This code is completely taken from Terry Steward:\nclass DiscreteDelay(nengo.synapses.Synapse):\n ...
[ [ "numpy.dot", "numpy.asarray", "numpy.linalg.inv", "numpy.eye", "scipy.special.legendre", "numpy.array", "numpy.zeros" ] ]
MATRL19/Single-Vehicle-Routing-Problem
[ "45441e8a66b0efff8884d4078bb91322d6f1063c" ]
[ "LinearApproximation.py" ]
[ "import random\nimport math\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport Tile\nimport os, os.path\nimport numpy as np\nfrom math import pow\nimport pandas as pd\nimport csv\nfrom math import pow, sqrt\nfrom time import sleep\nfrom collections import defaultdict\nfrom scipy import sparse\nfrom n...
[ [ "numpy.array", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "matplotlib.pyplot.annotate", "numpy.ones", "matplotlib.pyplot.ylabel", "numpy.argmax", "numpy.fromstring", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "numpy.negative", "matplotlib.pyp...
JackHanley26/On-the-Edge-Anomaly-Detection
[ "219d323fbaae8c4ed2bb01e8162a182dbf79c227" ]
[ "src/utils/data_manager.py" ]
[ "import datetime\n\nfrom pandas import read_csv\nfrom sklearn.preprocessing import LabelEncoder, MinMaxScaler\n\n\"\"\"\n# backup\ncolours = [\"#C0C0C0\", \"#808080\", \"#000000\", \"#FF0000\", \"#800000\", \"#FFFF00\", \"#808000\", \"#00FF00\", \"#008000\", \"#00FFFF\",\n \"#008080\", \"#0000FF\", \"#00...
[ [ "sklearn.preprocessing.LabelEncoder", "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler" ] ]
hiyoung123/Chinese-Text-Matching-Pytorch
[ "a024a18167fa66e6de8bbb64cfe78699a3e59534" ]
[ "src/evaluation.py" ]
[ "#!usr/bin/env python\n#-*- coding:utf-8 -*-\n\nimport pickle\nimport random\nfrom tqdm import tqdm\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.metrics import accuracy_score, f1_score\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom transformers import (\n BertTokenizer, BertConfig, Be...
[ [ "pandas.read_csv", "torch.max", "torch.Tensor", "numpy.random.seed", "torch.load", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.is_available", "torch.cuda.manual_seed_all", "sklearn.metrics.f1_score", "sklearn.metrics.accuracy_sco...
oxfordeo/sat-extractor
[ "1d6841751e8b2ce65a02f5d3d608f181a31ab917" ]
[ "src/satextractor/preparer/gcp_preparer.py" ]
[ "from datetime import datetime\nfrom typing import Dict\nfrom typing import List\n\nimport numpy as np\nimport zarr\nfrom gcsfs import GCSFileSystem\nfrom joblib import delayed\nfrom joblib import Parallel\nfrom loguru import logger\nfrom satextractor.models import ExtractionTask\nfrom satextractor.models import Ti...
[ [ "numpy.datetime64" ] ]
garywangiam02/vnpy
[ "fbb168bf977d95ae874e92a3655c6c893db16a1f", "fbb168bf977d95ae874e92a3655c6c893db16a1f" ]
[ "vnpy/app/cta_crypto/strategies/strategy144_macd_channel_group_v1_2.py", "vnpy/app/cta_crypto/strategies/strategy144_macd_channel_group_v1_5.py" ]
[ "# encoding: UTF-8\r\n\r\n# 首先写系统内置模块\r\nimport sys\r\nimport os\r\nfrom datetime import datetime, timedelta, time, date\r\nimport copy\r\nimport traceback\r\nfrom collections import OrderedDict\r\nfrom typing import Union\r\nimport numpy as np\r\n\r\n# 然后是自己编写的模块\r\nfrom vnpy.trader.utility import round_to\r\nfrom...
[ [ "numpy.float32" ], [ "numpy.float32" ] ]
yue-litam/azurelane-auto-scripts
[ "f7aaa93b02d72e4895c28672ba72ee935334067c" ]
[ "detect-test.py" ]
[ "import numpy as np\nimport cv2\nimport wda\n\n\ndef main():\n image_path = './screen.png'\n feature_path = './iphone_se_3.0.0/feature/ambush_encountered_detection.png'\n\n c = wda.Client()\n _ = c.screenshot(image_path)\n screen = cv2.imread(image_path) # 加载图片\n screen_gray = cv2.cvtColor(screen...
[ [ "numpy.where" ] ]
makotovnjp/Talent5OpenPose
[ "1ebbbd4f226b6839d7d1627d6c33edd416c137fc" ]
[ "src/pose_estimation/utils/openpose_net.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torchvision\n\n\nclass OpenPoseNet(nn.Module):\n def __init__(self):\n super(OpenPoseNet, self).__init__()\n\n self.model0 = OpenPose_Feature()\n\n self.model1_1 = make_OpenPose_block('block1_1')\n self.model2_1 =...
[ [ "torch.nn.Sequential", "torch.cat", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.init.normal_", "torch.nn.ReLU" ] ]
frankzl/deep-rap
[ "f992081b136e02d6ee5f976f0343f7e3220a1f39" ]
[ "tools/training.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport glob\nimport os\n\n\ndef batch_data(num_data, batch_size):\n \"\"\" Yield batches with indices until epoch is over.\n\n Parameters\n ----------\n num_data: int\n The number of samples in the dataset.\n batch_size: int\n The batch size...
[ [ "numpy.asarray", "numpy.arange", "tensorflow.global_variables_initializer", "numpy.random.multinomial", "numpy.argmax", "tensorflow.Session", "tensorflow.train.Saver", "numpy.array", "numpy.exp", "numpy.sum" ] ]
msb002/imped2drt
[ "37247b8e29bc88b053bde8cf9b0981c3cf5c99cc" ]
[ "KKlib.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 24 16:36:57 2018\nLast Updated: Jan 17 2020\n@author: NicoleCreange\n\nBased on work by Yoed Tsur\n\"\"\"\n#%%\nimport numpy as np\nimport matplotlib.pyplot as plt\nnp.seterr(divide='ignore', invalid='ignore')\n\ndef KKT_i2r(ww,z): \n l...
[ [ "numpy.abs", "numpy.asarray", "numpy.flipud", "matplotlib.pyplot.subplots", "numpy.seterr", "numpy.delete", "scipy.interpolate.CubicSpline", "numpy.where", "numpy.sum" ] ]
w-k-jones/tobac
[ "e2af8e0c6f7e78f936c42539660bcb2b20e290c6" ]
[ "tobac/analysis.py" ]
[ "import pandas as pd\nimport numpy as np\nimport logging\nimport os\n\nfrom .utils import mask_cell,mask_cell_surface,mask_cube_cell,get_bounding_box\n\ndef cell_statistics_all(input_cubes,track,mask,aggregators,output_path='./',cell_selection=None,output_name='Profiles',width=10000,z_coord='model_level_number',dim...
[ [ "numpy.nanmax", "pandas.concat", "numpy.radians", "numpy.sqrt", "numpy.unique", "numpy.isnan", "numpy.arange", "numpy.nanmin", "numpy.cos", "pandas.DataFrame", "pandas.Timedelta", "numpy.sin", "numpy.diff", "numpy.array", "numpy.histogram", "numpy.su...
BrianBartling/MusicSymbolClassifier
[ "85042c305a2d0123149bc2e9ffea7f4dc5b4b839" ]
[ "ModelTester/ClassifyAndLocalizeImages.py" ]
[ "#!/usr/bin/python\nimport sys\nfrom argparse import ArgumentParser\nfrom typing import List\n\nimport imageio\nimport numpy\nfrom PIL import ImageDraw, Image\nfrom tensorflow.keras.models import load_model\nimport os\n\n\nclass_names = []\n\n\ndef test_model(model_path: str, image_paths: List[str]):\n # model_p...
[ [ "tensorflow.keras.models.load_model", "numpy.asarray", "numpy.std", "numpy.mean", "numpy.array" ] ]
ALPA-Industry-and-Technology/stable-baselines
[ "256b5c3d2e6dba692851211ec24261bbada98af2" ]
[ "stable_baselines/gail/dataset/dataset.py" ]
[ "import queue\nimport time\nfrom multiprocessing import Queue, Process\n\nimport cv2\nimport numpy as np\nfrom joblib import Parallel, delayed\n\nfrom stable_baselines import logger\n\n\nclass ExpertDataset(object):\n \"\"\"\n Dataset for using behavior cloning or GAIL.\n\n Data structure of the expert dat...
[ [ "numpy.random.shuffle", "numpy.concatenate", "numpy.prod", "matplotlib.pyplot.hist", "numpy.load", "numpy.array", "numpy.sum", "matplotlib.pyplot.show" ] ]
imhgchoi/Neural-Architecture-Search
[ "87b3d0ef3435e67a364615ff76388b87f47aaf66" ]
[ "models/worker/macro_cnn_worker.py" ]
[ "\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom util.neural_blocks import SeparableConv\n\n\n\ndef get_class_num(dataType):\n\tif dataType in ['mnist','cifar10'] :\n\t\treturn 10\n\telse :\n\t\traise ValueError('invalid dataset type {}'.format(dataType))\n\ndef get_in_channel_num(dat...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.functional.dropout", "torch.cat", "torch.zeros", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.sum", "torch.nn.init.kaiming_uniform_", "torch.nn.Linear", "torch.nn.AvgPool2d", "torch.nn.MaxPool2d", "torch.nn.AdaptiveAvgPool2...
mlindauer/EPM_DNN
[ "11022235382e10ed6e8c960d3320c81b3c34d4a7" ]
[ "scripts/evaluate_matlab.py" ]
[ "######################################################################\nimport logging\nimport sys\nimport os\nimport inspect\ncmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0]))\ncmd_folder = os.path.realpath(os.path.join(cmd_folder, \"..\"))\nif cmd_folder ...
[ [ "numpy.hstack", "pandas.read_csv", "numpy.random.seed", "numpy.min", "matplotlib.use", "sklearn.preprocessing.OneHotEncoder", "sklearn.metrics.mean_squared_error", "numpy.concatenate", "numpy.max", "numpy.log10", "matplotlib.pyplot.close", "numpy.savetxt", "nump...
nevermore3/PlateRecognition
[ "2d4a7604b0d85be4368542ad9fbd3553c99caa6a" ]
[ "models/easypr/dataset.py" ]
[ "import os\nimport random\nimport cv2\nimport numpy as np\nfrom queue import Queue\nfrom threading import Thread\nfrom six.moves import cPickle as pickle\n\n\nclass DataSet(object):\n def __init__(self, dataset_params, phase):\n\n # process params\n self.data_path = str(dataset_params['path'])\n ...
[ [ "numpy.asarray", "numpy.fromfile" ] ]
ishine/neural-lexicon-reader
[ "66f4c464a7a442812e79458759ac913ce51d1c6e" ]
[ "dataloader.py" ]
[ "import io\nimport logging\nimport threading\nimport queue\nimport traceback\nimport zipfile\nfrom collections import defaultdict\nimport time\nimport os\nimport numpy as np\nimport torch\nimport pickle\nimport json\nimport glob\nfrom utils.text import text_to_byte_sequence, text_to_char_sequence, text_to_word_sequ...
[ [ "numpy.pad", "numpy.random.seed", "numpy.asarray", "numpy.squeeze", "numpy.concatenate", "torch.cuda.is_available", "torch.cuda.device", "numpy.load", "numpy.random.RandomState", "numpy.zeros", "numpy.sum" ] ]
dataiku/near-neighbors-search
[ "6ec87c71c1086de037a5c0fe254bde5cc5f5664f", "6ec87c71c1086de037a5c0fe254bde5cc5f5664f" ]
[ "python-lib/nearest_neighbor/base.py", "tests/python/unit/test_base.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Module to wrap all Nearest Neighbor Search algorithms\"\"\"\n\nfrom typing import AnyStr, Dict, List, Tuple\n\nimport numpy as np\nimport pandas as pd\n\nfrom data_loader import DataLoader\n\n\nclass NearestNeighborSearch:\n \"\"\"Base class for all Nearest Neighbor Search algorit...
[ [ "pandas.DataFrame" ], [ "pandas.read_csv" ] ]
Sushant-aggarwal/text-uncertainity
[ "824767847f224ce2d8943e9fa0c01aad8b0fdda6" ]
[ "cnn_lstm.py" ]
[ "#Run in google colab.\n#---------Nilesh Agarwal---------#\n#agarwalnilesh97@gmail.com\n\n#!wget http://nlp.stanford.edu/data/glove.6B.zip\n#!unzip glove*.zip\nimport os\nimport numpy as np\nimport csv\nimport pandas as pd\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.optimizers import Adam\nfrom kera...
[ [ "pandas.concat", "pandas.read_csv", "sklearn.model_selection.StratifiedKFold", "pandas.DataFrame", "numpy.std", "numpy.fromstring", "numpy.mean", "numpy.array", "numpy.zeros" ] ]
belinghy/fairmotion
[ "748a76cea5f6f52f42c1af7b7f87d81d30d0cdb2" ]
[ "fairmotion/tasks/motion_prediction/utils.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n\nimport numpy as np\nimport os\nimport torch\nfrom functools import partial\nfrom multiprocessing import Pool\n\nfrom fairmotion.models import (\n decoders,\n encoders,\n optimizer,\n rnn,\n seq2seq,\n transformer,\n)\nfrom fairmotion.tasks.m...
[ [ "torch.cat" ] ]
RE-Lab-Projects/hplib-database
[ "61f33998d87174d209981ccf59c3e1393bb6ec25" ]
[ "src/hplib.py" ]
[ "\"\"\"\nThe ``hplib`` module provides a set of functions for simulating the performance of heat pumps.\n\"\"\"\nimport pandas as pd\nimport scipy\nfrom scipy.optimize import curve_fit\nfrom typing import Any, Dict, Union\nimport os\nimport numpy as np\n\n\ndef load_database() -> pd.DataFrame:\n \"\"\"\n Load...
[ [ "numpy.full_like", "scipy.optimize.leastsq", "numpy.where", "pandas.DataFrame" ] ]
Sulecs1/Diabetes_Classification_Project
[ "0522b88c39389810a92afe00d63825c42be0f768" ]
[ "Diabetes_Classification.py" ]
[ "########################################################\n# Diabetes Classification Project #\n########################################################\n#<<<Şule AKÇAY>>>\n#Pregnancies: Hamilelik sayısı\n#Glucose: Oral glikoz tolerans testintinde 2 saatlik plazma glikoz\n#konsantrasyonu\n#Bloo...
[ [ "pandas.pandas.set_option", "pandas.read_csv", "sklearn.tree.export_graphviz", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "numpy.sort", "sklearn.neighbors.LocalOutlierFactor", "pandas.DataFrame", "matplotlib.pyplot.savefig", "sklearn.tree.DecisionTreeClass...
guoqianyou/qlib
[ "184ce34a347123bf2cdd0bb48e2e110df9fe2722" ]
[ "qlib/data/dataset/processor.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\nimport abc\nfrom typing import Union, Text\nimport numpy as np\nimport pandas as pd\n\nfrom ...constant import EPS\nfrom .utils import fetch_df_by_index\nfrom ...utils.serial import Serializable\nfrom ...utils.paral import datetime_groupb...
[ [ "numpy.nanmax", "numpy.nanmedian", "numpy.abs", "numpy.nanmin", "numpy.union1d", "numpy.nanmean", "numpy.nanstd", "numpy.tanh", "numpy.isinf" ] ]
mhd-medfa/got10k-toolkit
[ "bef9f21a09f2a4f30a9f4c3faeb52e0019c32cdf" ]
[ "got10k/datasets/uav123.py" ]
[ "from __future__ import absolute_import, print_function\n\nimport os\nimport glob\nimport numpy as np\nimport six\nimport json\n\n\nclass UAV123(object):\n \"\"\"`UAV123 <https://ivul.kaust.edu.sa/Pages/pub-benchmark-simulator-uav.aspx>`_ Dataset.\n\n Publication:\n ``A Benchmark and Simulator for UAV ...
[ [ "numpy.loadtxt" ] ]
Ming2010/msds621
[ "4976b4c1547890b590383685ca7a7d665cc81ba5" ]
[ "projects/linreg/test_class.py" ]
[ "from sklearn.linear_model import LogisticRegression\nfrom sklearn.datasets import load_wine, load_iris\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import log_loss\n\nfrom linreg import *\n\ndef MAE(a,b): return np.mean(np.abs(a-b))\n\n\ndef wine_data():\n wine = load_wine()\n ...
[ [ "sklearn.linear_model.LogisticRegression", "sklearn.datasets.load_wine", "sklearn.datasets.load_iris", "sklearn.model_selection.train_test_split", "sklearn.metrics.log_loss" ] ]
ilovejs/RL
[ "2a28abc762b0415f38e90aff43eb8cf57dba798a" ]
[ "contents/2_Q_Learning_maze/RL_brain.py" ]
[ "\"\"\"\nThis part of code is the Q learning brain, which is a brain of the agent.\nAll decisions are made in here.\n\nView more on my tutorial page: https://morvanzhou.github.io/tutorials/\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\n\nclass QLearningTable:\n def __init__(self, actions, learning_rate=0...
[ [ "numpy.random.uniform", "numpy.random.permutation", "pandas.DataFrame", "numpy.random.choice" ] ]
apulis/segnet
[ "b0f1f726d4506d8ab99d8ac6146656d17a4aa438" ]
[ "segnet.py" ]
[ "\"\"\" segnet.py\n Implementation of SegNet for Semantic Segmentation.\n\"\"\"\n\n\nimport os\nimport sys\nimport time\nimport numpy as np\nimport tensorflow as tf\n\nfrom ops import *\n\nflags = tf.app.flags\nFLAGS = flags.FLAGS\n\n\ndef inference(inputs, phase_train):\n with tf.variable_scope(FLAGS.arch):\...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.equal", "tensorflow.cast", "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.squeeze", "tensorflow.gather", "tensorflow.train.MomentumOptimizer", "tensorflow.add", "tensorflow.name_scope...
mbz/Kitchen2D
[ "aeffbe37479eeaaf031b3ab6fa9c388286876638" ]
[ "kitchen2d/pour.py" ]
[ "#!/usr/bin/env python\n# Copyright (c) 2017 Zi Wang\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport kitchen2d.kitchen_stuff as ks\nfrom kitchen2d.kitchen_stuff import Kitchen2D\nfrom kitchen2d.gripper import Gripper\nimport sys\nimport numpy...
[ [ "numpy.sign", "numpy.random.uniform", "numpy.array", "numpy.ones" ] ]
id-shiv/utillib
[ "fc1186ac9cc505b884ff7cfdeccbea2bddf78d8a" ]
[ "projects/pybot/processor.py" ]
[ "import os\nimport json\n\nimport textblob\nimport pandas as pd\nimport numpy as np\n\n# import nltk\nfrom nltk.corpus import stopwords\nfrom nltk.corpus import words\n# nltk.download('stopwords')\n# nltk.download('words')\nfrom sklearn.ensemble import RandomForestClassifier\n\n\nINTENTS_PATH = 'projects/pybot/know...
[ [ "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame" ] ]
devincornell/sqlitedocuments
[ "16923bb3b91af5104140e49045efdc612afbc310" ]
[ "experiments/pytorch2.py" ]
[ "\nimport torch\nfrom tqdm import tqdm\nimport numpy as np\n\nimport sys\nsys.path.append('..')\nimport doctable\n\n\n\nif __name__ == '__main__':\n device = torch.device('cuda:0')\n #device = torch.device('cpu')\n\n # TASK: find sims between all points in this space\n shape = (int(2.5e5), 300)\n X =...
[ [ "torch.device", "numpy.array", "torch.rand", "torch.zeros" ] ]
brianrice2/cppn
[ "3c9c05dd612a198ddc1ea213614ffb6fed917bd0" ]
[ "sampler.py" ]
[ "'''\nImplementation of Compositional Pattern Producing Networks in Tensorflow\n\nhttps://en.wikipedia.org/wiki/Compositional_pattern-producing_network\n\n@hardmaru, 2016\nUpdated @brianrice2, 2020\n\nSampler Class\n\nThis file is meant to be run inside an IPython session, as it is meant\nto be used interacively fo...
[ [ "matplotlib.pyplot.imshow", "numpy.reshape", "tensorflow.reshape", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "numpy.random.uniform", "numpy.array", "matplotlib.pyplot.show" ] ]
MihaiLai/Disaster-Response-Classification
[ "bc495e259458cdb26bc5770cf200b8c2918831e7" ]
[ "app/run.py" ]
[ "import json\nimport re\nimport plotly\nimport pandas as pd\n\nfrom nltk.stem import WordNetLemmatizer\nfrom nltk.tokenize import word_tokenize\n\nfrom flask import Flask\nfrom flask import render_template, request, jsonify\nfrom plotly.graph_objs import Bar\nfrom sklearn.externals import joblib\nfrom sqlalchemy im...
[ [ "pandas.read_sql_table", "sklearn.externals.joblib.load" ] ]
brando90/RAdam
[ "57bedd136a4c9ee281c905865daafafaaeb2afa0" ]
[ "radam/radam.py" ]
[ "import math\nimport torch\nfrom torch.optim.optimizer import Optimizer, required\n\nclass RAdam(Optimizer):\n\n def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0, degenerated_to_sgd=True):\n if not 0.0 <= lr:\n raise ValueError(\"Invalid learning rate: {}\".forma...
[ [ "torch.zeros_like" ] ]
ShenQianwithC/HistomicsTK
[ "4ad7e72a7ebdabbdfc879254fad04ce7ca47e320" ]
[ "packages/pylibtiff/setup.py" ]
[ "#!/usr/bin/env python\nimport os\n\nCLASSIFIERS = \"\"\"\\\nDevelopment Status :: 3 - Alpha\nIntended Audience :: Science/Research\nLicense :: OSI Approved\nProgramming Language :: Python\nTopic :: Scientific/Engineering\nTopic :: Software Development\nOperating System :: Microsoft :: Windows\nOperating System :: ...
[ [ "numpy.distutils.core.Extension", "numpy.distutils.misc_util.Configuration" ] ]
Joshuaalbert/bayes_filter
[ "2997d60d8cf07f875e42c0b5f07944e9ab7e9d33" ]
[ "bayes_filter/sample.py" ]
[ "\"\"\"\nThis is a modification of tensorflow probability's tfp.mcmc.sample function that allows dynamic stopping\nusing rhat criteria. When median rhat per parameters falls by less than a certain percent.\n\nFigure out proper liscensing later.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ impo...
[ [ "tensorflow.convert_to_tensor", "tensorflow.math.abs", "tensorflow.abs", "tensorflow.nest.flatten", "tensorflow.while_loop", "tensorflow.compat.v1.get_variable_scope", "tensorflow.compat.v1.name_scope", "tensorflow.TensorShape", "tensorflow.executing_eagerly", "tensorflow.s...
fredyzhang5532/retinaface-tf2
[ "2195b3cc4161d8b8e8c09389ee46f4e812adc945" ]
[ "nets/mobilenet.py" ]
[ "from tensorflow.keras import backend as K\r\nfrom tensorflow.keras.layers import (Activation, BatchNormalization, Conv2D,\r\n DepthwiseConv2D)\r\n\r\n\r\n#----------------------------------#\r\n# 普通的卷积块\r\n#----------------------------------#\r\ndef _conv_block(inputs, filters...
[ [ "tensorflow.keras.layers.DepthwiseConv2D", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.backend.relu" ] ]
MartinPdS/PyMieSim
[ "2560c7f4009df5d05bcb0ce8e929aa7baa7be8de" ]
[ "PyMieSim/Tools/FiberModes.py" ]
[ "import numpy as np\nimport fibermodes\n\nfrom PyMieSim.Physics import FraunhoferDiffraction\nfrom PyMieSim.Tools.utils import Normalize\nfrom PyMieSim.Tools.Directories import *\n\n\nLPList = [(0,1),\n (0,2),\n (0,3),\n (1,1),\n (1,2),\n (1,3),\n (2,1),...
[ [ "numpy.array", "numpy.pad", "numpy.save" ] ]
choprahetarth/DeblurGANv2
[ "d471fb102a30ab380492ef5309af711802a309d7" ]
[ "models/fpn_densenet.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom torchvision.models import densenet121\n\n\nclass FPNSegHead(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_size=3, padding=1, bias=False)\n self.block1 = nn.Conv...
[ [ "torch.nn.functional.upsample", "torch.nn.Sequential", "torch.cat", "torch.nn.Conv2d", "torch.tanh", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
Qlanowski/rangle
[ "53299209e5e1fb9ce1c9eed4cf44ac34684dba02" ]
[ "evo_utils.py" ]
[ "import os\nimport os.path as osp\nimport pickle\nimport sys\nimport tempfile\nfrom contextlib import contextmanager\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2_as_graph\n\n\n@contextmanager\ndef suppress_stdout():\n ...
[ [ "tensorflow.compat.v1.profiler.ProfileOptionBuilder.float_operation", "tensorflow.distribute.cluster_resolver.TPUClusterResolver", "numpy.concatenate", "numpy.mean", "tensorflow.Graph", "tensorflow.keras.regularizers.l2", "tensorflow.tpu.experimental.initialize_tpu_system", "tensor...
ZHUXUHAN/reid-baseline
[ "43e8734be52a90d8131af8c4b43536ba6911bdaa" ]
[ "engine/trainer.py" ]
[ "# encoding: utf-8\n\"\"\"\n@author: sherlock\n@contact: sherlockliao01@gmail.com\n\"\"\"\n\nimport logging\n\nimport torch\nimport torch.nn as nn\nfrom ignite.engine import Engine, Events\nfrom ignite.handlers import ModelCheckpoint, Timer\nfrom ignite.metrics import RunningAverage\n\nfrom utils.reid_metric impor...
[ [ "torch.cuda.device_count", "torch.no_grad", "torch.nn.DataParallel" ] ]
mcx/SMAC3
[ "863e4290054847ba2688521b8cc2e44c15a1493a" ]
[ "smac/optimizer/epm_configuration_chooser.py" ]
[ "import logging\nimport typing\n\nimport numpy as np\n\nfrom smac.configspace import Configuration\nfrom smac.configspace.util import convert_configurations_to_array\nfrom smac.epm.rf_with_instances import RandomForestWithInstances\nfrom smac.optimizer.acquisition import AbstractAcquisitionFunction\nfrom smac.optim...
[ [ "numpy.array", "numpy.empty" ] ]
Codle/veGiantModel
[ "54df409d2c9e194a4e68ce7fe820bbd726525f90" ]
[ "src/veGiantModel/engine/module.py" ]
[ "# Copyright (c) 2021, ByteDance Inc. All rights reserved.\nimport os\nimport re as regex\nfrom functools import partial\nfrom math import floor\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nfrom deepspeed.pipe import LayerSpec, PipelineModule, TiedLayerSpec\nfrom deepspeed.runtime impo...
[ [ "torch.load", "torch.nn.ModuleDict", "torch.distributed.new_group", "torch.distributed.get_rank", "torch.distributed.get_world_size", "torch.distributed.all_reduce" ] ]
huiguoo/benchmark
[ "0c34e941193c3294bdf16fa57bcd788145f672af" ]
[ "torchbenchmark/models/maml/meta.py" ]
[ "import torch\nfrom torch import nn\nfrom torch import optim\nfrom torch.nn import functional as F\nfrom torch.utils.data import TensorDataset, DataLoader\nfrom torch import optim\nimport numpy as np\n\nfrom .learner import Learner\nfrom copy import deepcopy\n\n\n\nclass Meta(nn.Module):\n ...
[ [ "torch.nn.functional.softmax", "torch.eq", "torch.nn.functional.cross_entropy", "torch.tensor", "torch.no_grad", "torch.autograd.grad" ] ]
sakibguy/keras
[ "ea93c46545089efc1405c8c88e32b21129b24188" ]
[ "keras/tests/tracking_util_test.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.framework.test_util.run_in_graph_and_eager_modes", "tensorflow.compat.v2.executing_eagerly", "tensorflow.compat.v2.train.CheckpointManager", "tensorflow.python.training.tracking.util.list_objects", "tensorflow.compat.v2.compat.v1.make_template", "tensorflow.compat.v2.__i...
snth/pandas
[ "49a15b1a80656be0cad351d77c7e0c045fd7cf05" ]
[ "pandas/tests/test_series.py" ]
[ "# coding=utf-8\n# pylint: disable-msg=E1101,W0612\n\nimport re\nimport sys\nfrom datetime import datetime, timedelta\nimport operator\nimport string\nfrom inspect import getargspec\nfrom itertools import product, starmap\nfrom distutils.version import LooseVersion\nimport warnings\nimport random\n\nimport nose\n\n...
[ [ "pandas.PeriodIndex", "numpy.sqrt", "pandas.util.testing.makeObjectSeries", "pandas.util.testing.assert_contains_all", "pandas.util.testing._skip_if_no_pytz", "pandas.util.testing.assert_produces_warning", "pandas.MultiIndex.from_tuples", "numpy.all", "pandas.util.testing.asser...
amlozano1/kalman_car_counter
[ "0804a476e1b767365415d41cddf9d5946dd871ce" ]
[ "hungarian.py" ]
[ "__author__ = 'Anthony'\n\"\"\"\nSolve the unique lowest-cost assignment problem using the\nHungarian algorithm (also known as Munkres algorithm).\n\n\"\"\"\n# Based on original code by Brain Clapper, adapted to NumPy by Gael Varoquaux.\n# Heavily refactored by Lars Buitinck.\n\n# Copyright (c) 2008 Brian M. Clappe...
[ [ "numpy.logical_not", "numpy.min", "numpy.ones", "numpy.atleast_2d", "numpy.argmax", "numpy.any", "numpy.array", "numpy.zeros", "numpy.where" ] ]
TomasFisica/Redes_Prac_4
[ "fa594f088b2089ef789e014f564548388b4954c4" ]
[ "Garcia_Prac6.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Jun 9 19:13:27 2020\r\n\r\n@author: tomas\r\n\"\"\"\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n# =============================================================================\r\n# Funciones a utilizar\r\n# ==================================...
[ [ "numpy.ones_like", "numpy.random.normal", "numpy.array", "numpy.zeros" ] ]
pradeepkumarcm-egov/DIGIT-Dev
[ "d8fb601fae6d919d2386f36b36dfc7fde77ebd4f" ]
[ "utilities/datamart/fsm/fsm.py" ]
[ "import psycopg2\nimport csv\nimport pandas as pd\nimport numpy as np\nimport requests\nimport json\nfrom dateutil import parser\n\ndef mapApplicationChannel(s):\n return s.capitalize()\n \ndef map_vehicle_status(s):\n if s == 'SCHEDULED':\n return 'Scheduled'\n elif s == 'DISPOSED':\n ...
[ [ "pandas.read_sql_query", "pandas.merge", "pandas.to_datetime", "pandas.DataFrame" ] ]
Batake/wavegan
[ "8ba09b68717a29829c061083803b7d21f7004e19" ]
[ "eval/similarity/feats.py" ]
[ "import tensorflow as tf\nfrom scipy.io.wavfile import read as wavread\nimport numpy as np\nfrom tqdm import tqdm\n\nif __name__ == '__main__':\n import argparse\n import cPickle as pickle\n import glob\n import os\n import random\n import sys\n\n parser = argparse.ArgumentParser()\n parser.add_argument('--...
[ [ "tensorflow.matmul", "tensorflow.contrib.signal.linear_to_mel_weight_matrix", "tensorflow.shape", "tensorflow.contrib.signal.stft", "tensorflow.placeholder", "tensorflow.log", "tensorflow.Session", "numpy.array", "scipy.io.wavfile.read", "tensorflow.abs" ] ]
jelmer/datalad
[ "fedc04867d87e0191bd500991d0df97e97113457" ]
[ "datalad/tests/test_tests_utils.py" ]
[ "# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil; coding: utf-8 -*-\n# ex: set sts=4 ts=4 sw=4 noet:\n# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n#\n# See COPYING file distributed along with the datalad package for the\n# copyright and lic...
[ [ "numpy.arange" ] ]
bjayakumar/test_vendor
[ "e32c1a69754cedcec46d3e76e43a72743ebb8ed8", "e32c1a69754cedcec46d3e76e43a72743ebb8ed8" ]
[ "python/baseline/tf/seq2seq/train.py", "python/baseline/pytorch/seq2seq/model.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom baseline.utils import listify, get_model_file\nfrom baseline.reporting import basic_reporting\nfrom baseline.tf.tfy import optimizer\nfrom baseline.train import Trainer, create_trainer\nimport time\nimport os\nfrom baseline.utils import zip_model\n\nclass Seq2SeqTr...
[ [ "tensorflow.train.Saver", "tensorflow.global_variables_initializer", "numpy.exp" ], [ "torch.nn.Dropout", "torch.nn.LogSoftmax", "torch.LongTensor", "torch.load", "torch.cat", "torch.is_tensor", "torch.from_numpy", "torch.autograd.Variable", "torch.nn.Linear", ...
neohanju/AutoencodingTheWorld
[ "23f8a89bb7399df63cd7a0cb1b5a750214a44072" ]
[ "Datasets/RGBImageSet.py" ]
[ "import os\nimport glob\nimport torch.utils.data\nimport numpy as np\n\nclass RGBImageSet(torch.utils.data.Dataset):\n def __init__(self, path, centered=False):\n super().__init__()\n self.centered = centered\n self.add_string = lambda a, b: a + b\n\n assert os.path.exists(path)\n ...
[ [ "numpy.load", "numpy.transpose" ] ]
nashid/naturalcc
[ "9c3329dd8387c8242deb52bf590ebe3ac795f8de", "9c3329dd8387c8242deb52bf590ebe3ac795f8de" ]
[ "ncc/modules/encoders/tree/nary_tree_lstm.py", "run/translation/transformer/train.py" ]
[ "import dgl\nimport torch\nimport torch.nn as nn\n\nfrom ncc.data.constants import DEFAULT_MAX_SOURCE_POSITIONS\nfrom ncc.modules.base.layers import (\n Embedding,\n Linear,\n)\nfrom ..ncc_encoder import NccEncoder\n\n\nclass NaryTreeLSTMCell(nn.Module):\n def __init__(self, input_size: int, hidden_size: i...
[ [ "torch.sigmoid", "torch.zeros", "torch.cat", "torch.sum", "torch.tanh", "torch.chunk" ], [ "torch.multiprocessing.spawn", "torch.cuda.set_device", "torch.cuda.is_available", "torch.cuda.device_count", "torch.multiprocessing.set_sharing_strategy" ] ]
Komanawa-Solutions-Ltd/SLMACC-2020-CSRA
[ "914b6912c5f5b522107aa9406fb3d823e61c2ebe" ]
[ "Storylines/storyline_runs/run_SWG_for_all_months.py" ]
[ "\"\"\"\n the goal is to generate the full suite of options to pick from.\n Author: Matt Hanson\n Created: 24/02/2021 10:48 AM\n \"\"\"\nimport os\nimport datetime\nimport shutil\nimport ksl_env\nimport pandas as pd\nfrom Climate_Shocks import climate_shocks_env\nfrom BS_work.SWG.SWG_wrapper import default_vcf, def...
[ [ "pandas.read_csv" ] ]
nlpcl-lab/finelectra
[ "01a6cc175fba3f066a5cb77f30d52505dd004524" ]
[ "finetuning_withtorch.py" ]
[ "#############################################################################\n# prepare_dataset.py: return dataset according to the task\n# ref: huggingface/transformers/examples/run_glue.py\n# monologg/KoELECTRA/blob/master/finetune/processor/seq_cls.py\n# 현재 5e-05 -> 04로 바꾼 상태\n############################...
[ [ "numpy.squeeze", "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.device", "sklearn.metrics.classification_report", "torch.distributed.init_process_group", "torch.utils.data.distributed.DistributedSampler", "tor...
sisl/structmechmod
[ "069d680822e9aae7e4e198454048be59d632415d" ]
[ "structmechmod/odesolver.py" ]
[ "#\n# File: odesolver.py\n#\n\nimport abc\nimport torch\n\n\nclass Euler:\n\n @staticmethod\n def step_func(func, t, dt, y, u, transforms=None):\n return tuple(dt * f_ for f_ in func(t, y, u=u))\n\n @property\n def order(self):\n return 1\n\n\nclass Midpoint:\n\n @staticmethod\n def ...
[ [ "torch.is_floating_point", "torch.is_tensor" ] ]
QData/SanityCheck
[ "7cbf37296f84584b5372a1d556911ad4c1dfe138" ]
[ "sanity_checker/explanation.py" ]
[ "from enum import Enum\n\nfrom deepexplain.tensorflow import DeepExplain\nfrom vis.visualization import visualize_saliency, visualize_cam\nfrom vis.utils import utils as vutils\n\nimport tensorflow as tf\nimport numpy as np\n\nimport keras\nfrom keras.models import Model\nfrom keras import backend as K\n\nclass Exp...
[ [ "numpy.array", "numpy.nonzero" ] ]
shinying/METER
[ "4fa79cbeb7bb5a25a76b56b92f9ba73f9118b9fe" ]
[ "preproc/preproc_activitynetqa.py" ]
[ "import json\r\nimport os\r\nimport collections\r\nimport pandas as pd\r\n\r\n\r\ntrain_q = json.load(open(\"train_q.json\", \"r\"))\r\nval_q = json.load(open(\"val_q.json\", \"r\"))\r\ntest_q = json.load(open(\"test_q.json\", \"r\"))\r\n\r\ntrain_a = json.load(open(\"train_a.json\", \"r\"))\r\nval_a = json.load(op...
[ [ "pandas.DataFrame" ] ]
ohong/pretty-whale
[ "9435d2a04dea7509f10cfd17e44ab8d146c1eb5f" ]
[ "cgi-bin/paint_x2_unet/cgi_exe.py" ]
[ "#!/usr/bin/env python\n\n\nimport numpy as np\nimport chainer\nimport cv2\n\n#import chainer.functions as F\n#import chainer.links as L\n#import six\n#import os\n\nfrom chainer import cuda, serializers, Variable # , optimizers, training\n#from chainer.training import extensions\n#from train import Image2ImageData...
[ [ "numpy.asarray", "numpy.zeros" ] ]
JuliusvR/L5NeuronSimulation
[ "1fc68c7367c439e1f9c9b73a15a95609858ec720" ]
[ "L5NeuronSimulation/Group_EPSC_Tuning/print_results.py" ]
[ "import sys\nimport numpy as np\nimport pandas as pd\n\ndef main():\n ipscs_filename = sys.argv[-1]\n if __file__ != sys.argv[-1]:\n ipscs_filename = sys.argv[-1]\n else:\n raise Exception(\"Must be run as python print_results <filename>\")\n\n ipsc_csv = pd.read_csv(ipscs_filename)\n i...
[ [ "numpy.std", "pandas.read_csv", "numpy.mean" ] ]
DPBayes/dppp
[ "6b6cbf29a1605aebfeddf2813134fee3db931689" ]
[ "examples/vae.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n# SPDX-FileCopyrightText: © -2019 Copyright Contributors to the Pyro project.\n# SPDX-FileCopyrightText: © 2019- d3p Developers and their Assignees\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with th...
[ [ "numpy.prod" ] ]
Uvindu/Intelligent-Eye-Care-System
[ "ec06fece351ea09145da606d42c27998e14a80fe" ]
[ "previous_studies/gaze_tracking_udith/pupil.py" ]
[ "import numpy as np\r\nimport cv2\r\nm=6\r\ndef high(img):\r\n img = cv2.resize(img,(int(img.shape[1]*m),int(img.shape[0]*m)))\r\n dst = cv2.fastNlMeansDenoising(img,None,200.0, 7, 21)\r\n #dst2 = cv.fastNlMeansDenoising(dst,None,20.0,7,21)\r\n \r\n #dst3 = cv.fastNlMeansDenoising(dst2,None,50,7,21)\...
[ [ "numpy.ones" ] ]
es94129/hierarchical-explanation
[ "5ccbd7a0f43e47f0df9a73016f36042e09c5544d" ]
[ "hiexpl/algo/scd_lstm.py" ]
[ "import torch\nfrom algo.cd_func import CD\nfrom algo.scd_func import CD_gpu, get_lstm_states\nfrom algo.soc_lstm import ExplanationBase, SOCForLSTM, Batch, append_extra_input, normalize_logit\nimport copy\nfrom utils.args import get_args\n\nargs = get_args()\n\n\nclass CDForLSTM(ExplanationBase):\n def __init__...
[ [ "torch.stack", "torch.no_grad", "torch.from_numpy" ] ]
microsoft/CodeBERT
[ "c9bc756799967f428d8d48d0c89cd08150deeda0" ]
[ "GraphCodeBERT/clonedetection/run.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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...
[ [ "numpy.random.seed", "torch.load", "torch.manual_seed", "torch.utils.data.SequentialSampler", "sklearn.metrics.precision_score", "torch.utils.data.DataLoader", "torch.utils.data.RandomSampler", "torch.cuda.device_count", "torch.tensor", "numpy.concatenate", "torch.nn.Da...
erkundanec/BasicPython
[ "0d3bd1ccb603b94fc3701783dfb06f831ceb2541" ]
[ "OpenCV/AnacondaProjects/find_game.py" ]
[ "# import the necessary packages\nimport numpy as np\nimport cv2\n \n# load the games image\nimage = cv2.imread(\"games.jpg\",0)\ncv2.imshow('imgShow',image)\ncv2.waitKey(0)\n# find the red color game in the image\nupper = np.array([65, 65, 255])\nlower = np.array([0, 0, 200])\nmask = cv2.inRange(image, lower, uppe...
[ [ "numpy.array" ] ]
tatonetti-lab/sex_risks
[ "caa7159993921aa2861cae78a56c3e72052b4ea6" ]
[ "Code/drug.py" ]
[ "from collections import Counter\nimport numpy as np\nimport pandas as pd \nimport feather \nfrom scipy import stats\nimport pymysql\nimport pymysql.cursors\nfrom database import Database\nfrom utils import Utils\n\nclass Drug:\n \n db = Database('Mimir from Munnin')\n u = Utils()\n \n def __init__(s...
[ [ "numpy.take", "scipy.stats.chi2_contingency", "numpy.unique", "pandas.DataFrame", "numpy.append", "pandas.cut", "numpy.array", "numpy.where" ] ]
a5chin/NumberPlaceDataset
[ "d6e0eba6f0eade1cdb63e354cc066129b5ad04a5" ]
[ "lib/core/detector.py" ]
[ "import torch\nimport numpy as np\nimport cv2\nfrom PIL import Image, ImageOps\nfrom pathlib import Path\nfrom typing import List\n\nfrom lib.core import get_transforms\nfrom lib.model import get_resnet\n\n\nclass Detector:\n def __init__(self, ckpt: str='../logs/NumberPlaceDataset/ckpt/best_ckpt.pth') -> None:\...
[ [ "torch.device", "numpy.array", "torch.cuda.is_available" ] ]
yongchaoding/bus_passenger_detection
[ "a716631eb6370e795f7ca40a8869d6c4ba290091" ]
[ "models/ssd.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom data import *\nfrom models.layers.prior_box import PriorBox\nfrom models.layers.l2norm import L2Norm\nimport os\n\n\nclass SSD(nn.Module):\n \"\"\"Single Shot Multibox Architecture\n The network is...
[ [ "torch.nn.Softmax", "torch.load", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
algorithmvisualised/InsertionSort
[ "808e3e5e8be5c5d322be774325312c5767614bc1" ]
[ "insertion.py" ]
[ "import bpy\r\nimport numpy as np\r\nimport random\r\n\r\nSHOW_CODE_ANIMATION = False\r\n\r\nif SHOW_CODE_ANIMATION:\r\n TOTAL_NUMBERS = 16\r\n UNSORTED_ARRAY = np.random.randint(low = 1, high = 10, size=TOTAL_NUMBERS)\r\n print(UNSORTED_ARRAY)\r\n UNSORTED_ARRAY = [8, 3, 1, 6, 4, 2, 9, 5 ]\r\nelse:\r\...
[ [ "numpy.copy", "numpy.amax", "numpy.unique", "numpy.random.randint" ] ]
KCGallagher/birdspy
[ "234911777db4b0a6402750516e8efd9f62748054" ]
[ "birdspy/dataset_factory.py" ]
[ "#\n# Generates training and test datasets from image data and annotations\n#\n\nimport os\nimport shutil\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nfrom typing import List\n\nimport birdspy as bs\n\n\nclass DatasetFactory:\n \"\"\"Factory to generate ground...
[ [ "numpy.random.rand", "numpy.unique" ] ]
rubenvdg/dask
[ "85f0b14bd36a5135ce51aeee067b6207374b00c4" ]
[ "dask/dataframe/core.py" ]
[ "import copy\nimport operator\nimport warnings\nfrom collections.abc import Iterator, Sequence\nfrom functools import partial, wraps\nfrom numbers import Integral, Number\nfrom operator import getitem\nfrom pprint import pformat\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.api.types import (\n is_bool...
[ [ "pandas.tseries.frequencies.to_offset", "pandas.Series", "numpy.sqrt", "numpy.linspace", "numpy.asarray", "numpy.issubdtype", "pandas.api.types.is_scalar", "pandas.api.types.is_datetime64_any_dtype", "numpy.nan_to_num", "numpy.cumsum", "pandas.DataFrame", "numpy.all...
Fermilab-Quantum-Science/Z2Sim-public
[ "dfbefffd933aa2e39a0cb9f668b424596dfa7d35" ]
[ "z2_sim/src/QuantumCircuits/Cirq_Code/production.py" ]
[ "\"\"\"production.py - production code for computing observables.\"\"\"\nimport time\n\nfrom typing import Optional, Callable, Sequence\n\nimport numpy as np\nimport cirq\nimport qsimcirq\n\nfrom z2_sim.src.QuantumCircuits.Cirq_Code.Z2GaugeCirq import (\n make_trotter_circuit,\n make_trotter_circuit_ancillafr...
[ [ "numpy.array", "numpy.zeros", "numpy.ones" ] ]
FastTrackOrg/FastAnalysis
[ "fa8e8c72be034c3eb0fa3f40718134f784445a5c" ]
[ "fastanalysis/tests/test_plot.py" ]
[ "import pytest\nimport pandas\nimport numpy as np\n\nimport load\nimport plot\n\n\ndef test_velocity_dist_default_key():\n \"\"\"Test velocity distribution.\"\"\"\n tracking = load.Load(\"tests/tracking.txt\")\n plotObj = plot.Plot(tracking)\n velocityTest = plotObj.velocityDistribution(ids=[0, 1])\n ...
[ [ "numpy.concatenate", "numpy.testing.assert_array_equal", "numpy.diff" ] ]
sashatankov/terrier
[ "c50a22a6a6d0ef5d01c2ad8760f02bcffb15f688" ]
[ "script/model/training_util/data_transforming_util.py" ]
[ "import numpy as np\n\nfrom info import data_info\nfrom type import OpUnit\n\n\ndef _tuple_num_linear_train_transform(x, y):\n # Linearly transform down the target according to the tuple num value in the input\n tuple_num = np.copy(x[:, data_info.TUPLE_NUM_INDEX])\n return y / tuple_num[:, np.newaxis]\n\n\...
[ [ "numpy.copy", "numpy.log2" ] ]
RaghavendraSingh/TensorFlowOnSpark
[ "3a207830a8fce53ced20df2f5b7efa3be0cc40c4" ]
[ "test/test_TFCluster.py" ]
[ "import unittest\nimport test\nfrom tensorflowonspark import TFCluster, TFNode\n\n\nclass TFClusterTest(test.SparkTest):\n @classmethod\n def setUpClass(cls):\n super(TFClusterTest, cls).setUpClass()\n\n @classmethod\n def tearDownClass(cls):\n super(TFClusterTest, cls).tearDownClass()\n\n def test_basic...
[ [ "tensorflow.constant", "tensorflow.placeholder", "tensorflow.train.replica_device_setter", "tensorflow.global_variables_initializer", "tensorflow.add", "tensorflow.square", "tensorflow.Session", "tensorflow.train.MonitoredTrainingSession" ] ]
poldracklab/fmriprep
[ "5e5c1b61af35cded21879b0dc1a83673c8a46430" ]
[ "fmriprep/config.py" ]
[ "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n#\n# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Licen...
[ [ "numpy.random.seed" ] ]
fepegar/InnerEye-DeepLearning
[ "6aab3b1f931ad9c5f9546d77b22676ac4f34da2d" ]
[ "Tests/ML/models/test_parallel.py" ]
[ "# ------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.\n# -----------------------------------------------------------...
[ [ "torch.nn.ConvTranspose3d", "torch.nn.Conv3d", "torch.cuda.is_available", "torch.device", "torch.cuda.device_count" ] ]
zhixuanli/FFT_python_implementation
[ "5559e69495191350102f341541f266d20e39a6a8" ]
[ "utils.py" ]
[ "import numpy as np\nimport cv2\nimport os\n\nfrom fourier_transform import *\n\n\ndef img_FFT(img):\n if len(img.shape) == 2 or len(img.shape) == 3:\n return FFT_2D(img)\n else:\n raise ValueError(\"Please input a gray or RGB image!\")\n\n\ndef img_FFT_inverse(img):\n if len(img.shape) == 2 ...
[ [ "numpy.real", "numpy.fft.ifft2", "numpy.pad" ] ]
Njreardo/tensorflow
[ "de52bc1b16ec15c2afc5696edd89480f8bad5257" ]
[ "tensorflow/python/ops/image_ops_test.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.sqrt", "tensorflow.python.ops.image_ops.adjust_saturation", "numpy.cumsum", "numpy.all", "tensorflow.python.ops.gen_image_ops.non_max_suppression_v2", "tensorflow.python.ops.image_ops.flip_up_down", "tensorflow.python.ops.image_ops.non_max_suppression", "tensorflow.python.op...
aaronzguan/RadimoicDeepFeatureExtraction
[ "86867356e1af1b2a473afe563cb4a5ba63a70494" ]
[ "main.py" ]
[ "import torch\nimport torchvision.models as models\nfrom torchsummary import summary\nimport numpy as np\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.dataset import Dataset\nfrom torchvision import transforms\nfrom PIL import Image\nimport os\nf...
[ [ "torch.nn.functional.softmax", "torch.max", "numpy.asarray", "torch.utils.data.DataLoader", "matplotlib.pyplot.plot", "torch.no_grad", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss", "sklearn.metrics.precision_recall_curve", "torch.optim.lr_scheduler.StepLR", "m...
braunmagrin/pandas-coalesce
[ "4fef04b833e9193c2194805a44a8a0d9b93df71c" ]
[ "coalesce.py" ]
[ "import pandas as pd\n\n\ndef coalesce(self, columns, name='coalesced'):\n \"\"\"\n Coalesce the DataFrame's columns in order\n\n Parameters\n ----------\n columns : list-like\n\n Returns\n -------\n coalesced : Series\n \"\"\"\n from functools import reduce\n return reduce(lambda s...
[ [ "pandas.Series" ] ]
revsic/tf-speech-dataset
[ "93a3ce2574616a3a52d2ac99af9826af680dda8f" ]
[ "utils/normalizer.py" ]
[ "from typing import List\n\nimport tensorflow as tf\n\n\nclass TextNormalizer:\n \"\"\"Normalize text in to fixed graphme set.\n WARNING: It does not accept digits, please use normalized text in LJ Speech.\n \"\"\"\n GRAPHEMES = 'abcdefghijklmnopqrstuvwxyz !?,.'\n REPLACER = {\n '\"\\'()-:;[]’...
[ [ "tensorflow.convert_to_tensor", "tensorflow.py_function" ] ]
shahlab/nnPUlearning
[ "0458f78510ee2383f6988733ccb26298f62cd7bb" ]
[ "model.py" ]
[ "import warnings\n\nwarnings.filterwarnings('ignore')\n\nimport chainer\nimport chainer.functions as F\nimport chainer.links as L\nimport numpy as np\nfrom chainer import Chain\nfrom chainer.backends import cuda\nfrom sklearn.metrics import recall_score\nfrom functools import partial\n\n\nclass MyClassifier(Chain):...
[ [ "sklearn.metrics.recall_score", "numpy.where", "numpy.unique" ] ]
mimipaskova/MasterThesis
[ "9288b7cb566839e91cb0fb7cee4f28a930f20807" ]
[ "MUSE/unsupervised.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nimport os\nimport time\nimport json\nimport argparse\nfrom collections import OrderedDict\nimport numpy as np\nimpo...
[ [ "numpy.mean", "torch.cuda.is_available" ] ]