repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
marcosfrenkel/PHYS-398
[ "323092b64b092c78d5c35acfd32d4a263dc00ea1" ]
[ "mls/variational.py" ]
[ "\"\"\"Variational inference utilities\nfor the UC Irvine course on 'ML & Statistics for Physicists'\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport scipy.stats\n\n\ndef calculate_KL(log_q, log_p, theta):\n \"\"\"Calculate the KL divergence of q wrt p for single-para...
[ [ "numpy.zeros_like", "numpy.argmin", "numpy.random.RandomState", "numpy.exp", "matplotlib.pyplot.figure", "numpy.trapz", "numpy.isfinite", "matplotlib.pyplot.subplot2grid", "numpy.abs", "numpy.linspace", "matplotlib.pyplot.subplots_adjust" ] ]
pplonski/my_ml_service_old
[ "00f5e4104a0f763af06f57cbe857b668d5a00dc6" ]
[ "backend/server/apps/ml/income_classifier/random_forest.py" ]
[ "import joblib\nimport pandas as pd\n\nclass RandomForestClassifier:\n def __init__(self):\n path_to_artifacts = \"../../research/\" \n self.values_fill_missing = joblib.load(path_to_artifacts + \"train_mode.joblib\")\n self.encoders = joblib.load(path_to_artifacts + \"encoders.joblib\")\n ...
[ [ "pandas.DataFrame" ] ]
learningmatter-mit/GLAMOUR
[ "a283025fb38192fd49909ab21e35337cb5488867" ]
[ "utils/macro_unsupervised.py" ]
[ "import os\nimport grakel\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\nfrom scipy.spatial import distance\nfrom sklearn import decomposition, manifold\nimport umap.umap_ as umap\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\ndef edit_distance(graph1, ...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.locator_params", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "sklearn.manifold.TSNE", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter", ...
mtasende/disaster-response
[ "fed024d77ad9ab4cf409e8f65659ed8d4d95c007" ]
[ "models/train_classifier.py" ]
[ "import sys\nfrom sklearn.model_selection import train_test_split\n# from models.model import Model\nfrom models.model_004_xgboost_gridsearch import Model004\nfrom time import time\n\ncurrent_model = Model004() # Change this to use another model\n\n\ndef load_data(database_filepath):\n \"\"\" Wrapper function. ...
[ [ "sklearn.model_selection.train_test_split" ] ]
elerac/polanalyser
[ "801c6ed71d635dfc20e1514f76408133956c8d9d" ]
[ "documents/create_AoLP_wheel.py" ]
[ "\"\"\"\nCreate a color map of the AoLP\n\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport cv2\n\ndef plot_hsv_wheel(filename, is_saturation=False, is_value=False, DoLP_tick=False, dpi=300):\n \"\"\"\n Plot HSV wheel\n\n H : AoLP\n S : DoLP or constant value\n V : DoLP or constant v...
[ [ "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "numpy.linspace", "numpy.meshgrid", "numpy.mod", "matplotlib.pyplot.subplot" ] ]
SEDSIIT/performance-calculators
[ "1d6d490d44fb3517d10198c33eb979fe593b1aa9" ]
[ "Performance_Estimator/drag.py" ]
[ "'''\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY...
[ [ "numpy.sin", "numpy.arctan", "numpy.log" ] ]
sneakers-the-rat/pyqtgraph
[ "65ef2a5a60a1a08d0106e819110528b2ca3499a3" ]
[ "pyqtgraph/widgets/TableWidget.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nfrom ..Qt import QtGui, QtCore\nfrom ..python2_3 import asUnicode, basestring\nfrom .. import metaarray\n\n\n__all__ = ['TableWidget']\n\n\ndef _defersort(fn):\n def defersort(self, *args, **kwds):\n # may be called recursively; only the first call needs to bl...
[ [ "numpy.linspace", "numpy.ones", "numpy.isscalar" ] ]
danielhomola/federated_ml_platform
[ "353a2e8472f17bd4d3787748a96c269970ef1d3b" ]
[ "src/neoglia/etl/utils.py" ]
[ "import os\nimport logging\n\nimport psycopg2\nimport sshtunnel\nimport pandas as pd\n\nlogger = logging.getLogger(__name__)\n\n\ndef connect_to_db_via_ssh(ssh_info, db_info):\n \"\"\"\n Connects to a remote PostgreSQL db, via SSH tunnel.\n\n Args:\n ssh_info (obj): All ssh connection info.\n ...
[ [ "pandas.read_csv", "pandas.Series", "pandas.read_sql_query" ] ]
anujdutt9/ESPCN
[ "896ba54940dd2fc1f6c7ae6a9257d3fcfdf85842" ]
[ "dataloader.py" ]
[ "import os\nimport cv2\nimport random\nimport numpy as np\nfrom PIL import Image\nfrom glob import glob\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import IterableDataset, DataLoader\n\n\n# Ref.: https://github.com/yjn870/ESPCN-pytorch/blob/ab84ee1bccb2978f2f9b88f9e0315d9be12c099e/prepare.py#L16\n# Trai...
[ [ "numpy.array", "matplotlib.pyplot.subplots", "torch.utils.data.DataLoader", "matplotlib.pyplot.show", "numpy.expand_dims" ] ]
zavalit/Multi-Human-Parsing
[ "26c0e4ed560ecb486ac59011c3fa579b12aca796" ]
[ "Evaluation/Multi-Human-Parsing/v2/voc_eval.py" ]
[ "# --------------------------------------------------------\n# Fast/er R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Bharath Hariharan\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.sum", "numpy.where", "numpy.finfo", "numpy.arange", "numpy.sort", "numpy.argsort", "numpy.cumsum", "numpy.argmax", "numpy.maximum" ] ]
zfergus/fenics-topopt
[ "b8479f3b069fb86256be749c209698571260cac9" ]
[ "topopt/problem.py" ]
[ "from __future__ import division\n\nimport numpy as np\n\nimport pdb\n\nimport scipy.sparse\nfrom scipy.sparse import coo_matrix\nimport cvxopt\nimport cvxopt.cholmod\n\nfrom utils import deleterowcol\n\n\nclass Problem(object):\n\n @staticmethod\n def lk(E=1.):\n \"\"\"element stiffness matrix\"\"\"\n...
[ [ "numpy.array", "numpy.setdiff1d", "numpy.zeros", "numpy.ones", "numpy.arange" ] ]
guoyingying432/lung-segmentation-by-unet-and-tensorflow
[ "f766b06cac2ad46f607cd81a9fa618f32c51bfc0" ]
[ "unet.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Nov 12 18:24:43 2019\r\nThe class of unet_3D for the centernet detection\r\n@author: wjcongyu\r\n\"\"\"\r\nimport os\r\nimport os.path as osp\r\nimport tensorflow as tf\r\nfrom tensorflow import math\r\nfrom tensorflow import keras\r\nfrom tensorflow.keras import...
[ [ "tensorflow.keras.utils.to_categorical", "tensorflow.keras.layers.Activation", "tensorflow.reshape", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.BatchNormalization", "tensorflow.python.ops.math_ops.cast", "tensorflow.keras.layers.MaxPooling3D", "tensorflow.GradientT...
Daybreak2019/pytorch
[ "b80c6f863f2327c712c478f67c248b94d66b65ac" ]
[ "test/test_nn.py" ]
[ "\nimport math\nimport random\nimport string\nimport unittest\nimport io\nimport unittest.mock as mock\nimport itertools\nimport warnings\nimport pickle\nfrom copy import deepcopy\nfrom itertools import repeat, product\nfrom functools import reduce\nfrom operator import mul\nfrom collections import OrderedDict\n\ni...
[ [ "torch.nn.functional.softshrink", "torch._nnpack_spatial_convolution", "torch.nn.SmoothL1Loss", "torch.nn.functional.adaptive_avg_pool1d", "torch.nn.functional.fractional_max_pool3d", "numpy.random.random", "torch.nn.init.normal_", "numpy.expand_dims", "torch.cosine_similarity"...
lehduong/NPTM
[ "e1b8ec333db35e0e32e360151956b0f48f102735" ]
[ "hrank/data/imagenet.py" ]
[ "import os\nimport torchvision.transforms as transforms\nimport torchvision.datasets as datasets\nfrom torch.utils.data import DataLoader\n\n\nclass Data:\n def __init__(self, args):\n pin_memory = False\n if args.gpu is not None:\n pin_memory = True\n\n scale_size = 224\n\n ...
[ [ "torch.utils.data.DataLoader" ] ]
bdecost/gpytorch
[ "a5f1ad3e47daf3f8db04b605fb13ff3f9f871e3a" ]
[ "test/examples/test_kissgp_gp_regression.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom math import exp, pi\n\nimport os\nimport random\nimport torch\nimport unittest\nimport gpytorch\nfrom torch import optim\nfrom torch.autograd import Variab...
[ [ "torch.cuda.manual_seed_all", "torch.get_rng_state", "torch.sin", "torch.max", "torch.linspace", "torch.manual_seed", "torch.abs", "torch.cuda.is_available", "torch.set_rng_state" ] ]
maartenelgar/Block_Fund_Trading
[ "0ced0f4ac5bb8785ca1b75e55dee7df1db5030a8" ]
[ "build/lib/Scripts/RoibalBot.py" ]
[ "\r\nfrom binance.client import Client\r\nimport time\r\nimport matplotlib\r\nfrom matplotlib import cm\r\nimport matplotlib.pyplot as plt\r\nfrom binance.enums import *\r\nimport save_historical_data_Roibal\r\nfrom BinanceKeys import BinanceKey1\r\n\r\n\r\napi_key = BinanceKey1['OfBLqIoRvQCloLCSc5lmrN5ikapHhDul27y...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots" ] ]
jessica-lei/coronavirus-2020
[ "d51d73dd8d021bb51b78f653a87d478298794534" ]
[ "exp/polynomial_regression.py" ]
[ "import numpy as np\ntry:\n import matplotlib.pyplot as plt\nexcept:\n import matplotlib\n matplotlib.use('Agg')\n import matplotlib.pyplot as plt\n\nclass PolynomialRegression():\n def __init__(self, degree):\n \"\"\"\n Implement polynomial regression from scratch.\n \n T...
[ [ "matplotlib.use", "numpy.full", "numpy.array", "numpy.matmul", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "numpy.transpose", "numpy.arange" ] ]
mrsono0/pnu-ingro
[ "a5d1f917ed0c6fb13e4bf4986f0768e224ae6b7a" ]
[ "supplementary_lessons/A_Group/jjioii25/Gevolution/run_inclue_batch.py" ]
[ "import requests\nimport xmltodict\nfrom urllib.request import urlopen\nimport pandas as pd\nimport numpy as np\nimport pymysql as my\nfrom random import choice\nimport sys\n\nconn = None\n# 데이터베이스 연결\ndef openDB():\n conn = my.connect(\n host = '127.0.0.1',\n use...
[ [ "pandas.DataFrame" ] ]
LVParkinson/bird_species_classification
[ "3c5d7dc8bcb426ba6b1457239702b27bb28880b4" ]
[ "mask_rcnn/test_images.py" ]
[ "import sys\nimport random\nimport math\nimport cv2\nimport os\nfrom matplotlib import pyplot as plt\nimport numpy as np\nfrom keras.layers import Conv2D, MaxPooling2D\nfrom keras.optimizers import Adam\nfrom keras.layers import (\n Dense,\n Activation,\n Dropout,\n Flatten,\n Input,\n AveragePool...
[ [ "numpy.bincount", "numpy.reshape", "numpy.asarray", "numpy.save", "numpy.argmax", "numpy.argsort" ] ]
rahulisaac/image-processing
[ "595e702e337729844625cd6d5d8252fcc9b63a6a" ]
[ "code/04-drawing/ApplyMask.py" ]
[ "\"\"\"\n * Python program to apply a mask to an image.\n *\n\"\"\"\nimport numpy as np\nimport skimage\nfrom skimage.viewer import ImageViewer\n\n# Load the original image\nimage = skimage.io.imread(\"maize-roots.tif\")\n\n# Create the basic mask\nmask = np.ones(shape=image.shape[0:2], dtype=\"bool\")\n\n# Draw a ...
[ [ "numpy.ones" ] ]
nklugman/PlugWatch
[ "4fbd2506a6808542fc5246e87d3c382761da1eaf" ]
[ "powerwatch/analysis/old_analysis_scripts/pw_clustering.py" ]
[ "#!/usr/bin/env python3\n\n# looking for big cluster of events and plotting GPS\n\nimport dateutil\nimport csv\nimport math\nimport pprint\nimport sys\nimport time\n\nimport itertools\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ntry:\n pw_file = sys.argv[1]\nexcept:\n print()\n print('Usage: {} ...
[ [ "numpy.average", "matplotlib.pyplot.scatter", "matplotlib.pyplot.show", "numpy.diff" ] ]
SeonghoBaek/RealtimeCamera
[ "1b371b58eafdddf94330f008495dc9ad593ea8e1" ]
[ "layers.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.client import device_lib\nimport numpy as np\nimport util\nimport argparse\nimport os\nimport csv\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\ninput_feature_dim = 97\ncond_step_dim = 8\ncond_wafer_dim = 24\ncond_dim = cond_step_dim + cond_wafer_dim\n\nlstm_sequence...
[ [ "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.contrib.rnn.BasicLSTMCell", "tensorflow.matmul", "tensorflow.nn.moments", "tensorflow.reshape", "tensorflow.contrib.rnn.MultiRNNCell", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorf...
jsr1611/efficient_object_labeling_tool
[ "ff51935a1c267dd58845a7864114868f1e55cbf9" ]
[ "yolo_v31.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nClass definition of YOLO_v3 style detection model on image and video\n# Added functionalities:\n # Manually remove bboxes, and draw new ones\n # Auto identify the duration of the video input file in number of frames => frame_count_total variable\n # Handle missing objects ...
[ [ "numpy.array", "numpy.add", "numpy.asarray", "numpy.random.seed", "numpy.random.shuffle", "numpy.subtract", "numpy.append", "numpy.expand_dims", "numpy.floor" ] ]
zhutchens1/inverse_transform_sampling
[ "496a124f7723bda4d9b5c439d94aabfb787d30a0" ]
[ "inverse_transform_sampling.py" ]
[ "import numpy as np\nfrom scipy.interpolate import interp1d\n\ndef inverse_transform_sampling(data, bins, nsamples):\n \"\"\"\n Extract random samples from a distribution\n using inverse transform sampling. This code\n uses a Univariate Spline (without smoothing)\n to extract the inverse CDF for an a...
[ [ "numpy.histogram", "numpy.zeros_like", "scipy.interpolate.interp1d", "numpy.random.rand", "numpy.random.normal", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "numpy.cumsum", "matplotlib.pyplot.show" ] ]
Qinaty/input-aware-backdoor-attack-release
[ "ce897adf4a3ce0d2badbd2b53233561fee6c7db7" ]
[ "classifier_models/vgg.py" ]
[ "\"\"\"VGG11/13/16/19 in Pytorch.\"\"\"\nimport torch\nimport torch.nn as nn\n\n\ncfg = {\n \"VGG11\": [64, \"M\", 128, \"M\", 256, 256, \"M\", 512, 512, \"M\", 512, 512, \"M\"],\n \"VGG13\": [64, 64, \"M\", 128, 128, \"M\", 256, 256, \"M\", 512, 512, \"M\", 512, 512, \"M\"],\n \"VGG16\": [64, 64, \"M\", 1...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.randn" ] ]
adelabriere/matchms
[ "a580539e6db3f4f00e12097983b85b2d494159ba" ]
[ "matchms/similarity/CosineGreedy.py" ]
[ "from typing import Tuple\nimport numpy\nfrom matchms.typing import SpectrumType\nfrom .BaseSimilarity import BaseSimilarity\nfrom .spectrum_similarity_functions import collect_peak_pairs\nfrom .spectrum_similarity_functions import score_best_matches\n\n\nclass CosineGreedy(BaseSimilarity):\n \"\"\"Calculate 'co...
[ [ "numpy.asarray", "numpy.argsort" ] ]
maksimio/csi_classification
[ "b3f87e3de84f9e6d5f2ae34ea2d61e84a413553f" ]
[ "classification.py" ]
[ "from metawifi.df import wifilearn\nfrom metawifi import WifiDf, WifiLearn\nimport pandas as pd\nfrom matplotlib import pyplot as plt\nimport scipy\nimport seaborn as sns\n\n\nwd = WifiDf('./csi/use_in_paper/2_objects').set_type('abs')\n# wd = WifiDf('./csi/homelocation/three place').set_type('abs')\nx, y, z, a = w...
[ [ "pandas.DataFrame", "matplotlib.pyplot.show" ] ]
qiuqiangkong/HEAR2021_Challenge_PANNs
[ "daae61a072d0102ef224e5c7c4038bf5960c43c5" ]
[ "panns_hear/panns.py" ]
[ "import torch\n\nfrom .models import Cnn14\n\n\ndef load_model(model_file_path, device=None):\n if device is None:\n device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')\n\n # Instantiate model\n model = Cnn14(\n sample_rate=32000,\n window_size=1024,\n hop_si...
[ [ "torch.zeros", "torch.arange", "torch.no_grad", "torch.cuda.is_available", "torch.load" ] ]
lamvng/Log-File-Analysis
[ "6870afe2b3bf143ca31cb4df191d208101ccfd80" ]
[ "predict.py" ]
[ "import argparse\nfrom tensorflow.keras.models import load_model\nfrom preprocess import load_file, process_data, feature_extract\nimport settings\nfrom numpy import unique\nimport json\nfrom datetime import datetime\nfrom termcolor import colored\n\n\nsettings.init()\n\n\ndef predict(df_test):\n print(colored('...
[ [ "tensorflow.keras.models.load_model", "numpy.unique" ] ]
BlueWay-KU/Study
[ "a86405cdc3011eaed1b980b562b75df1e9ce90a8" ]
[ "DeepLearning/Python/Chapter 3/Ch03-04-01-network.py" ]
[ "import numpy as np\r\n\r\ndef sigmoid(x):\r\n return 1 / (1 + np.exp(-x))\r\n\r\nX = np.array([1.0, 0.5])\r\nW1 = np.array([[0.1, 0.3, 0.5], [0.2, 0.4, 0.6]])\r\nB1 = np.array([0.1, 0.2, 0.3])\r\n\r\nprint(W1.shape)\r\nprint(X.shape)\r\nprint(B1.shape)\r\n\r\nA1 = np.dot(X, W1) + B1\r\nZ1 = sigmoid(A1)\r\n\r\np...
[ [ "numpy.array", "numpy.dot", "numpy.exp" ] ]
maknotavailable/security-hub
[ "9c073b457fb871480db871d0665dbd7683940d25" ]
[ "src/detect_live.py" ]
[ "# import the necessary packages\nfrom imutils.video import VideoStream\nfrom imutils.video import FPS\nimport numpy as np\nimport imutils\nimport time\nimport cv2\nimport logging\n\n# Format logging\nlog = logging.getLogger(__name__)\nlogging.basicConfig(level=logging.INFO,\n format = '%...
[ [ "numpy.array", "numpy.arange" ] ]
spectre007/CCParser
[ "d48421ad0f178bfe7aa6ce93692858c86f44d1ed" ]
[ "ParserData.py" ]
[ "from . import constants as c\nimport numpy as np\nimport json\n\nclass Struct(object):\n \"\"\" Struct-like container object \"\"\"\n def __init__(self, **kwds): # keyword args define attribute names and values\n self.__dict__.update(**kwds)\n\nclass ParseContainer(object):\n \"\"\" Generic contain...
[ [ "pandas.DataFrame", "pandas.Series" ] ]
andersonmarques/programacao_2_ufra
[ "94a22559eed817a429309d8da338431416608c0c" ]
[ "vetores_matrizes/q154.py" ]
[ "import numpy as np\n\nmatriz = np.random.rand(3,6)\n\nsoma_vendas = 0\nvalor_vendedor_top = 0\nvendedor_top = \"\"\n\nfor i in range(0, len(matriz)):\n for j in range(0, len(matriz[0])):\n soma_vendas += matriz[i][j]\n\n soma_vendedor = 0\n soma_vendedor += matriz[i][j]\n print(soma_...
[ [ "numpy.round", "numpy.random.rand" ] ]
sparks-baird/piro
[ "3edb29c2bc9e3e4e64b91d89c815744d7db655d5" ]
[ "piro/route.py" ]
[ "import logging\n\nimport numpy as np\nimport plotly.express as px\nimport pandas as pd\nimport os\nimport json\n\nfrom pymatgen.core import Composition\nfrom pymatgen.analysis.phase_diagram import PhaseDiagram\nfrom pymatgen.util.string import latexify\nfrom piro.data import GASES, GAS_RELEASE, DEFAULT_GAS_PRESSUR...
[ [ "pandas.DataFrame.from_dict", "numpy.round" ] ]
Lee-000/tensorbay-python-sdk
[ "63dee8fe43043d60ed1c85aa88b652ef23979925" ]
[ "docs/code/use_dataset_in_pytorch.py" ]
[ "#!/usr/bin/env python3\n#\n# Copyright 2021 Graviti. Licensed under MIT License.\n#\n\n# pylint: disable=pointless-string-statement\n# pylint: disable=wrong-import-position\n# pylint: disable=import-error\n# type: ignore\n\n\"\"\"This is the example code for using dataset in Pytorch.\"\"\"\n\n\n\"\"\"Build a Segme...
[ [ "torch.utils.data.DataLoader" ] ]
elliehastings/ApptClassifier
[ "2152e45e5d8d262860fec2e5430cc2ef04749b73" ]
[ "classifier.py" ]
[ "## Imports\n\nimport csv, numpy, scipy\nfrom pandas import DataFrame, Series\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.naive_bayes import MultinomialNB\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.metrics import confusion_matrix, f1_score\n\n## Functions\n\ndef load_data(pa...
[ [ "numpy.array", "pandas.DataFrame", "numpy.random.permutation", "sklearn.naive_bayes.MultinomialNB", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.metrics.f1_score" ] ]
Shui-Group/TargetDIA
[ "d697390728793c20dfe4426cce250c72b42cb0d2" ]
[ "models/pdeep2/model/similarity_calc.py" ]
[ "from scipy.stats.stats import pearsonr, spearmanr, kendalltau\nimport tensorflow as tf\nimport numpy as np\n\n\ndef cosine(v1, v2):\n return np.dot(v1, v2) / (np.linalg.norm(v1)*np.linalg.norm(v2))\n\n\ndef similarity(v1, v2):\n v1 = np.array(v1)\n v2 = np.array(v2)\n pcc = pearsonr(v1, v2)[0]\n cos...
[ [ "numpy.dot", "numpy.median", "numpy.mean", "tensorflow.cast", "numpy.linalg.norm", "tensorflow.constant", "tensorflow.ConfigProto", "numpy.array", "numpy.reshape", "numpy.std", "tensorflow.placeholder", "tensorflow.reduce_sum", "tensorflow.nn.top_k", "tensor...
braingineer/neural_tree_grammar
[ "e0534b733e9a6815e97e9ab28434dae7b94a632f" ]
[ "fergus/algorithms/linearizer/__main__.py" ]
[ "from __future__ import print_function, absolute_import, division\nfrom ..linearizer import run, run_dp\nfrom sqlitedict import SqliteDict as SD\nimport numpy as np\nimport time\nfrom . import utils\nimport sys\ntry:\n input = raw_input\nexcept:\n pass\n\ndef test():\n test_datum = (u'(ROOT(S(NP)(VP(VBD ra...
[ [ "scipy.stats.describe", "numpy.mean" ] ]
wubinzzu/DeepRS
[ "1f2749d08df7a22e4b3a1c420d28ca19d8756629" ]
[ "deepRS/models/xdeepfm.py" ]
[ "# -*- coding:utf-8 -*-\n\"\"\"\nAuthor:\n Weichen Shen,wcshen1994@163.com\n\nReference:\n [1] Lian J, Zhou X, Zhang F, et al. xDeepFM: Combining Explicit and Implicit Feature Interactions for Recommender Systems[J]. arXiv preprint arXiv:1803.05170, 2018.(https://arxiv.org/pdf/1803.05170.pdf)\n\"\"\"\nfrom te...
[ [ "tensorflow.python.keras.layers.Concatenate", "tensorflow.python.keras.layers.add", "tensorflow.python.keras.layers.Flatten", "tensorflow.python.keras.regularizers.l2", "tensorflow.python.keras.layers.Dense", "tensorflow.python.keras.layers.Reshape", "tensorflow.python.keras.models.Mod...
cattech-lab/lecture1_unimolecular_reaction
[ "6187983094ba282a606e50d756643b3e9c7484e8" ]
[ "euler_heat_transfer.py" ]
[ "import matplotlib.pyplot as plt\nimport csv\nimport math\n\n# parameter\ntemp = 100.0\nta = 20.0\n\nh = 400.0\n\ntime = 0.0\ndt = 0.1\n\nd = 0.01\nden = 7870.0\ncp = 442.0\narea = math.pi * d**2\nvol = math.pi * d**3 / 6.0 \nmass = den * vol\n\n# graph data array\ngtime = []\ngtemp = []\n\n# csv file\noutfile = op...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
osigaud/rex-gym
[ "cd2a1a333fba7d7e7ee3bf2165979dfda750ddda" ]
[ "rex_gym/envs/rex_gym_env.py" ]
[ "\"\"\"This file implements the gym environment of Rex.\n\n\"\"\"\nimport collections\nimport math\nimport time\nimport gym\nimport numpy as np\nimport pybullet\nimport pybullet_data\n\nfrom gym import spaces\nfrom gym.utils import seeding\n\nfrom ..model import rex, motor, mark_constants, rex_constants\nfrom ..mod...
[ [ "numpy.concatenate", "numpy.array", "numpy.asarray" ] ]
autocorr/astroML
[ "9bdeff87b9ae1993849bfc04d7f2865c05c8e52e" ]
[ "book_figures/chapter5/fig_signal_background.py" ]
[ "\"\"\"\nFinding a signal in a background\n--------------------------------\nFigure 5.26\n\nFitting a model of a signal in an unknown background. The histogram in the\ntop-right panel visualizes a sample drawn from a Gaussian signal plus a\nuniform background model given by eq. 5.83 and shown by the line. The remai...
[ [ "scipy.stats.norm", "scipy.stats.uniform", "numpy.random.seed", "numpy.sum", "numpy.exp", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.sqrt", "numpy.random.random", "numpy.linspace", "matplotlib.pyplot.axes" ] ]
Milwaukee-Bugs-NTUA/AdvancedDB20-21
[ "7fc1208a74459dfe1f09b7ae430ddca7cfa03e60" ]
[ "src/test_queries.py" ]
[ "#!/usr/bin/env python\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport sys\n\nfrom query1 import *\nfrom query2 import *\nfrom query3 import *\nfrom query4 import *\nfrom query5 import *\nfrom query1_rdd import *\nfrom query2_rdd import *\nfrom query3_rdd import *\nfrom query4_rdd import *\nfrom quer...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots" ] ]
marcomameli1992/FakeNews
[ "ff0eabd848402fefc66062d05b0c4fa6647ea0f4" ]
[ "models/mixed_model.py" ]
[ "import torch\nimport torch.nn as nn\nfrom models.bert import BertForSentimentClassification\nfrom models.vgg import VGG16FT\nfrom models.classification import Classification\nfrom models.vit import ViTFT\n\nclass MixModel(nn.Module):\n def __init__(self, config, n_classes=2, bert_path=None, vit = False, vgg_pat...
[ [ "torch.flatten", "torch.no_grad", "torch.cuda.is_available", "torch.load" ] ]
mlaves/imes4d
[ "d1505f75487ced0a10c05f1c937af91ff666e3d4" ]
[ "stitch_n_volumes.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nfrom imes4d.PyrLK3D import PyrLK3D\nfrom imes4d.utils import Timer, ransac, blend_collection\n\n\nif __name__ == \"__main__\":\n\n N = 7\n scale = 2\n transformations = []\n data_prefix = 'data/sb_'\n\n a = np.load(data_prefix + '0.npz')\n a = a[a.file...
[ [ "numpy.savez_compressed", "numpy.load", "numpy.sort" ] ]
KUASWoodyLIN/Udacity_self_driving_car_challenge_5
[ "af94d5232795925580f74eca2468ec3de6cd4b48" ]
[ "svm_training.py" ]
[ "import os\nimport time\nimport pickle\nfrom glob import glob\n\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\nfrom sklearn.svm import LinearSVC\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_selection import train_test_split\n\nfrom image_processing.vehicles_detect_model...
[ [ "matplotlib.pyplot.subplot", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.imsave", "matplotlib.pyplot.savefig", "numpy.copy", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.random.randint", "numpy.vstack", "sklearn.model_selection.train_test_spl...
hrsu/disturb
[ "38396fceb6c7b11fbc369166c7eea048c4188391" ]
[ "Bayes/Multinomial_Bayes.py" ]
[ "from sklearn.naive_bayes import MultinomialNB #多项式分布朴素贝叶斯\nimport numpy as np\nimport sklearn.model_selection as train\nfrom sklearn.metrics import accuracy_score\nimport os\n\n#数据目录\nFilePath = os.path.abspath('..')+\"\\\\data\"\n\n\ndef loadData(filename,type):\n data = np.loadtxt(filename, dtype=type, delim...
[ [ "numpy.split", "sklearn.metrics.accuracy_score", "sklearn.naive_bayes.MultinomialNB", "numpy.loadtxt", "sklearn.model_selection.train_test_split" ] ]
HacksForHugs/ray
[ "4af42d5bb6ab3fef7dad80c722249218bb9cc061" ]
[ "python/ray/tune/logger.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport csv\nimport json\nimport numpy as np\nimport os\nimport yaml\n\nfrom ray.tune.result import TrainingResult\nfrom ray.tune.log_sync import get_syncer\n\ntry:\n import tensorflow as tf\nexcept ...
[ [ "tensorflow.Summary", "tensorflow.summary.FileWriter", "numpy.issubdtype", "numpy.isnan" ] ]
reneevdw/GenNet
[ "e30f0cce4372c770f8d4692ce6a6f61a160c0d5d" ]
[ "GenNet_utils/LocallyDirectedConnected.py" ]
[ "# For the article see https://www.biorxiv.org/content/10.1101/2020.06.19.159152v1\n# For an explenation how to use this layer see https://github.com/ArnovanHilten/GenNet\n# Locallyconnected1D is used as a basis to write the LocallyDirected layer\n# ==================================================================...
[ [ "tensorflow.python.keras.utils.conv_utils.normalize_data_format", "tensorflow.python.keras.backend.bias_add", "tensorflow.sparse.reshape", "tensorflow.sparse.expand_dims", "tensorflow.sparse_tensor_dense_matmul", "numpy.mat", "tensorflow.SparseTensor", "tensorflow.python.keras.back...
wei-mao-2019/gsps
[ "7f8de905f49bc739747174ade343a431ec8fe74e" ]
[ "motion_pred/utils/dataset.py" ]
[ "import numpy as np\n\n\nclass Dataset:\n\n def __init__(self, mode, t_his, t_pred, actions='all'):\n self.mode = mode\n self.t_his = t_his\n self.t_pred = t_pred\n self.t_total = t_his + t_pred\n self.actions = actions\n self.prepare_data()\n self.std, self.mean ...
[ [ "numpy.concatenate", "numpy.random.randint", "numpy.random.choice" ] ]
nb-377/OPF-Tutorial
[ "186d97edde9dff3ab631006bf7e426853e0cb1f3" ]
[ "OPF_Tutotial_Islanded_charging_git.py" ]
[ "# This script was written by Nicholas Barry on 2/16/2022. It is part of a tutorial on optimum power flow.\r\n# This script demonstrates ESS charging on an islanded microgrid using optimal power flow.\r\n# It connects to OpenDSS for some inputs and validation of the resulting voltage and powers.\r\n# This is intend...
[ [ "numpy.array", "numpy.delete", "numpy.angle", "numpy.reshape", "numpy.asarray", "numpy.ravel", "numpy.abs", "numpy.sqrt", "numpy.size", "pandas.read_csv" ] ]
callbarian/vidsurveil_application
[ "6ced0f65ee9859d45cccfa2979ddd7a8b469d336" ]
[ "miniview.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport subprocess\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtGui import QPen, QBrush\nfrom PyQt5.Qt import Qt\nfrom PyQt5 import QtCore\n\nclass Miniview():\n def __init__(self):\n self.scene = QGraphicsScene()\n def draw_anomalou...
[ [ "numpy.array", "numpy.zeros" ] ]
visma-prodsec/columbo
[ "8ed803833755e41a6872a505dea6ba4baf50f355" ]
[ "runningProcesses.py" ]
[ "import forRunningProcesses\nimport os\nimport run\n\n\nimport pandas as pd\nfrom colorama import Fore\nfrom pandas import DataFrame\n\ndir_path = os.path.dirname(os.path.realpath(__file__))\n\n\ndef live_process():\n \"\"\"\n Identify live processes in combination with traceability combined with ML.\n \"\...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
vgainullin/iclr19-graph2graph
[ "effafc08d90466977aed0c77712a39d142f0c3e6" ]
[ "fast_jtnn/mpn.py" ]
[ "import torch\nimport torch.nn as nn\nimport rdkit.Chem as Chem\nimport torch.nn.functional as F\nfrom fast_jtnn.nnutils import *\nfrom fast_jtnn.chemutils import get_mol\n\nELEM_LIST = ['C', 'N', 'O', 'S', 'F', 'Si', 'P', 'Cl', 'Br', 'Mg', 'Na', 'Ca', 'Fe', 'Al', 'I', 'B', 'K', 'Se', 'Zn', 'H', 'Cu', 'Mn', 'unknow...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.stack", "torch.nn.functional.relu", "torch.nn.functional.pad", "torch.Tensor" ] ]
dganguly1120/tf-pose-estimation
[ "622d3c96f2cb9951dffe857ddc67978299d5ced6" ]
[ "tf_pose/network_cmu.py" ]
[ "from __future__ import absolute_import\n\nfrom tf_pose import network_base\nimport tensorflow as tf\n\n\nclass CmuNetwork(network_base.BaseNetwork):\n def setup(self):\n (self.feed('image')\n .normalize_vgg(name='preprocess')\n .conv(3, 3, 64, 1, 1, name='conv1_1')\n ....
[ [ "tensorflow.compat.v1.variable_scope" ] ]
pzjzeason/BrainCancer
[ "682a5635b4c3106a6d6df20cbff917e423e0c269" ]
[ "predict_associated_tumors/score_test.py" ]
[ "import json\nfrom openpyxl import load_workbook\nfrom pandas import DataFrame\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\ndata = {}\nwith open(\"/Users/燚/study/大三下/信息系统开发与设计/系统开发/score/score_with_associatedTumours2.json\", \"r\", encoding='utf-8') as json_file:\n for each in jso...
[ [ "pandas.DataFrame", "matplotlib.pyplot.subplot" ] ]
jkoloda/deivos
[ "d41bc4d0cc62896fe0bf5e7a73a8e1ae7315795f" ]
[ "test/test_squeezenet.py" ]
[ "\"\"\"Tester for squeezenet module.\"\"\"\r\n\r\nimport unittest\r\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom deivos.architectures.squeezenet import (\r\n default_preprocessor,\r\n expand,\r\n fire_module,\r\n get_model_v10,\r\n get_model_v11,\r\n squeeze,\r\n)\r\n\r\n\r\nclass TestLa...
[ [ "tensorflow.random.normal", "tensorflow.TensorShape", "numpy.random.randint" ] ]
tridivb/Soccer_Ball_Detector_with_FCNN_and_ConvLSTM
[ "41758736a4f7fd29981f4954578e520a2f592099" ]
[ "utils/processing.py" ]
[ "import torch\r\nimport numpy as np\r\nimport cv2\r\n\r\n\r\nclass BoundingBox(object):\r\n \"\"\" Class to process the data as necessary\r\n \"\"\"\r\n def __init__(self, device):\r\n self.device = device\r\n\r\n def pre_process(self, bbox, input_size, output_size):\r\n \"\"\" Pre-process...
[ [ "torch.zeros", "torch.round", "numpy.array", "numpy.dot", "numpy.zeros", "torch.from_numpy", "torch.abs", "torch.DoubleTensor", "numpy.stack", "numpy.sqrt" ] ]
lakshaykc/lfm_quant
[ "ac6f47c9a36f681920314423e2502f3654c5b592" ]
[ "scripts/data_processing.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport copy\nfrom datetime import datetime\nimport time\nimport pickle\nimport random\nimport pandas as pd\nimport numpy as np\nimport tensorflow as tf\nimport pathlib\nfrom skle...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "numpy.sign", "pandas.read_csv", "pandas.offsets.DateOffset", "numpy.divide", "numpy.concatenate", "numpy.empty", "pandas.set_option", "numpy.log1p", "pandas.DateOffset", "numpy.fabs", "numpy.append", "pandas.to_date...
Abhimanyu8/Utkranti4.0_Team_Runtime_Matrix
[ "a69978d1397e90e7e13eb77c614e47ee8dd9085c" ]
[ "Video FPS benchmark.py" ]
[ "# import the necessary packages\nfrom imutils.video import FPS\nimport numpy as np\nimport argparse\nimport imutils\nimport cv2\n# construct the argument parse and parse the arguments\nap = argparse.ArgumentParser()\nap.add_argument(\"-v\", \"--video\", required=True,\n\thelp=\"path to input video file\")\nargs = ...
[ [ "numpy.dstack" ] ]
devskroy1/ForkedBrainSurfaceTK
[ "774035ab5eae6c0a40eb96eab43d489d3f722eaa" ]
[ "models/pointnet/src/models/pointnet2_regression_v2.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch.nn import Sequential as Seq, Linear as Lin, ReLU, BatchNorm1d as BN\nfrom torch_geometric.nn import PointConv, fps, radius, global_max_pool\n\n\nclass SAModule(torch.nn.Module):\n def __init__(self, ratio, r, nn):\n super(SAModule, self).__init__(...
[ [ "torch.nn.Linear", "torch.cat", "torch.stack", "torch.nn.ReLU", "torch.nn.BatchNorm1d" ] ]
mhamedLmarbouh/bonnetal
[ "f8ab00cf0d2aa4bfa5d6c3fe1512e1c6a4d60d32" ]
[ "train/tasks/classification/modules/traceSaver.py" ]
[ "#!/usr/bin/env python3\n# This file is covered by the LICENSE file in the root of this project.\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torchvision.transforms as transforms\nimport imp\nimport yaml\nimport time\nfrom PIL import Image\nimport...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.onnx.export", "torch.jit.trace", "torch.randn" ] ]
bracket/handsome
[ "c93d34f94d0eea24f5514efc9bc423eb28b44a6b" ]
[ "tests/test_micropolygon.py" ]
[ "from handsome.Micropolygon import Micropolygon\nfrom handsome.util import point\nimport numpy as np\n\ndef test_micropolygon():\n m = Micropolygon(\n point(0, 0),\n point(1, 0),\n point(1, 1),\n point(2, 1),\n )\n\n tests = [\n [ (.5 , .5) , np.array([ 1, .5 , 1, 1 ]), ]...
[ [ "numpy.array", "numpy.testing.assert_array_equal" ] ]
Biles430/Python_Modules
[ "6434e587699f745f244b99cef57f75dcd99b749f" ]
[ "hotwire.py" ]
[ "#!/usr/bin/python\n# Filename: HotWire.py\n\n################### IMPORTS #######################\nimport pandas as pd\nfrom pandas import DataFrame\nimport numpy as np\nimport h5py\n#######################################################\n #LAST UPDATED : 8-16-16\n###############################################...
[ [ "numpy.array", "numpy.zeros", "pandas.DataFrame", "numpy.exp", "numpy.tanh", "numpy.loadtxt", "pandas.read_hdf", "numpy.size", "numpy.append", "numpy.log10" ] ]
graziegrazie/SC-CAM
[ "0c3b40e15ba5c4164287f07931a076001249d706" ]
[ "tool/infer_utils.py" ]
[ "import os\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nimport shutil\nimport scipy.misc\nimport imageio\nimport math\n\n\n\ndef create_class_key_in_dict(dict, cls_nb):\n for i in range(cls_nb):\n dict[i] = []\n return dict\n\n\ndef calculate_class_avg_iou(class_iou_dict...
[ [ "numpy.ones_like", "numpy.load", "numpy.where", "numpy.concatenate", "numpy.max", "numpy.linalg.norm", "numpy.log", "numpy.argmax", "numpy.transpose", "numpy.expand_dims", "matplotlib.pyplot.cm.hot", "numpy.array", "numpy.zeros", "numpy.amax", "numpy.arg...
akjayant/coding_reinforcement_learning
[ "5882b4e55907a517915e3df698eebb80252c732d" ]
[ "Policy Gradients/Reinforce_continous_action.py" ]
[ "#------------------THIS IS VANILLA REINFORCE ALGORITHM WITH NO BASELINE-----------------------------------------------\n\nimport gym\nimport torch\nimport torch as T\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\n#from gym import wrappers\nfrom torch.distributions import Norm...
[ [ "torch.nn.Linear", "torch.diag_embed", "torch.cat", "torch.stack", "torch.nn.functional.softplus", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "torch.from_numpy", "torch.nn.ReLU", "torch.cuda.is_available", "numpy.arange", "torch.tensor", "pandas....
awb-carleton/pattern-analysis
[ "532066398f2d102031aaa86b9a7c739ee16ceb9c" ]
[ "foldit/variation_analysis.py" ]
[ "from pattern_extraction import *\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport logging\nimport json\nimport sys\nimport os\nimport string\nimport re\nfrom typing import Dict, Tuple, List\nfrom itertools import combinations, groupby, chain\nfrom util import category_lookup\nfrom plot_util import...
[ [ "matplotlib.use", "scipy.stats.iqr", "numpy.median", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots" ] ]
chto/redmapper
[ "1dc66b601889ef9913f0f9b2e05980b982834485" ]
[ "tests/test_cluster.py" ]
[ "from __future__ import division, absolute_import, print_function\nfrom past.builtins import xrange\n\nimport unittest\nimport numpy.testing as testing\nimport numpy as np\nimport fitsio\nfrom numpy import random\n\nfrom redmapper import Entry\nfrom redmapper import Cluster\nfrom redmapper import Configuration\nfro...
[ [ "numpy.random.seed", "numpy.where", "numpy.array", "numpy.testing.assert_almost_equal" ] ]
ali-mahdavi-mazdeh/pyHMT2D
[ "5351ea8a0d234d4a2b8e1e62c803d7f3cfeb0f4d" ]
[ "pyHMT2D/Misc/Terrain.py" ]
[ "\"\"\"\nA Python class for terrain data I/O, creation, and manipulation\n\"\"\"\n\nimport math\n\nimport numpy as np\nimport sys\n\nfrom osgeo import gdal\nfrom osgeo import osr\n\nfrom pyHMT2D.Hydraulic_Models_Data import HydraulicData\nimport random\n\nclass Terrain(HydraulicData):\n \"\"\"A Python class for ...
[ [ "numpy.array", "numpy.sin", "numpy.zeros", "numpy.tan", "numpy.arctan", "numpy.sqrt", "numpy.abs", "numpy.deg2rad", "numpy.cos" ] ]
londoed/a3c
[ "10073b294cf8faeb78d7be4737513d88d93ff0d7" ]
[ "a3c.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport sonnet as snt\nimport gym\n\nimport os\nimport threading\nimport multiprocessing\nimport argparse\nfrom queue import Queue\n\ntf.enable_eager_execution()\n\nparser = argparse.ArgumentParser(description='Run A3C algorithm on gym env.')\nparser.add_argument('--algo...
[ [ "tensorflow.convert_to_tensor", "numpy.array", "tensorflow.train.AdamOptimizer", "tensorflow.GradientTape", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.enable_eager_execution", "numpy.argmax", "tensorflow.nn.softmax", "numpy.random.random", "tensorflow...
christopherhesse/atari-reset
[ "0c1b1124d5348ae11ee61442d387e455b05f9fc2" ]
[ "test_atari.py" ]
[ "#!/usr/bin/env python\nimport argparse\nimport os\nimport gym\n\ndef test(game_name, num_timesteps, policy, load_path, save_path, noops=False, sticky=False, epsgreedy=False):\n import tensorflow as tf\n import horovod.tensorflow as hvd\n hvd.init()\n print('initialized worker %d' % hvd.rank(), flush=Tr...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
BUTSpeechFIT/MT_Transformer
[ "86e71f93b06ceb937c71171ee781377e2929b0ea" ]
[ "MT_Training.py" ]
[ "#!/usr/bin/python\nimport sys\nimport os\nimport subprocess\nfrom os.path import join, isdir\nimport numpy as np\nimport fileinput\nimport json\nimport random\nfrom itertools import chain\nfrom numpy.random import permutation\n##------------------------------------------------------------------\nimport torch\nfrom...
[ [ "matplotlib.pyplot.switch_backend", "numpy.zeros", "matplotlib.pyplot.viridis", "numpy.argmin", "numpy.abs" ] ]
ChenyangWang1/face_parsing
[ "506e74eb8a2094920c03f2fe0774656b1043e8a6" ]
[ "test.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\nfrom logger import setup_logger\nfrom model import BiSeNet\nfrom tqdm.autonotebook import tqdm\nimport torch\nimport os\nfrom utils.utils import *\nfrom torch.utils.data import DataLoader\nfrom face_dataset_test import FaceMask\nimport os.path as osp\nimport numpy as...
[ [ "numpy.max", "numpy.array", "numpy.reshape", "numpy.zeros", "torch.no_grad", "torch.unsqueeze", "numpy.where", "torch.squeeze", "numpy.transpose", "torch.utils.data.DataLoader", "torch.load", "numpy.diag", "numpy.maximum" ] ]
HMS-IDAC/PythonPixelClassifier
[ "f8673239a6ee08dbe6968aedea3f632030faf933" ]
[ "imtools.py" ]
[ "import matplotlib.pyplot as plt\nimport tifffile\nimport os\nimport numpy as np\nfrom skimage.io import *\nfrom skimage.filters import gabor_kernel, gabor\nfrom skimage.transform import EuclideanTransform, warp\nfrom scipy.ndimage import *\n\ndef tifread(path):\n return tifffile.imread(path)\n\ndef tifwrite(I,p...
[ [ "numpy.max", "matplotlib.pyplot.subplot", "numpy.sin", "numpy.zeros", "numpy.min", "numpy.mean", "numpy.multiply", "numpy.std", "numpy.arange", "numpy.sqrt", "numpy.maximum", "numpy.cos", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.py...
madsankern/DynamicProgramming
[ "0812b844068c33b2529d4b11940f9c89582bc374" ]
[ "Archive/Mads_Wind/vfi.py" ]
[ "import numpy as np\nimport tools\nimport utility as util\nimport scipy.optimize as optimize\nimport matplotlib.pyplot as plt\n\n##############################\n## Value function iteration ##\n##############################\n# This is the VFI algortihm for solving the simple consumption saving model.\n\ndef solve(s...
[ [ "numpy.sum", "numpy.size", "numpy.zeros", "scipy.optimize.minimize_scalar" ] ]
eng-tools/sfsimodels
[ "4771f7693c7ed30c05e82e41401c7d141e02dcf9" ]
[ "sfsimodels/scores.py" ]
[ "import numpy as np\n\n\ndef lc_score(value):\n \"\"\"\n Evaluates the accuracy of a predictive measure (e.g. r-squared)\n\n :param value: float, between 0.0 and 1.0.\n :return:\n \"\"\"\n rebased = 2 * (value - 0.5)\n\n if rebased == 0:\n return 0\n elif rebased > 0:\n complim...
[ [ "numpy.log2" ] ]
Zhangchangh/oneflow
[ "4ea3935458cc83dcea0abd88dd613f09c57dc01a" ]
[ "python/oneflow/test/modules/test_flip.py" ]
[ "\"\"\"\nCopyright 2020 The OneFlow 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 http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap...
[ [ "numpy.ones_like", "numpy.arange" ] ]
markcx/DER_ControlPrivateTimeSeries
[ "16f9ea14dc5146005c1c88e9b880c10c9b1a3361" ]
[ "CaseStudy_Synthetic/nets.py" ]
[ "# ============================= #\n# @auther markcx'At'stanford.edu\n# ============================= #\n\nimport torch\nfrom torch import nn\nimport math\n\nimport sys\nsys.path.append(\"..\")\n\ntry:\n import OptMiniModule.util as ut\n import OptMiniModule.cvx_runpass as OptMini_cvx\nexcept:\n raise File...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.norm", "torch.nn.Parameter", "torch.ones", "torch.from_numpy", "torch.tensor", "torch.Tensor", "torch.nn.ELU" ] ]
shym98/DNA_circuits
[ "6882adece5b2b70317d47e2495d91890606c6982" ]
[ "testDNA/main.py" ]
[ "import networkx as nx\nimport matplotlib.pyplot as plt\nimport sys\nfrom testDNA.DNA import generate_output\n\ninput_logic = \"\"\nerrors = False\nvariables = []\n\n\ndef check_parenthesis(expr):\n stack = []\n global errors\n for i in range(len(expr)):\n if expr[i] == '(':\n stack.appen...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show" ] ]
paulasquin/pixray
[ "9ada7b82c0cb2dd634d5e933a1ac4c5980e8cb1d" ]
[ "pixray/vectorize.py" ]
[ "import argparse\nimport sys\nimport json\nimport numpy as np\nfrom sklearn import metrics\nfrom sklearn import svm\nimport os\nfrom tqdm import tqdm\nfrom util import real_glob\n\nimport torch\nfrom clip import clip\nfrom torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize\nfrom PIL impo...
[ [ "numpy.array", "numpy.linalg.norm", "torch.no_grad", "numpy.mean", "torch.cuda.is_available", "numpy.stack", "sklearn.svm.LinearSVC" ] ]
ADockhorn/Forward-Model-Learning-for-Motion-Control-Tasks
[ "46f4fb4bf2c1c8236bea0fa471a1f23381a7a08a" ]
[ "forwardmodellearning/plot_results.py" ]
[ "import matplotlib.pyplot as plt\nimport seaborn as sns\nimport pickle\nimport os\nimport numpy as np\n\n\ndef store_data_into_csv():\n \"\"\" Store training results into CSV files to calculate a smoothed loess with R before plotting.\n \"\"\"\n for ENV_NAME in ['CartPole-v1', 'Pendulum-v0', 'Acrobot-v1', ...
[ [ "numpy.array", "numpy.savetxt", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.genfromtxt", "numpy.mean", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
CanItRun/CoMatch
[ "748645d531787502340977e75b48049b629f9e97" ]
[ "Train_CoMatch_a.py" ]
[ "'''\n * Copyright (c) 2018, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause\n'''\nfrom __future__ import print_function\nimport random\n\nimport time\nimport argp...
[ [ "torch.zeros", "torch.cat", "torch.stack", "torch.max", "numpy.random.seed", "torch.no_grad", "torch.optim.SGD", "torch.split", "torch.softmax", "torch.mm", "torch.manual_seed", "torch.cuda.set_device", "torch.nn.functional.log_softmax", "torch.load", "t...
mesoscope/cellpack
[ "ec6b736fc706c1fae16392befa814b5337a3a692" ]
[ "cellpack/mgl_tools/DejaVu/scenarioInterface/Tests/test_view.py" ]
[ "from DejaVu import Viewer\nfrom DejaVu.Spheres import Spheres\nimport numpy\n\n\ndef test_views001():\n \"\"\"\n Test that:\n we can create a view,\n add it to a director,\n move the scene toa new place,\n save the new place as a second view\n use the director to go back to the...
[ [ "numpy.sum", "numpy.array" ] ]
pepCV/PyFstat
[ "b30919962e9730e24d514e9e9fe89289a002d428" ]
[ "pyfstat/core.py" ]
[ "\"\"\" The core tools used in pyfstat \"\"\"\n\n\nimport os\nimport logging\nimport copy\n\nimport glob\nimport numpy as np\nimport scipy.special\nimport scipy.optimize\n\nimport lal\nimport lalpulsar\nimport pyfstat.helper_functions as helper_functions\nimport pyfstat.tcw_fstat_map_funcs as tcw\n\n# workaround fo...
[ [ "matplotlib.use", "numpy.max", "numpy.array", "numpy.dot", "numpy.isnan", "numpy.zeros", "numpy.float", "numpy.min", "matplotlib.pyplot.subplots", "numpy.exp", "numpy.argmax", "numpy.atleast_1d", "numpy.isfinite", "matplotlib.pyplot.tight_layout", "numpy...
AnimeshKoratana/blurryface
[ "c6cb5feec02f6d5af3acb1678336800390715d65" ]
[ "facenet_pytorch/models/inception_resnet_v1.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nimport requests\nfrom requests.adapters import HTTPAdapter\nimport os\n\n\nclass BasicConv2d(nn.Module):\n\n def __init__(self, in_planes, out_planes, kernel_size, stride, padding=0):\n super().__init__()\n self.conv = nn.Co...
[ [ "torch.nn.Linear", "torch.nn.functional.normalize", "torch.cat", "torch.nn.Softmax", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.load", "torch.nn.AdaptiveAvgPool2d" ] ]
astatt/azplugins
[ "cc3b613ff5a79e166149b5454bff2d765019bde5" ]
[ "azplugins/test-py/test_evaporate_particles.py" ]
[ "# Copyright (c) 2018-2020, Michael P. Howard\n# Copyright (c) 2021-2022, Auburn University\n# This file is part of the azplugins project, released under the Modified BSD License.\n\nimport hoomd\nfrom hoomd import md\nhoomd.context.initialize()\ntry:\n from hoomd import azplugins\nexcept ImportError:\n impor...
[ [ "numpy.testing.assert_array_equal", "numpy.ones", "numpy.zeros" ] ]
Cai-Lab-at-University-of-Michigan/MiCV
[ "8d18a1f177d16a5b09f54c211a0c2b1238d6ce01" ]
[ "src/tasks/tasks.py" ]
[ "from sendgrid import SendGridAPIClient\nfrom sendgrid.helpers.mail import Mail\n\nimport zarr\nfrom numcodecs import Blosc\nimport scipy.sparse as sp\n\nfrom .celery import task_queue\nfrom layouts import demo\nif (demo == False):\n try:\n from configmodule.production_config import ProductionConfig as Fl...
[ [ "scipy.sparse.issparse", "scipy.sparse.csr_matrix" ] ]
openneuropet/PET2BIDS
[ "bf88910059f0cc986c3fcb266e1c23c8c37c4eaf" ]
[ "pypet2bids/tests/test_helper_functions.py" ]
[ "import collections\nimport tempfile\nimport unittest\nimport pypet2bids.helper_functions as helper_functions\nfrom os import remove\nimport pandas\nfrom pathlib import Path\nfrom os.path import join\n\n# collect config files\n# fields to check for\nmodule_folder = Path(__file__).parent.resolve()\npython_folder = m...
[ [ "pandas.testing.assert_frame_equal", "pandas.read_excel" ] ]
renardeinside/scout
[ "107a45410e501399a315bedf69482bf5b4812612" ]
[ "scout/nuclei.py" ]
[ "\"\"\"\nNuclei Module\n==============\n\nThis module performs nuclei detection, segmentation, and cytometry.\n\nThese include the following subcommands:\n\n - detect : detect all nuclei in image\n - segment : segment all detected nuclei\n - fluorescence : measure fluorescence for each cell\n - gate : a...
[ [ "matplotlib.pyplot.xlim", "numpy.load", "numpy.where", "pandas.DataFrame", "numpy.save", "numpy.savez_compressed", "matplotlib.colors.PowerNorm", "matplotlib.use", "numpy.array", "numpy.pad", "numpy.zeros", "numpy.clip", "matplotlib.pyplot.show", "numpy.asar...
robertsawko/proteus
[ "6f1e4c2ca1af85a906b35a5162430006f0343861" ]
[ "proteus/tests/POD/deim_utils.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nutility module for generating deim interpolants\n\"\"\"\nimport numpy as np\n\ndef read_from_hdf5(hdfFile,label,dof_map=None):\n \"\"\"\n Just grab the array stored in the node with label label and return it\n If dof_map is not none, use this to map values in the array\n ...
[ [ "numpy.append", "numpy.array", "numpy.dot", "numpy.savetxt", "numpy.reshape", "numpy.zeros", "numpy.absolute", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "numpy.arange", "numpy.linalg.svd", "matplotlib.pyplot.ylabel", ...
zealoussnow/chromium
[ "fd8a8914ca0183f0add65ae55f04e287543c7d4a", "fd8a8914ca0183f0add65ae55f04e287543c7d4a", "fd8a8914ca0183f0add65ae55f04e287543c7d4a" ]
[ "third_party/tensorflow-text/src/tensorflow_text/python/ops/item_selector_ops.py", "third_party/tensorflow-text/src/tensorflow_text/python/ops/masking_ops.py", "third_party/tensorflow-text/src/tensorflow_text/python/keras/layers/todense_test.py" ]
[ "# coding=utf-8\n# Copyright 2021 TF.Text 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 appl...
[ [ "tensorflow.python.ops.math_ops.minimum", "tensorflow.python.ops.math_ops.reduce_sum", "tensorflow.python.ops.array_ops.unstack", "tensorflow.python.ops.array_ops.ones_like", "tensorflow.python.ops.array_ops.expand_dims", "tensorflow.python.ops.math_ops.reduce_all", "tensorflow.python....
nmearl/spectacle
[ "ae2d11a41dfae5430de392d54b06bf991003fd69" ]
[ "spectacle/utils/detection.py" ]
[ "import logging\n\nimport astropy.units as u\nimport numpy as np\nfrom astropy.convolution import convolve\n\nfrom spectacle.utils.misc import find_nearest\nfrom collections import OrderedDict\n\n__all__ = ['region_bounds']\n\n\ndef _make_data_diffs(y):\n kernel = [1, 0, -1]\n\n dY = convolve(y, kernel, 'exte...
[ [ "numpy.max", "numpy.array", "numpy.sign", "numpy.where", "numpy.ma.array", "numpy.abs" ] ]
GenyaNobuhara/VRP_DRL_MHA
[ "44a0f70e927c715db478e9e1875fd0c7023a2644" ]
[ "PyTorch/decoder.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom layers import MultiHeadAttention, DotProductAttention\nfrom data import generate_data\nfrom decoder_utils import TopKSampler, CategoricalSampler, Env\n\nclass DecoderCell(nn.Module):\n\tdef __init__(self, embed_dim = 128, n_heads = 8, clip = 10., **kwargs):\n\t\tsuper()....
[ [ "torch.nn.Linear", "torch.rand", "torch.stack", "torch.log_softmax", "torch.cuda.is_available", "torch.tensor" ] ]
mathislucka/toxic-comment-collection
[ "70bdf35735c3b67a6ef09ce25e67e74d497279cf" ]
[ "src/toxic_comment_collection/datasets/wulczyn2017toxic.py" ]
[ "from . import dataset\nfrom . import helpers\nimport os\nimport pandas as pd\n\n\nclass Wulczyn2017toxic(dataset.Dataset):\n \n name = \"wulczyn2017toxic\"\n url = \"https://ndownloader.figshare.com/articles/4563973/versions/2\"\n hash = \"9e48068af1fbbe893af4df1b629ceebf924dc723a290c7bc473d2a8a8aac352...
[ [ "pandas.read_csv" ] ]
maria-kuruvilla/temp_collective_code
[ "11367dd6d70d924af0d1ea765fb95734b00253bb" ]
[ "trajectories_in_tank.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 14 2020\n\n@author: Maria Kuruvilla\n\nGoal - Code to visualise trajectoies in the tank to know the dimensions of the tank\n\"\"\"\n\n\nimport sys, os\nimport pathlib\nfrom pprint import pprint\n\nimport numpy as np\nfrom scipy import stats\nfrom scipy.spatial im...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
asappresearch/interactive-classification
[ "58af3c9e95f2f3c14928bbb08534820e97ffc453" ]
[ "bdmodule/bd_simulator.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nfrom abc import ABC, abstractmethod\nimport pandas as pd\nimport json\nimport bdmodule.bd_utils as bd_utils\n#from module.data_loading_fromlocal import read_turkprob\n\n\nclass UserSimulator(ABC):\n @abstractmethod\n def answer(self ):\n pass\n\...
[ [ "numpy.random.binomial" ] ]
harry418/mask-detection
[ "a1aca03c50329c60250ad70e0992398feb9a4ed5" ]
[ "mask_detection_train.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"mask_detection.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1f4A35qAws13i5qKx86UPqL56rhzBPAOY\n\"\"\"\n\n# import the necessary packages\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom ke...
[ [ "numpy.array", "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.argmax", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show", ...
bknaepen/scipy
[ "c5db5e291624c4d5ef4960ed7da3d4a413d8bcb1" ]
[ "scipy/linalg/basic.py" ]
[ "#\n# Author: Pearu Peterson, March 2002\n#\n# w/ additions by Travis Oliphant, March 2002\n# and Jake Vanderplas, August 2012\n\nfrom warnings import warn\nimport numpy as np\nfrom numpy import atleast_1d, atleast_2d\nfrom .flinalg import get_flinalg_funcs\nfrom .lapack import get_lapack_funcs, _compu...
[ [ "numpy.ones_like", "numpy.dot", "numpy.rollaxis", "numpy.finfo", "numpy.iscomplexobj", "numpy.conjugate", "numpy.concatenate", "numpy.max", "numpy.linalg.norm", "numpy.empty", "numpy.common_type", "numpy.arange", "numpy.empty_like", "numpy.equal", "numpy...
Taoudi/DataAugmentation
[ "84691bee5b203e06356838fa8e0ac8d3830538be" ]
[ "src/DataLoader.py" ]
[ "# Summarize the Credit Card Fraud dataset\nimport numpy as np \nfrom pandas import read_csv\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\n\nclass DataLoader:\n\tdef __init__(self, datafile='creditcard.csv'):\n\t\tscaler = StandardScaler()\n\n\t\t#Convert t...
[ [ "numpy.max", "sklearn.preprocessing.StandardScaler", "numpy.min", "numpy.mean", "numpy.std", "numpy.unique", "sklearn.model_selection.train_test_split", "pandas.read_csv", "numpy.var" ] ]
eyeshoe/mhcflurry
[ "b87aac3cf1a782cb1235f9b724388bbdd933d9fb" ]
[ "test/test_speed.py" ]
[ "\"\"\"\nProfile prediction speed\n\n\"\"\"\nimport numpy\nnumpy.random.seed(0)\nimport time\nimport cProfile\nimport pstats\nimport collections\nimport argparse\nimport sys\n\nimport pandas\n\nfrom mhcflurry import Class1AffinityPredictor\nfrom mhcflurry.encodable_sequences import EncodableSequences\nfrom mhcflurr...
[ [ "numpy.random.seed", "pandas.Series" ] ]