repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Guli-Y/wimlds_emissions
[ "51c610867666f91446fbe228660c865cf5869e99" ]
[ "emissions/utils.py" ]
[ "from sklearn.model_selection import learning_curve\nfrom sklearn.model_selection import ShuffleSplit\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import accuracy_score, recall_score, precision_score\nfrom emissions.data import load_data, clean_data\n\n\ndef scorin...
[ [ "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylim", "numpy.mean", "sklearn.metrics.accuracy_score", "numpy.linspace", "numpy.std", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.ylabel", ...
taiducvu/VNG-NSFW-DETECTION
[ "f49b6ad21ed9c8646c402a37015a80258fb79a68" ]
[ "train_model.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport tensorflow as tf\nimport data as dt\nimport vng_model as md\nimport time\nimport csv\nimport math\n\nFLAGS = tf.app.flags.FLAGS\n\ntf.app.flags.DEFINE_string('train_dir', '/home/taivu...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.group", "tensorflow.train.get_checkpoint_state", "tensorflow.gradients", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.train.GradientDescentOptimizer", "tensorflow.Variable", "tensorflow.squeeze", ...
mevangelista-alvarado/NumericalPoissonGrometry-
[ "76f41be4eb11248c3206b5e371c7aa9eb9d73b44" ]
[ "test/num_curl_operator.py" ]
[ "import datetime\nimport time\nimport numpy as np\nimport statistics as stat\nfrom numpoisson.numpoisson import NumPoissonGeometry\n\nprint('Start')\nnpg = NumPoissonGeometry(4, 'x')\nP ={(1, 3): '2*x4', (1, 4): '2*x3', (2, 3): '-2*x4', (2, 4): '2*x3', (3, 4): 'x1 - x2'}\n\nnum_curl_operator_res = dict()\nj = 2\nfo...
[ [ "numpy.load" ] ]
pavolmarak/level1_extractor
[ "55cb4b0d32a9740a963a069c732548363dc010fe" ]
[ "neuronova_siet/convolutionalNetwork_ResNet50_4class.py" ]
[ "import tensorflow as tf\r\nfrom tensorflow import keras\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom PIL import Image\r\nimport glob\r\nfrom sklearn.metrics import confusion_matrix\r\nfrom sklearn.metrics import plot_confusion_matrix\r\n\r\n\r\nclasses = {'Arch': 0, 'Left Loop': 1, 'Right Loop'...
[ [ "numpy.concatenate", "sklearn.metrics.confusion_matrix", "tensorflow.keras.applications.ResNet50", "numpy.mean", "tensorflow.keras.layers.Dense", "numpy.std", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "numpy.argmax", "numpy.expand_dims", "tensorflow.keras.cal...
thutran/bspline
[ "7e3cf5e6652fd51e5ca8ea13537e649c629fc567" ]
[ "bspline/bspline.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Python/Numpy implementation of Bspline basis functions via Cox - de Boor algorithm.\"\"\"\n\nfrom __future__ import division, print_function, absolute_import\n\nfrom functools import partial\nimport numpy as np\n\nclass memoize(object):\n \"\"\"Cache the return value of a method.\...
[ [ "numpy.max", "numpy.empty", "numpy.errstate", "numpy.zeros", "matplotlib.pyplot.plot", "numpy.min", "numpy.where", "numpy.atleast_1d", "numpy.all", "matplotlib.pyplot.show", "numpy.linspace", "numpy.squeeze" ] ]
maxxxzdn/en_flows
[ "04ed4dd45431cafcd23f8bf5199a47f917a72058" ]
[ "qm9/visualizer.py" ]
[ "import torch\nimport numpy as np\nimport os\nimport glob\nimport random\nimport matplotlib\nimport imageio\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nfrom qm9 import analyze\n##############\n### Files ####\n###########-->\n\n\nbond1_radius = {'H': 31, 'C': 76, 'N': 71, 'O': 66, 'F': 57} # covalnt bon...
[ [ "matplotlib.use", "torch.zeros", "numpy.array", "numpy.sin", "numpy.clip", "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.flipud", "numpy.arange", "numpy.cos", "numpy.size", "matplotlib.pyplot.show", ...
susloparovdenis/dlcourse_ai
[ "0be8278161f85822e71be370296586509428d9d2" ]
[ "assignments/assignment1/knn.py" ]
[ "import numpy as np\nfrom collections import Counter\n\nclass KNN:\n \"\"\"\n K-neariest-neighbor classifier using L1 loss\n \"\"\"\n def __init__(self, k=1):\n self.k = k\n\n def fit(self, X, y):\n self.train_X = X\n self.train_y = y\n\n\n def predict(self, X, num_loops=0):\n...
[ [ "numpy.abs", "numpy.argsort", "numpy.zeros" ] ]
matklad/xain
[ "20c6881cabdf1e3ed7a9ddb40bbdcc7a7fd22f78" ]
[ "xain/generator/transformer.py" ]
[ "from typing import Callable, Tuple\n\nimport numpy as np\nfrom numpy import ndarray\n\nfrom .class_per_partition_distribution import distribution as cpp_distribution\n\n# Passed to RandomState for predictable shuffling\nSEED = 851746\n\n\ndef transfomer_decorator(func: Callable):\n \"\"\"The decorator will vali...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.random.RandomState", "numpy.split", "numpy.nonzero", "numpy.argsort", "numpy.unique" ] ]
gwillmer/openpilot
[ "1d45781c973a716c914f5d62a00fd9217e12d3b5" ]
[ "selfdrive/controls/lib/longitudinal_planner.py" ]
[ "#!/usr/bin/env python3\nimport math\nimport numpy as np\nfrom common.numpy_fast import interp\nfrom common.cached_params import CachedParams\n\nimport cereal.messaging as messaging\nfrom cereal import log\nfrom common.realtime import DT_MDL\nfrom common.realtime import sec_since_boot\nfrom selfdrive.modeld.constan...
[ [ "numpy.zeros", "numpy.min", "numpy.exp", "numpy.sqrt", "numpy.clip" ] ]
scrambleegg7/ssd_prescription
[ "37932d16d5b7a7741fcdf6afff5be0804ef958a8" ]
[ "m1124test.py" ]
[ "import cv2\nfrom cv2 import imshow\n\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nimport pickle\n\nif __name__ == '__main__':\n print('Hello World')\n \n # Connect to video Source\n cam = cv2.VideoCapture()\n #\n #\n #\n # AXIS M1124 Video streaming\n cam.open(\"http://192.168...
[ [ "numpy.zeros" ] ]
wh629/CNLI-generalization
[ "5c6d4df5f6a7e58d23c6db1a9dbc50eb9bcfda2b" ]
[ "jiant/jiant/tasks/lib/scitail.py" ]
[ "import numpy as np\nimport pandas as pd\nimport torch\nfrom dataclasses import dataclass\nfrom typing import List\n\nfrom jiant.tasks.core import (\n BaseExample,\n BaseTokenizedExample,\n BaseDataRow,\n BatchMixin,\n Task,\n TaskTypes,\n)\nfrom jiant.tasks.lib.templates.shared import labels_to_b...
[ [ "pandas.read_csv" ] ]
glenn-jocher/torchflare
[ "3c55b5a0761f2e85dd6da95767c6ec03f0f5baad" ]
[ "torchflare/modules/arcface.py" ]
[ "\"\"\"Implements ArcFace.\"\"\"\nimport math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass ArcFace(nn.Module):\n \"\"\"Implementation of ArcFace.\n\n ArcFace: : [Additive Angular Margin Loss for Deep Face Recognition](https://arxiv.org/abs/1801.07698)\n \"\"\"\n\n d...
[ [ "torch.cos", "torch.nn.functional.normalize", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.clamp", "torch.zeros_like" ] ]
jacklee-scau/ssd.pytorch-master
[ "ff2953bc773fb917dd6ab70ffccc2aa0cbe60e0e" ]
[ "train.py" ]
[ "from data import *\nfrom utils.augmentations import SSDAugmentation\nfrom layers.modules import MultiBoxLoss\nfrom ssd import build_ssd\nimport os\nimport sys\nimport time\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\ni...
[ [ "torch.zeros", "torch.nn.init.xavier_uniform", "torch.autograd.Variable", "torch.set_default_tensor_type", "torch.ones", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "torch.Tensor", "torch.nn.DataParallel" ] ]
chr0n1x/pymldb
[ "c86e8191d4d36aad22500fa4298b23580aac6e6f" ]
[ "pymldb/data.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) 2015 Datacratic Inc. All rights reserved.\n# @Author: Alexis Tremblay\n# @Email: atremblay@datacratic.com\n# @Date: 2015-01-07 15:45:01\n# @Last Modified by: Alexis Tremblay\n# @Last Modified time: 2015-06-02 08:32:09\n# @File Name: data.py\n\n\nimport pandas ...
[ [ "numpy.array", "pandas.DataFrame.from_records", "pandas.Series", "pandas.DataFrame" ] ]
lisaplag/pints
[ "3de6617e57ba5b395edaca48961bfc5a4b7209b3" ]
[ "pints/toy/_constant_model.py" ]
[ "#\n# Constant model with multiple outputs.\n#\n# This file is part of PINTS (https://github.com/pints-team/pints/) which is\n# released under the BSD 3-clause license. See accompanying LICENSE.md for\n# copyright notice and full license details.\n#\nfrom __future__ import absolute_import, division\nfrom __future__...
[ [ "numpy.asarray", "numpy.ones", "numpy.any", "numpy.arange", "numpy.isfinite" ] ]
dgarrett622/raven
[ "f36cc108f7500b0e2717df4832b69b801b43960d" ]
[ "ravenframework/SupervisedLearning/SupervisedLearning.py" ]
[ "# Copyright 2017 Battelle Energy Alliance, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ...
[ [ "numpy.array", "numpy.stack", "numpy.asarray" ] ]
silverneko/scikit-image
[ "1f8c74f69e0f9e72c59f180b2fc96d311659c609" ]
[ "skimage/draw/draw.py" ]
[ "# coding: utf-8\nimport numpy as np\n\nfrom .._shared._geometry import polygon_clip\nfrom ._draw import (_coords_inside_image, _line, _line_aa,\n _polygon, _ellipse_perimeter,\n _circle_perimeter, _circle_perimeter_aa,\n _bezier_curve)\n\n\ndef _ellipse_in_s...
[ [ "numpy.max", "numpy.sin", "numpy.array", "numpy.ceil", "numpy.asarray", "numpy.ones_like", "numpy.round", "numpy.min", "numpy.nonzero", "numpy.isscalar", "numpy.cos", "numpy.floor" ] ]
changjianhui/SPM
[ "4547db9559feedb0d168442862616de427c82094" ]
[ "models/networks/generator.py" ]
[ "\"\"\"\nCopyright (C) 2019 NVIDIA Corporation. All rights reserved.\nLicensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).\n\"\"\"\nimport os\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.nn.utils import spectral_norm\nfro...
[ [ "torch.nn.functional.interpolate", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.nn.functional.tanh", "torch.nn.functional.leaky_relu" ] ]
btaba/text-image-embedding
[ "a5f16e1f89649eb7bc380b60c599d56eb3f91ae1" ]
[ "src/tests/test_encoding.py" ]
[ "import sys\nimport os\nimport numpy as np\n\nsys.path.insert(0, os.getcwd())\n\n\nfrom utils.encoding import tokenize, TokenizeTransformer\nfrom utils.encoding import AverageWordTokenTransformer\n\n\ndef test_tokenize():\n assert tokenize('hey bro you', {'you'}) == ['hey', 'bro']\n\n\ndef test_tokenize_transfor...
[ [ "numpy.array" ] ]
MTDzi/real-estate-pipeline-and-model
[ "cd3754f1aa71a69bf6c8a7b599cc11e16a8bd0e2" ]
[ "plugins/quality_checks.py" ]
[ "from pathlib import Path\nimport pandas as pd\nimport logging\n\n\ndef check_if_file_exists(filepath: str, additional_message: str = '') -> None:\n if not Path(filepath).exists():\n raise ValueError(f'The file\\n\\t\"{filepath}\"\\ndoes not exist\\n{additional_message}')\n\n\ndef check_nullability(\n ...
[ [ "pandas.read_parquet" ] ]
Rushi21-kesh/Analyzing-real-time-data-with-spark-streaming-and-kafka
[ "ad730ba74a2972c1e713d78c79ebcfedea1e0391" ]
[ "code/output.py" ]
[ "import json\nimport matplotlib.pyplot as plt\nfrom matplotlib.animation import FuncAnimation\nfrom kafka import KafkaConsumer\nimport time\nimport threading\nplt_val_x=[]\nplt_val_temp=[]\nplt_val_apptemp=[]\nplt_val_pres=[]\nplt_val_rh=[]\ncity_name='Chennai'\n\ndef animate(i):\n global plt_val_x, plt_val_temp...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.gcf", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.style.use", "matplotlib.pyplot.show" ] ]
cah-cesar-medrano/pyTorch-Example-Classifier
[ "008868cab339b89dd68bf469fdb12f846435749a" ]
[ "Classifier/image_show.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\n# Lets show some of the training images for fun\n\n# functions to show an image\n\n\ndef imshow(img):\n img = img / 2 + 0.5 # Unnormalize\n npimg = img.numpy()\n plt.imshow(np.transpose(npimg, (1, 2, 0)))\n plt.show()\n\n\ndef peek(trainloader, to...
[ [ "matplotlib.pyplot.show", "numpy.transpose" ] ]
ds-praveenkumar/ds-project-template
[ "2f55ca99d4c238ce947d594c2bce883676ff4e49" ]
[ "src/prepare/csv_loader.py" ]
[ "#\n# Created on Thu Nov 05 2020 1:29:10 AM\n#\n# author: Praveen Kumar\n#\n# github url: https://github.com/ds-praveenkumar/\n#\n# filename: csv_loader.py\n#\n\n\"\"\"\nLoads the csv data from data/raw dir\n\"\"\"\nimport pandas as pd\nimport sys\nsys.path.append(\".\")\nfrom config import config\n\n\nclass CSVLoa...
[ [ "pandas.read_csv" ] ]
ubolonton/tensorflow-serving
[ "e0610365dc59c548f9a9eedc59f89b41303bb193" ]
[ "tensorflow_serving/example/inception_export.py" ]
[ "# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.image.central_crop", "tensorflow.image.resize_bilinear", "tensorflow.train.get_checkpoint_state", "tensorflow.mul", "tensorflow.initialize_all_tables", "tensorflow.image.decode_jpeg", "tensorflow.FixedLenFeature", "tensorflow.train.Saver", "tensorflow.constant", ...
dynamicwebpaige/estimator
[ "ef33bb79ea0831527bea80c572d2ee9cc1fe6065" ]
[ "tensorflow_estimator/python/estimator/canned/kmeans.py" ]
[ "# Copyright 2016 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.util.tf_export.estimator_export", "tensorflow.python.feature_column.feature_column_lib.input_layer", "tensorflow.python.summary.summary.scalar", "tensorflow.python.ops.metrics.mean", "tensorflow.python.platform.tf_logging.info", "tensorflow.python.framework.ops.colocate_...
WorksWellWithOthers/dqn_zoo
[ "f011d683529d8d23b017a95194ebbb41a4962fe8" ]
[ "dqn_zoo/parts.py" ]
[ "# Copyright 2019 DeepMind Technologies Limited. 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# Unle...
[ [ "numpy.array" ] ]
mm5110/sparse-structures-for-classification
[ "ac4d765754f92f22afeb1ed0473e6d8332aa8f73" ]
[ "joint/dev/Old/dev_old/Jere/MM_MNIST_ML_ISTA/Models_MNIST.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.utils.data as Data\nimport torch.nn.functional as F\nimport torchvision\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nimport numpy as np\n\n\n##################################################\n\n#### M...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "numpy.empty", "torch.stack", "torch.nn.functional.conv_transpose2d", "torch.nn.functional.log_softmax", "torch.nn.functional.relu", "torch.from_numpy", "torch.squeeze", "torch.t", "numpy.sqrt", "torch.diag", "t...
baruchel/apl
[ "238247a24106c80aa57ad8aa797afca71550425f" ]
[ "apl/__init__.py" ]
[ "\"\"\"\nAn implementation of the APL programming language.\n\"\"\"\n\n__version__ = '0.1'\n\nimport numpy as np\n\nfrom .internal import (\n _apl, AplArray,\n # Exceptions:\n DomainError, RankError, InvalidAxisError\n )\n\nfrom .core import (\n index, rho\n )\n\nfr...
[ [ "numpy.array" ] ]
DTRademaker/DL_tutorials_2020
[ "aaae2833c084547e027e51ebeb0abf6bcd336897" ]
[ "20200513_cnn_week5/hw/FM/HW5_Farzaneh.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 19 02:44:54 2020\n\n@author: farzanehmeimandi\n\"\"\"\n\n# Problem 1\n# As we are using Max-pooling, it does not differ in the order of Max-pooling and the activation function\n\n# Problem 2\n# 2d & 1d (in the following code) - It seems to...
[ [ "torch.rand", "torch.nn.Softmax", "torch.nn.Conv1d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.eye", "torch.nn.functional.binary_cross_entropy" ] ]
giangnguyen2412/dissect_catastrophic_forgetting
[ "b0dea59e9cf6521c7b43b2ab53b6c3258902d6ae" ]
[ "train.py" ]
[ "import torch.nn as nn\nfrom data_loader import get_loader\nfrom model import EncoderCNN, DecoderRNN\nfrom torch.nn.utils.rnn import pack_padded_sequence\nfrom torchvision import transforms\nfrom utils import *\nfrom prepro.build_vocab import *\nfrom prepro.pick_image import make_dir\nfrom infer import infer_captio...
[ [ "torch.nn.Linear", "torch.nn.MSELoss", "torch.nn.CrossEntropyLoss", "torch.nn.utils.rnn.pack_padded_sequence", "numpy.average", "torch.nn.Embedding" ] ]
KKVANONYMOUS/Rubiks-Cube
[ "df15104fcd6b9da536e2879a6bba8778edbfc0a8" ]
[ "CubeInput.py" ]
[ "import cv2\nimport numpy as np \n\ndef face_color(image):\n\thsv=cv2.cvtColor(crop,cv2.COLOR_BGR2HSV)\n\n\tlower_red = np.array([0,70,50])\n\tupper_red = np.array([10,255,255])\n\tlowerred = np.array([170,20,50])\n\tupperred = np.array([180,255,255])\n\n\n\tmask1 = cv2.inRange(hsv, lower_red,upper_red)\n\tmask2 = ...
[ [ "numpy.array", "numpy.ones", "numpy.zeros" ] ]
lwneal/starcraft-rl
[ "fb60b28d8b635e0666fe20276b87ece60ccaa291" ]
[ "sc2env/environments/fog_of_war.py" ]
[ "import time\nimport os\nimport random\nimport numpy as np\nimport imutil\n\nfrom pysc2.env import sc2_env\nfrom pysc2.lib import actions\n\nfrom sc2env.pysc2_util import register_map\n\n\n# These parameters are adjustable without changing the .SC2Map\nMAP_NAME = 'FogOfWar'\nMAP_SIZE = 64\nRGB_SCREEN_WIDTH = 400\nR...
[ [ "numpy.array" ] ]
Fassty/best
[ "3bb1be1cdf021596ea64107063789c940fdde9b3" ]
[ "best/model.py" ]
[ "import pymc3 as pm\nimport numpy as np\n\nimport logging\nlogger = logging.getLogger('pymc3')\nlogger.setLevel(logging.ERROR)\n\n\nclass Model:\n PRECISION_SCALING = 1e-6\n SIGMA_SCALING = 1e3\n NORMALITY_THRESHOLD = 29 # since 30 the distribution is considered normal\n\n def __init__(self, model: pm....
[ [ "numpy.std", "numpy.power", "numpy.mean" ] ]
Yasushi-Shinohara/GPR_Note
[ "cfb909f659b62fed81e4e5dd904ec8233034dfc9" ]
[ "common/functions.py" ]
[ "import numpy as np\nfrom scipy.stats import norm\n\ndef PF(_xsample, _ysample, _x, _deg, normalization = True):\n if (normalization):\n xmin = np.amin(_x)\n xmax = np.amax(_x)\n xmid = 0.5*(xmin + xmax)\n _x = (_x - xmid)/(xmax - xmin)\n _xsample = (_xsample - xmid)/(xmax - xm...
[ [ "numpy.amin", "numpy.amax", "numpy.polyfit", "numpy.poly1d" ] ]
ElLorans/PredictSocialMediaTrend
[ "527a407429c3dcead402f19d4e07149e8b1040c9" ]
[ "code/old_models/matrix_of_precision_for_var_and_file.py" ]
[ "# Obtain matrix for each column and each file\r\n# stating success & reliability of Baseline Model\r\n\r\n# Baseline Model is a model that divides a dataset in time windows of 4 weeks (the parameter can be changed when calling the function), \r\n# does linear regression on each time window's\r\n# first 3 weeks an...
[ [ "sklearn.model_selection.train_test_split", "pandas.DataFrame", "pandas.read_csv", "sklearn.linear_model.LinearRegression" ] ]
Czworldy/GP_traj
[ "96261f39a5a322092e3a6be98938bb4601f0f746" ]
[ "dataset.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport glob\nimport random\nimport numpy as np\nfrom PIL import Image\n\nimport torch\nfrom torch.utils.data import Dataset\nimport torchvision.transforms as transforms\n\nclass CostMapDataset(Dataset):\n def __init__(self, data_index, opt, dataset_path='/media/w...
[ [ "numpy.sin", "torch.stack", "torch.FloatTensor", "numpy.sqrt", "numpy.cos", "numpy.deg2rad" ] ]
LightSpeedAI-Labs/HPCC_FPGA
[ "d12463757b99a2e5c3b61d015825c55ce6a0034e" ]
[ "scripts/evaluation/parse_raw_to_csv.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nimport pandas as pd\nimport os\nfrom os import path\nimport re\nimport io\nimport sys\n\n# Regular expressions for the raw output of all \nfft_regex = \"Version:\\\\s+(?P<version>.+)\\n(.*\\n)+Batch\\\\sSize\\\\s+(?P<batch_size>\\d+)\\n(.*\\n)FFT\\\\sSize\\\\s+(?P<size>\\...
[ [ "pandas.DataFrame" ] ]
iqDF/tsn-pytorch
[ "c734ee040fcb245542866f0a7812cdc6e417cb2c" ]
[ "split_data.py" ]
[ "import os\nimport glob\n\nimport numpy as np\nfrom sklearn.model_selection import StratifiedShuffleSplit\n\nimport os\nfrom pathlib import Path\nfrom multiprocessing import Pool, current_process\nfrom utils import *\n\n\n\n#------------------------\n# Helpers\n#------------------------\n\ndef get_path_label_list(\...
[ [ "sklearn.model_selection.StratifiedShuffleSplit", "numpy.array" ] ]
Jaspi10/manim
[ "cfba888ad69a7ccd4a8c4a1c80662078171b73ed" ]
[ "manimlib/mobject/coordinate_systems.py" ]
[ "import numpy as np\n\nfrom manimlib.constants import *\nfrom manimlib.mobject.functions import ParametricFunction\nfrom manimlib.mobject.geometry import Arrow\nfrom manimlib.mobject.geometry import Line\nfrom manimlib.mobject.number_line import NumberLine\nfrom manimlib.mobject.svg.tex_mobject import TexMobject\nf...
[ [ "numpy.array", "numpy.ones", "numpy.arange", "numpy.mean" ] ]
orbanjerbi/auto-sklearn
[ "1c6af59ff61f1d0a3b54b16a35ffbc5d2d3828cd" ]
[ "autosklearn/util/backend.py" ]
[ "import glob\nimport os\nimport tempfile\nimport time\nimport random\nimport lockfile\nimport numpy as np\nimport pickle\nimport shutil\nfrom typing import Union\n\nfrom autosklearn.util import logging_ as logging\n\n\n__all__ = [\n 'Backend'\n]\n\n\ndef create(temporary_directory,\n output_directory,\...
[ [ "numpy.allclose", "numpy.load" ] ]
VasavanThiru/geopandas
[ "4945a185885b470026e284fa35310db40bff514f" ]
[ "geopandas/tests/test_geom_methods.py" ]
[ "from __future__ import absolute_import\n\nimport string\n\nimport numpy as np\nfrom pandas import Series, DataFrame, MultiIndex\nfrom shapely.geometry import (\n Point, LinearRing, LineString, Polygon, MultiPoint)\nfrom shapely.geometry.collection import GeometryCollection\nfrom shapely.ops import unary_union\n...
[ [ "numpy.array", "pandas.util.testing.assert_frame_equal", "pandas.DataFrame", "numpy.testing.assert_array_equal", "pandas.MultiIndex.from_tuples", "pandas.MultiIndex", "numpy.sqrt", "pandas.Series", "numpy.asanyarray" ] ]
hiskuDN/ensemble-adversarial-training
[ "819ad7c44d7dab4712a450e35237e9e2076cf762" ]
[ "attack_utils.py" ]
[ "import numpy as np\nimport keras.backend as K\n\nfrom tensorflow.python.platform import flags\nFLAGS = flags.FLAGS\n\n\ndef linf_loss(X1, X2):\n return np.max(np.abs(X1 - X2), axis=(1, 2, 3))\n\n\ndef gen_adv_loss(logits, y, loss='logloss', mean=False):\n \"\"\"\n Generate the loss function.\n \"\"\"\n...
[ [ "numpy.abs" ] ]
davindratulsi/qiskit-terra
[ "0c8bb3dbf8d688590431ca79a83ba8aede84ed20" ]
[ "qiskit/visualization/gate_map.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2018.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.max", "matplotlib.get_backend", "numpy.asarray", "matplotlib.ticker.MaxNLocator", "matplotlib.patches.FancyArrow", "matplotlib.pyplot.close", "numpy.mean", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplots", "matplotlib.patches.Ellipse", "matplotlib.pyplot....
Secondtonumb/espnet
[ "f790a7695f07ac3d464d47ffbdef0306354ffd8f" ]
[ "src/asr/asr_pytorch.py" ]
[ "#!/usr/bin/env python\n\n# Copyright 2017 Johns Hopkins University (Shinji Watanabe)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\nimport copy\nimport json\nimport logging\nimport math\nimport os\nimport pickle\n\n# chainer related\nimport chainer\nfrom chainer import reporter as reporter_modul...
[ [ "matplotlib.use", "torch.save", "torch.manual_seed", "torch.cuda.is_available", "torch.load" ] ]
aiyo-labs/antispoofing-cnn
[ "b52cf30658681f93c909d1925978555cffda8da1" ]
[ "graphs/models/antispoofing.py" ]
[ "\"\"\"\nAntiSpoofing Depth model\n\"\"\"\n\nfrom __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n#from ..weights_initializer import weights_init\nfrom torchsummary import summary\n\nclass AntiSpoofing(nn.Module):\n def __init__(self,resolution_inp = 256, r...
[ [ "torch.sigmoid", "torch.cat", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.functional.interpolate", "torch.nn.Conv2d", "torch.nn.ZeroPad2d", "torch.nn.ELU" ] ]
tair-ai/deephtc
[ "ec11f88bf1af3583ecd9e351790e766f1f18b56f" ]
[ "HTC_lib/Error_checker.py" ]
[ "\n# coding: utf-8\n\n# # created on Feb 18 2018\n\n# In[1]:\n\n\nimport os, time, shutil\nimport re\nimport subprocess\n\nfrom pymatgen.io.vasp.outputs import Oszicar, Vasprun\nfrom pymatgen import Structure\n\nimport numpy as np\n\nfrom Query_from_OUTCAR import find_incar_tag_from_OUTCAR\nfrom Utilities import ge...
[ [ "numpy.mean" ] ]
metasyn/scikeras
[ "cb422fdd4f5c592feb71ce155fa25f26b25cdd82" ]
[ "scikeras/utils/transformers.py" ]
[ "from typing import Any, Dict, List, Union\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.exceptions import NotFittedError\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import FunctionTransformer, OneHotEncoder, Ordi...
[ [ "numpy.column_stack", "sklearn.preprocessing.FunctionTransformer", "numpy.zeros", "sklearn.utils.multiclass.type_of_target", "sklearn.preprocessing.OneHotEncoder", "tensorflow.keras.backend.floatx", "numpy.arange", "sklearn.preprocessing.OrdinalEncoder", "numpy.argmax", "nu...
rikenbit/MTL4MHC2
[ "1b0279ed7fb2e16fd1ca33e52b897637b08b5027" ]
[ "script/model_creation/bi_lstm_main.py" ]
[ "#!/usr/bin/env python\r\n# coding: utf-8\r\n\r\n\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport os\r\nimport random\r\nimport warnings\r\nfrom keras.preprocessing.sequence import pad_sequences\r\nimport tensorflow as tf\r\nimport keras\r\nfrom keras.models import Sequential\r\nfrom keras.layers import ...
[ [ "numpy.array", "pandas.DataFrame", "numpy.append", "pandas.read_csv", "tensorflow.keras.layers.concatenate", "pandas.get_dummies" ] ]
feiyangsb/out_of_distribution_detector_aebs
[ "b1238729863fab7d4147677baae00abc6af42831" ]
[ "scripts/vae_svdd_trainer.py" ]
[ "from scripts.network import VAE, SVDD\r\nimport torch\r\nimport numpy as np\r\nimport torch.optim as optim\r\nimport time\r\nfrom torch.utils.data import TensorDataset, DataLoader\r\n\r\n\r\nclass Trainer():\r\n def __init__(self, X_train, y_train):\r\n self.device = torch.device(\"cuda\" if torch.cuda.i...
[ [ "torch.zeros", "numpy.rollaxis", "torch.no_grad", "torch.optim.lr_scheduler.MultiStepLR", "torch.cuda.is_available", "torch.tensor", "torch.utils.data.DataLoader", "torch.load", "torch.mean", "torch.Tensor", "torch.utils.data.TensorDataset", "torch.sum" ] ]
sunutf/TVQA
[ "72ede1892b7ce79641ae697ff3dc6ba5ff32506e" ]
[ "config.py" ]
[ "__author__ = \"Jie Lei\"\n\nimport os\nimport time\nimport torch\nimport argparse\nfrom utils import mkdirp, load_json, save_json, save_json_pretty\n\n\nclass BaseOptions(object):\n def __init__(self):\n self.parser = argparse.ArgumentParser()\n self.initialized = False\n self.opt = None\n\...
[ [ "torch.device" ] ]
dcastf01/ImageSemanticSegmentation
[ "892be6da952e25277f14200f5d0d652b6f47848a" ]
[ "callbacks/show_prediction_on_epoch_end.py" ]
[ "import tensorflow as tf \nimport numpy as np\nfrom ..utils_visualization import display\n\n#pendiente de introducir correctamente\ndef create_mask(pred_mask):\n\n pred_mask = tf.argmax(pred_mask, axis=-1)\n \n pred_mask = pred_mask[..., tf.newaxis]\n return pred_mask[0]\ndef show_predictions(model,dataset=None...
[ [ "tensorflow.argmax" ] ]
chiaolun/vaex
[ "36872e8d37a7e1b728ade872a86c9d301a5cb406" ]
[ "tests/datetime_test.py" ]
[ "import pytest\nfrom common import *\nimport numpy as np\n\n\ndef test_datetime_operations():\n date = np.array([np.datetime64('2009-10-12T03:31:00'),\n np.datetime64('2016-02-11T10:17:34'),\n np.datetime64('2015-11-12T11:34:22'),\n np.datetime64('2003-03-...
[ [ "numpy.array", "numpy.arange", "numpy.timedelta64", "numpy.datetime64" ] ]
leesusu/Paddle
[ "0ecf441af14d554c85f69a206e3e3a9bdd86fb13" ]
[ "python/paddle/fluid/tests/unittests/test_tensor.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.alltrue", "numpy.array", "numpy.random.randint", "numpy.random.random" ] ]
ThanThoai/nanodet
[ "57a20ad622b3704244e3fdb1360a70a802281441" ]
[ "tools/test.py" ]
[ "# Copyright 2021 RangiLyu.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to...
[ [ "torch.utils.data.DataLoader", "torch.load" ] ]
FloodFinJava/LossGame
[ "9d1d22937457ccec5536058bd08e0ff4d64a94a1" ]
[ "src/game.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Provide the functions to run the flood risk game\n\"\"\"\n\nimport numpy as np\n\ndef distribute_points(extent, n_points):\n \"\"\"Randomly select a n number of points inside a given extent\n return two lists of lat/long coordinates\n \"\"\"\n lat = np.random.uniform(lo...
[ [ "numpy.random.uniform" ] ]
YummyLoop/nrn
[ "ceaf140e49b53213c69ab89cb0d0fd85bf85b2d3" ]
[ "share/lib/python/neuron/rxd/rxd.py" ]
[ "from neuron import h, nrn, nrn_dll_sym \nfrom . import species, node, section1d, region, generalizedReaction, constants\nfrom .nodelist import NodeList\nfrom .node import _point_indices\nimport weakref\nimport numpy\nimport ctypes\nimport atexit\nfrom . import options\nfrom .rxdException import RxDException\nfrom ...
[ [ "numpy.concatenate", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.ascontiguousarray", "numpy.ctypeslib.ndpointer", "numpy.where" ] ]
amodas/adversarial-robustness-toolbox
[ "3a957076d0df87203e1056b442a59d4ff56a8810" ]
[ "art/attacks/poisoning/feature_collision_attack.py" ]
[ "# MIT License\n#\n# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limita...
[ [ "numpy.linalg.norm", "torch.norm", "numpy.copy", "tensorflow.norm", "numpy.clip", "numpy.expand_dims", "numpy.vstack" ] ]
Jingyu-Peng/ray
[ "5ed3f0ce35cb3c66447858b4fc66573a13421d9a" ]
[ "rllib/policy/sample_batch.py" ]
[ "import collections\nimport numpy as np\nimport sys\nimport itertools\nimport tree # pip install dm_tree\nfrom typing import Dict, List, Optional, Set, Union\n\nfrom ray.util import log_once\nfrom ray.rllib.utils.annotations import Deprecated, DeveloperAPI, \\\n PublicAPI\nfrom ray.rllib.utils.compression impor...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.random.permutation", "numpy.shape", "numpy.all", "numpy.repeat" ] ]
Dizzy-cell/HOUV
[ "f7ed05d1b0bb775b22b682c82607252a7a734850" ]
[ "registration/model_utils_completion.py" ]
[ "import torch\nimport math\nimport os\nimport sys\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n# proj_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n# sys.path.append(os.path.join(proj_dir, \"utils/Pointnet2.PyTorch/pointnet2\"))\n# import pointnet2_utils as pn2\n# sys.path.append(...
[ [ "torch.cat", "torch.stack", "torch.ones", "torch.meshgrid", "torch.exp", "torch.topk", "torch.sum", "torch.sqrt", "torch.FloatTensor", "torch.unsqueeze", "torch.abs", "torch.zeros_like", "torch.zeros", "torch.device", "torch.max", "torch.linspace", ...
alphadl/hiersumm
[ "58c4baeb709bc0550f85253cc12192054b0c7901" ]
[ "src/abstractive/data_loader.py" ]
[ "import gc\nimport glob\nimport random\n\nimport torch\n\nfrom others.logging import logger\n\ndef chunks(l, n):\n \"\"\"Yield successive n-sized chunks from l.\"\"\"\n for i in range(0, len(l), n):\n yield l[i:i + n]\n\n\nclass AbstractiveBatch(object):\n def _pad(self, data, height, width, pad_id)...
[ [ "torch.tensor", "torch.load" ] ]
pbuslaev/freud
[ "ed83bdc63ee8fddba78f070ce9ddf2a0021d67b8" ]
[ "tests/test_density_RDF.py" ]
[ "import numpy as np\nimport numpy.testing as npt\nimport freud\nimport matplotlib\nimport unittest\nimport util\nfrom test_managedarray import TestManagedArray\nmatplotlib.use('agg')\n\n\nclass TestRDF(unittest.TestCase):\n def test_generateR(self):\n r_max = 5\n for r_min in [0, 0.05, 0.1, 1.0, 3....
[ [ "matplotlib.use", "numpy.testing.assert_allclose", "numpy.array", "numpy.sin", "numpy.random.rand", "numpy.zeros", "numpy.ones", "numpy.diff", "numpy.cos", "numpy.cumsum" ] ]
abefetterman/rl-testing
[ "557eadd5895e629632e701a27cdafde96e210215" ]
[ "buffer.py" ]
[ "import numpy as np\nimport random\n\nclass ReplayBuffer(object):\n def __init__(self, len):\n self.buf = []\n self.len = len\n def __len__(self):\n return len(self.buf)\n def add(self, new):\n if len(self.buf) >= self.len:\n self.buf.pop(0)\n self.buf.append(n...
[ [ "numpy.max", "numpy.sum", "numpy.array", "numpy.random.choice" ] ]
PlasmaControl/bes-edge-ml
[ "a6540df4f0bdb7d39c24f23de36fbeba4c1aeb18" ]
[ "bes_data_tools/bes_data.py" ]
[ "\"\"\"\nBES_Data class\n\nFetches and stores BES metadata, relevant signals, and (optionally) BES signals\n\"\"\"\n\nfrom pathlib import Path\nimport time\nimport numpy as np\nimport h5py\nimport MDSplus\n\n\nclass BES_Data(object):\n _points = ['ip',\n 'bt',\n 'pinj',\n ...
[ [ "numpy.array", "numpy.empty", "numpy.logical_and", "numpy.diff", "numpy.arange" ] ]
dand-oss/scikit-criteria
[ "1ca7667e08e79d551f8241278c939f604800d81b" ]
[ "skcriteria/norm.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016-2017, Cabral, Juan; Luczywo, Nadia\n# All rights reserved.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n\n# * Redistributions of source c...
[ [ "numpy.max", "numpy.linalg.norm", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.min", "numpy.where", "numpy.any", "numpy.finfo", "numpy.ndim" ] ]
vdankers/OpenNMT-py
[ "611f80428b6dad7726d3626e43515f7d05e2309e" ]
[ "onmt/utils/loss.py" ]
[ "\"\"\"\nThis file handles the details of the loss function during training.\n\nThis includes: LossComputeBase and the standard NMTLossCompute, and\n sharded loss compute stuff.\n\"\"\"\nfrom __future__ import division\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport onm...
[ [ "torch.nn.NLLLoss", "torch.autograd.backward", "torch.split", "torch.nn.functional.kl_div", "torch.full", "torch.sum" ] ]
megnashah/pytorch-CycleGAN-and-pix2pix
[ "aa3d9c13a8e4e94b04fccc634ead149f486d8d46" ]
[ "post_processing/plots_test.py" ]
[ "import pandas as pd\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nimport numpy\nimport os\nimport math\nimport pickle\nfrom datetime import date\n\n\n# TO BE CHANGED --> list of fake feature data to be analyzed\ntrial_list = [\"trial_12_14_20\", 'train_12_21_20', 'train_12_28v2_20',...
[ [ "matplotlib.use", "numpy.histogram", "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylab...
ShaunZac/Neural-Network
[ "34f69f8f6daa0e0f9c85ebb19db401d436b1e346" ]
[ "MNIST_keras.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Apr 21 09:02:13 2020\n\n@author: Shaun Zacharia\n\"\"\"\n\n\nimport numpy as np\nimport tensorflow as tf\nimport pandas as pd\nfrom keras import layers\nfrom keras import losses\nfrom keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Fl...
[ [ "tensorflow.keras.datasets.mnist.load_data", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "pandas.Series", "matplotlib.pyplot.show" ] ]
konpsar/Numerical-Methods-for-PDEs-course
[ "74e323ee9916fbbe59a3031aee623c44eb5d88a2" ]
[ "Ex2-Finite Difference Methods for the heat equation-Theta Methods/Code+Report/theta.py" ]
[ "import numpy as np\n\n# Initial conditon\n\ndef u0(x): return (x*(1-x))\n\n#Exact Solution\n\ndef u(x, t): return 8*np.sin(np.pi*x)*np.exp(-t*np.pi**2)/np.pi**3\n\n# Discretization parameters\n\nJ = 24; dx = 1.0 / J; x = np.linspace(0, 1, J+1)\nT = 0.1; N = 24; dt = T / N; mu = dt / dx**2\ntheta =1./2\n\n# Bu...
[ [ "numpy.sin", "numpy.zeros", "numpy.ones", "numpy.exp", "numpy.linspace", "numpy.diag" ] ]
Yaoc0009/BRVFL_MR
[ "3865d780953541231825ba1fcd9c2043f80e6d97" ]
[ "old/BRVFL.py" ]
[ "import numpy as np\r\nfrom sklearn.model_selection import train_test_split, KFold\r\nfrom scipy.io import loadmat\r\nimport pymc3 as pm\r\n\r\nn_node = 10 # num of nodes in hidden layer\r\nw_range = [-1, 1] # range of random weights\r\nb_range = [0, 1] # range of random biases\r\n\r\nclass BRVFL:\r\n \"\"\" BRV...
[ [ "numpy.dot", "numpy.ones_like", "numpy.copy", "numpy.exp", "numpy.mean", "numpy.sign", "numpy.random.random", "numpy.concatenate", "numpy.divide", "numpy.sin", "numpy.argmax", "numpy.square", "numpy.equal", "numpy.shape", "numpy.identity", "numpy.std...
chanmadeleine/Stint
[ "ec8e6c16cae1603a361e89d09ec92d7e9630afeb" ]
[ "app/main/Pointillism/pointillism_image.py" ]
[ "import pandas as pd\nfrom PIL import Image\n\nclass PointillismImage(object):\n \"\"\"\n Opens an image and provides accessors for aspect ratio and\n JSON formatted pixel data.\n\n \"\"\"\n def __init__(self, f_name):\n \"\"\"\n Initializes with provided filename.\n\n \"\"\"\n ...
[ [ "pandas.DataFrame" ] ]
JRyanShue/ldif
[ "fd2cbfbcb752d0e5e19e80b98760bf5bf9d1661f" ]
[ "ldif/training/metrics.py" ]
[ "# Copyright 2020 Google LLC\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# https://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicabl...
[ [ "tensorflow.logical_or", "tensorflow.reduce_sum", "tensorflow.logical_and" ] ]
XiaoyuHuang96/mmdetection
[ "e2ff08b68e2f5907a59976dcedb055036c03eecf" ]
[ "mmdet/datasets/xml_style.py" ]
[ "import os.path as osp\nimport xml.etree.ElementTree as ET\n\nimport mmcv\nimport numpy as np\n\nfrom .custom import CustomDataset\nfrom .registry import DATASETS\n\n\n@DATASETS.register_module\nclass XMLDataset(CustomDataset):\n\n def __init__(self, min_size=None, **kwargs):\n super(XMLDataset, self).__i...
[ [ "numpy.array", "numpy.zeros" ] ]
higlu/sdc-01-findlane
[ "e92336c28d10e548fdf82b68c29d370d48127efd" ]
[ "find_lane.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n@author: Simone Diolaiuti\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport cv2\nfrom uda_utils import *\nfrom geom_utils import *\n\nfrom sklearn.cluster import KMeans\n\ndef findLane(img):\n \"\"\"\n Args:\n img: a colored img as opened by matplo...
[ [ "numpy.array", "numpy.zeros_like", "numpy.empty", "numpy.zeros", "sklearn.cluster.KMeans", "numpy.append", "numpy.deg2rad", "numpy.empty_like" ] ]
001honi/vc-cycle-gan
[ "a03f8e3cd08d8d9c3ace551464ac96d2c20eed28" ]
[ "convert.py" ]
[ "import argparse\nimport os\nimport numpy as np\n\nfrom model import CycleGAN\nfrom preprocess import *\nfrom hyparams import *\n\ndef conversion(model_dir, model_name, data_dir, conversion_direction, output_dir):\n\n num_features = 24\n sampling_rate = 16000\n frame_period = 5.0\n\n model = CycleGAN(nu...
[ [ "numpy.ascontiguousarray", "numpy.array" ] ]
wbaek/pytorch
[ "26fd4647a777beeef81cce78eaf6279739e4aeb9" ]
[ "torch/distributed/optim/zero_redundancy_optimizer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport collections\nimport copy\nimport io\nfrom collections import OrderedDict\nfrom itertools import chain\nf...
[ [ "torch.zeros", "torch.device", "torch.distributed.get_world_size", "torch.save", "torch.ByteTensor", "torch.tensor", "torch.LongTensor", "torch.load", "torch.distributed.get_rank", "torch.empty", "torch.distributed.distributed_c10d._get_global_rank", "torch.distribu...
gmijenes/autogoal
[ "916b0eb4d1aa1a222d0ff1b0f6f202bf56458ef5" ]
[ "autogoal/datasets/wine_quality.py" ]
[ "# coding: utf-8\r\n\r\nimport numpy as np\r\nimport os\r\n\r\nfrom autogoal.datasets import download, datapath\r\n\r\n\r\ndef load(white=True, red=True, max_examples=None):\r\n if not red and not white:\r\n raise ValueError(\"Either red or white must be selected\")\r\n\r\n download(\"wine_quality\")\r...
[ [ "numpy.asarray" ] ]
foamliu/MobileFaceNet-v2
[ "9f84e3191539eb7c1f71b54816d686c2ed058994" ]
[ "lfw_eval.py" ]
[ "import math\nimport os\nimport pickle\nimport tarfile\nimport time\n\nimport cv2 as cv\nimport numpy as np\nimport scipy.stats\nimport torch\nfrom matplotlib import pyplot as plt\nfrom torchvision import transforms\nfrom tqdm import tqdm\nfrom mobilefacenet import MobileFaceNet\nfrom config import device\nfrom dat...
[ [ "torch.zeros", "numpy.clip", "numpy.dot", "numpy.linalg.norm", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "torch.no_grad", "numpy.mean", "numpy.std", "matplotlib.pyplot.hist", "matplotlib.pyplot...
Darleen2019/Nabu-MSSS
[ "5e862cbf846d45b8a317f87588533f3fde9f0726" ]
[ "nabu/postprocessing/scorers/sdr_scorer.py" ]
[ "\"\"\"@file sdr_scorer.py\ncontains the scorer using SDR\"\"\"\n\nimport scorer\nimport numpy as np\nimport bss_eval\n\n\nclass SdrScorer(scorer.Scorer):\n\t\"\"\"the SDR scorer class. Uses the script from\n\tC. Raffel, B. McFee, E. J. Humphrey, J. Salamon, O. Nieto, D. Liang, and D. P. W. Ellis,\n\t'mir_eval: A T...
[ [ "numpy.array" ] ]
sherbold/replication-kit-2020-smoke-testing
[ "17aa9858ab693e5c1b5b20c9b2d277802109600e" ]
[ "generated-tests/sklearn/test_SKLEARN_ComplementNB.py" ]
[ "import unittest\nimport xmlrunner\nimport pandas as pd\nimport numpy as np\nimport threading\nimport functools\nimport inspect\nimport math\nimport traceback\nimport warnings\n\nfrom parameterized import parameterized\nfrom scipy.io.arff import loadarff\nfrom scipy.stats import chisquare, ks_2samp\nfrom sklearn.pr...
[ [ "sklearn.preprocessing.LabelEncoder", "numpy.delete", "sklearn.naive_bayes.ComplementNB", "scipy.io.arff.loadarff", "pandas.DataFrame", "numpy.random.seed", "pandas.get_dummies" ] ]
hossen-code/DESlib
[ "77d0ccb491c522e7505d9ac6081b72cac001cb9e" ]
[ "deslib/static/static_selection.py" ]
[ "# coding=utf-8\n\n# Author: Rafael Menelau Oliveira e Cruz <rafaelmenelau@gmail.com>\n#\n# License: BSD 3 clause\n\nimport numpy as np\nfrom sklearn.metrics import check_scoring\nfrom sklearn.utils.validation import check_is_fitted, check_X_y, check_array\n\nfrom deslib.util.aggregation import majority_voting_rule...
[ [ "sklearn.utils.validation.check_is_fitted", "sklearn.utils.validation.check_X_y", "numpy.zeros", "sklearn.utils.validation.check_array", "sklearn.metrics.check_scoring", "numpy.argsort" ] ]
payne911/SR-ResCNN-Keras-
[ "2e5aa7320b0cec83db8d9dee5011e8380987b30b" ]
[ "predict.py" ]
[ "import argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport skimage.io\n\nfrom keras.models import load_model\n\nfrom constants import verbosity, save_dir, overlap, \\\n model_name, tests_path, input_width, input_height, scale_fact\nfrom utils import float_im\n\n\nparser = argparse.ArgumentPars...
[ [ "numpy.pad", "numpy.clip", "numpy.empty", "matplotlib.pyplot.imsave", "matplotlib.pyplot.suptitle", "numpy.split", "matplotlib.pyplot.figure", "numpy.cumsum", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "numpy.expand_dims", "matplotlib.pyplot.subplot" ] ...
papamarkou/eeyore
[ "4cd9b5a619cd095035aa93f348d1c937629aa8a3" ]
[ "eeyore/constants/constants.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom eeyore.stats import binary_cross_entropy\n\ntorch_to_np_types = {torch.float32: np.float32, torch.float64: np.float64}\n\n# Built-in function for binary classification\n# https://github.com/pytorch/pytorch/issues/18945\n# Second order automatic differ...
[ [ "torch.argmax", "torch.nn.CrossEntropyLoss" ] ]
trankha1655/pan_pp.origin
[ "aa4774b1bf360d0a8e54d520483514d57521bf34" ]
[ "models/post_processing/pse/setup.py" ]
[ "from distutils.core import Extension, setup\n\nimport numpy\nfrom Cython.Build import cythonize\n\nsetup(ext_modules=cythonize(\n Extension('pse',\n sources=['pse.pyx'],\n language='c++',\n include_dirs=[numpy.get_include()],\n library_dirs=[],\n ...
[ [ "numpy.get_include" ] ]
aramis-lab/pac2019
[ "200681eb0441baa69a386ef1ac8cf6f0d2ab01e0" ]
[ "src/deep/models/resnet_model.py" ]
[ "import torch.nn as nn\n\nfrom structures.modules import Flatten, AddingNodes\n\n\nclass ResBlock(nn.Module):\n def __init__(self, block_number, input_size):\n super(ResBlock, self).__init__()\n\n layer_in = input_size if input_size is not None else 2 ** (block_number + 1)\n layer_out = 2 **...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.MaxPool3d", "torch.nn.Conv3d", "torch.nn.BatchNorm3d", "torch.nn.ELU" ] ]
ITRI-AIdea/CTSP-job-shop-scheduling
[ "b1ccc847aea9388f05a0c399b2609dcb444604c4" ]
[ "util.py" ]
[ "# Copyright (c) 2020 Industrial Technology Research Institute.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle...
[ [ "pandas.DataFrame.from_dict", "pandas.DataFrame", "pandas.concat", "pandas.Series", "pandas.MultiIndex.from_frame" ] ]
ahuang11/ahh
[ "59f124c3aa04cde58db0ec2e81025eb63a92404e" ]
[ "ahh/vis.py" ]
[ "import os\nimport copy\nimport datetime\nimport numpy as np\nimport xarray as xr\nimport pandas as pd\nfrom collections import Counter\nfrom ahh.ext import (round_to, get_order_mag, report_err, lonw2e)\nfrom ahh.sci import get_stats, get_norm_anom, get_anom, get_norm\nfrom ahh.era import td2dict\nimport matplotlib...
[ [ "numpy.ones_like", "numpy.median", "matplotlib.dates.DateFormatter", "numpy.min", "numpy.sign", "numpy.where", "matplotlib.dates.num2date", "numpy.cumsum", "matplotlib.patches.Rectangle", "matplotlib.colorbar.ColorbarBase", "matplotlib.dates.DayLocator", "matplotlib...
johnwlambert/argoverse-api
[ "ae7d7ad392695b2b9ad52cb7b5ad9145c13a0955" ]
[ "argoverse/evaluation/eval_utils.py" ]
[ "# <Copyright 2019, Argo AI, LLC. Released under the MIT license.>\n\"\"\"Utilities used in evaluation of performance.\"\"\"\n\nimport copy\nfrom typing import Any, Dict, List, Tuple\n\nimport numpy as np\nfrom argoverse.map_representation.map_api import ArgoverseMap\nfrom argoverse.utils.transform import quat2rotm...
[ [ "numpy.array", "numpy.matmul", "numpy.zeros", "numpy.logical_and", "numpy.arctan2" ] ]
petteriTeikari/crank-voiceconversion-wrapper
[ "8d34a76a8a4949cb1780a4770922f755dd04000c" ]
[ "crank/net/trainer/trainer_vqvae.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n#\n# Copyright (c) 2020 K. Kobayashi <root.4mac@gmail.com>\n#\n# Distributed under terms of the MIT license.\n\"\"\"\nVQVAE trainer\n\n\"\"\"\n\nimport random\n\nimport torch\nfrom crank.net.trainer import BaseTrainer\nfrom torch.nn.utils import cl...
[ [ "torch.no_grad" ] ]
changyu98/VGGNet-PyTorch
[ "20041ce7415f38498d61977b7814db90c63d9969" ]
[ "examples/cifar/main.py" ]
[ "# Copyright 2020 Lorna Authors. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b...
[ [ "torch.distributed.init_process_group", "torch.save", "torch.no_grad", "torch.multiprocessing.spawn", "torch.nn.parallel.DistributedDataParallel", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.set_device", "torch.utils.data.DataLoader", "torch.utils.data.distr...
dfm/one-datum-pipeline
[ "ee37b35aaf05e4b8c006c7384baca4c7bf50cae8" ]
[ "workflow/scripts/figures/sigma_cmd.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom astropy.io import fits\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"-i\", \"--input\", required=True, type=str)\nparser.add_argument(\"-o\", \"--output\", required=True, ty...
[ [ "numpy.histogram2d", "numpy.zeros_like", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.pcolor", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "numpy.isfinite", "numpy.log10",...
andrewnc/geometric-neural-processes
[ "56f6fb150685cb13393457beb275441e9fe268ba" ]
[ "tile_np.py" ]
[ "import matplotlib.pyplot as plt\nfrom matplotlib.lines import Line2D\nimport numpy as np\n\nimport pickle\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\n# from scipy.stats import wasserstein_distance\n# from geomlo...
[ [ "torch.nn.Linear", "torch.cat", "torch.eye", "matplotlib.pyplot.subplots", "numpy.random.randint", "matplotlib.pyplot.axis", "torch.device", "matplotlib.lines.Line2D", "torch.min", "torch.max", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "torch.nn.Conv...
thomasreolon/DeepfakeDetection
[ "5bbeefdeeb05b2abd45336ad3382da6ce90c2fef" ]
[ "src/videoanalizer/classifier.py" ]
[ "from sklearn import svm\nimport numpy as np\nfrom .video_edits import save_video_landmarks\n\n\nclass OneClassRbf():\n def __init__(self, video_analizer, rich_features=0, person=None, config=None, outliers=True, custom_params=None):\n self.video_analizer = video_analizer\n self.rich = rich_feature...
[ [ "sklearn.svm.OneClassSVM" ] ]
shepherdp/csc486-assignment-2
[ "bc28073857d888ffb24d3144c81a20b668368200" ]
[ "asgn2.py" ]
[ "# CSC486 - Spring 2022\n# Author: Dr. Patrick Shepherd\n\n# NOTE: This file contains several functions, some of which already do something\n# when run, even before you start writing code. For your convenience, in the\n# main function, you may want to comment out the functions you are not currently\n# using so the...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.scatter" ] ]
maestrojeong/Deep-Hash-Table-ICML18-
[ "0c7efa230f950d5a2cd1928ac9f5d99f4276d2b5" ]
[ "utils/sklearn_op.py" ]
[ "from sklearn.cluster import KMeans\nfrom tqdm import tqdm\n\nimport tensorflow as tf\nimport numpy as np\n\nclass KMeansClustering:\n def __init__(self, X_samples, n_clusters):\n '''\n Args:\n X_samples - Numpy 2D array\n [n_sample, n_features]\n n_clusters - i...
[ [ "numpy.concatenate", "tensorflow.convert_to_tensor", "numpy.zeros", "tensorflow.expand_dims", "sklearn.cluster.KMeans", "tensorflow.placeholder" ] ]
liuhyCV/instance-segmentation-based-part-seg
[ "9f946e20672d591130b1cd91b149e277315382dc" ]
[ "faster_rcnn/config/config.py" ]
[ "# --------------------------------------------------------\n# Deformable Convolutional Networks\n# Copyright (c) 2016 by Contributors\n# Copyright (c) 2017 Microsoft\n# Licensed under The Apache-2.0 License [see LICENSE for details]\n# Modified by Yuwen Xiong, Bin Xiao\n# ------------------------------------------...
[ [ "numpy.array" ] ]
WillKoehrsen/pandas
[ "2efb60717bda9fc64344c5f6647d58564930808e" ]
[ "pandas/tests/groupby/test_whitelist.py" ]
[ "\"\"\"\ntest methods relating to generic function evaluation\nthe so-called white/black lists\n\"\"\"\n\nfrom string import ascii_lowercase\n\nimport numpy as np\nimport pytest\n\nfrom pandas import DataFrame, Index, MultiIndex, Series, date_range\nfrom pandas.util import testing as tm\n\nAGG_FUNCTIONS = [\n \"...
[ [ "pandas.Index", "pandas.util.testing.assert_frame_equal", "numpy.random.randn", "numpy.random.randint", "pandas.MultiIndex", "pandas.Series", "numpy.random.random" ] ]
xuan-wang/funcat
[ "c4b184942564ab8a4092acb4907ab069fc44683c" ]
[ "funcat/data/crypto_backend.py" ]
[ "# -*- coding: utf-8 -*-\n#\n\nfrom cached_property import cached_property\n\nimport numpy as np\nimport pandas as pd\nimport datetime\nimport time\nimport os\n\nfrom .okex.spot_api import SpotAPI\nfrom pandas.core.frame import DataFrame\n\nfrom .backend import DataBackend\nfrom ..utils import lru_cache, get_str_da...
[ [ "pandas.core.frame.DataFrame", "pandas.read_csv", "pandas.concat" ] ]
murilopontes/aditof_sdk
[ "c67fc31d52971b8652e39da50d66260fa66f71c7" ]
[ "tools/calibration-96tof1/cal_eeprom/cal_map.py" ]
[ "#\n# BSD 3-Clause License\n#\n# Copyright (c) 2019, Analog Devices, Inc.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copy...
[ [ "pandas.read_csv" ] ]
Olllom/openmmtools
[ "8ca9fb07627f889e531e9d6f0d52c2f81a33a8e1" ]
[ "openmmtools/tests/test_alchemy.py" ]
[ "#!/usr/bin/python\n\n# =============================================================================\n# MODULE DOCSTRING\n# =============================================================================\n\n\"\"\"\nTests for alchemical factory in `alchemy.py`.\n\n\"\"\"\n\n\n# =======================================...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "scipy.special.erf", "matplotlib.pyplo...
DanielKyr/DeepPurpose
[ "b6379c9946c9b88de344ba7276175271b0e70b42" ]
[ "DeepPurpose/PPI.py" ]
[ "import torch\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nfrom torch.utils import data\nfrom torch.utils.data import SequentialSampler\nfrom torch import nn \n\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom time import time\nfrom skl...
[ [ "torch.nn.Linear", "torch.cat", "scipy.stats.pearsonr", "torch.squeeze", "torch.cuda.is_available", "sklearn.metrics.average_precision_score", "torch.load", "sklearn.metrics.f1_score", "torch.nn.DataParallel", "matplotlib.pyplot.savefig", "torch.manual_seed", "torch...