repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
initzhang/Hetu
[ "447111a358e4dc6df5db9c216bdb3590fff05f84", "447111a358e4dc6df5db9c216bdb3590fff05f84", "447111a358e4dc6df5db9c216bdb3590fff05f84" ]
[ "python/hetu/gpu_ops/BatchNorm.py", "python/hetu/gpu_ops/Split.py", "examples/cnn/tf_models/tf_LeNet.py" ]
[ "from __future__ import absolute_import\nfrom .Node import Op\nimport numpy as np\nfrom .. import ndarray\nfrom .._base import DNNL_LIB\nfrom ..cpu_links import batch_norm as cpu_batch_norm\nfrom ..cpu_links import batch_norm_inference as cpu_batch_norm_inference\nfrom ..cpu_links import batch_norm_gradient as cpu_...
[ [ "numpy.ones", "numpy.zeros" ], [ "numpy.zeros" ], [ "numpy.random.normal", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.nn.relu", "tensorflow.nn.conv2d", "tensorflow.matmul", "tensorflow.transpose", "tensorflow.reshape", "tensorflow.reduce_mean...
ITMO-NSS-team/nas-fedot
[ "3b886f48f66f7ce77dca10b3cf0229e056b4948b" ]
[ "fedot/core/composer/optimisers/gp_optimiser.py" ]
[ "import math\r\nfrom dataclasses import dataclass\r\nfrom functools import partial\r\nfrom typing import (\r\n List,\r\n Callable,\r\n Any,\r\n Optional\r\n)\r\n\r\nimport numpy as np\r\nfrom core.composer.optimisers.crossover import CrossoverTypesEnum, crossover\r\nfrom core.composer.optimisers.heredit...
[ [ "numpy.argsort" ] ]
ChuChuIgbokwe/DeepReinforcementLearningNanodegree
[ "d1e0ddde31b56f1f4f534fcd7e32d9512105874a" ]
[ "p1_navigation/dqn_agent.py" ]
[ "import numpy as np\nimport random\nfrom collections import namedtuple, deque\n\nfrom model import QNetwork\n\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nBUFFER_SIZE = int(1e5) # replay buffer size\nBATCH_SIZE = 64 # minibatch size\nGAMMA = 0.99 # discount fact...
[ [ "torch.no_grad", "torch.from_numpy", "torch.nn.functional.mse_loss", "torch.cuda.is_available", "numpy.arange", "numpy.vstack" ] ]
willsheffler/tcdock
[ "c7b8614221f4a94750054bfe5dfb12298e8d05b8" ]
[ "rpxdock/search/dockspec.py" ]
[ "from abc import abstractmethod\nimport numpy as np\nimport rpxdock.homog as hm\nfrom rpxdock.geom import sym\n\nallowed_twocomp_architectures = \"\"\"\nD22 D32 D42 D52 D62 D72 D82\nT32 T33 O32 O42 O43 I32 I52 I53\nT32D T23D T33D\nO32D O23D O42D O24D O43D O34D\nI32D I23D I52D I54D I53D I35D\nAXEL_1_2_3 AXEL_1_2_4 A...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.tan", "numpy.mean", "numpy.eye", "numpy.allclose", "numpy.sign", "numpy.argmax" ] ]
mesudepolat/CART_DIABETES
[ "ebb94754a227178f5abfacce771a9808f609605e" ]
[ "CART_DIABETES.py" ]
[ "################################\r\n# DIABETES PREDICTION with CART\r\n################################\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom sklearn.metrics import *\r\nfrom sklearn.model_selection import *\r\nfrom sklearn.tree import DecisionTreeClassifier\r\nimport pydotplus\r\nfrom sklearn.tree ...
[ [ "pandas.DataFrame", "pandas.read_csv", "sklearn.tree.DecisionTreeClassifier", "pandas.set_option" ] ]
osisbo/on-safety-in-safe-bayesian-optimization
[ "fa0f09df065e41e05f6b0185d4817dccc60b164a" ]
[ "experiments_losbo.py" ]
[ "from __future__ import print_function, division, absolute_import\n\nimport GPy\nimport numpy as np\nimport losbo as safeopt\nimport scipy\nimport math\nimport time\nimport os\nimport datetime\nimport pickle\nimport multiprocessing as mp\nimport sys\nimport pathlib\n\nstore_path = str(pathlib.Path(__file__).parent....
[ [ "numpy.logical_not", "numpy.logical_or", "numpy.linalg.norm", "numpy.zeros", "numpy.random.seed", "numpy.sum", "scipy.stats.ttest_ind", "numpy.nonzero", "numpy.where", "numpy.argmax" ] ]
urschrei/convertbng
[ "16557cea756a0ec6994b4148ae8caa67c065f686" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nsetup.py\n\nCreated by Stephan Hügel on 2016-07-25\n\"\"\"\n\nimport sys\nfrom setuptools import setup, Extension\nfrom Cython.Build import cythonize\nimport numpy\n\n\n# # Set dynamic RPATH differently, depending on platform\nldirs = []\nddirs = []\nif \"lin...
[ [ "numpy.get_include" ] ]
404-Brain-Not-Found/Bird-Watcher
[ "2a9e2033faa17c4a28ae1be5d1145d556f2bc7b8" ]
[ "yolo_utils.py" ]
[ "import numpy as np\nfrom tensorflow.keras import backend as k\nfrom image_utils import non_max_suppression\n\n\ndef xywh2minmax(xy, wh):\n xy_min = xy - wh / 2\n xy_max = xy + wh / 2\n\n return xy_min, xy_max\n\n\ndef iou(pred_mins, pred_maxes, true_mins, true_maxes):\n intersect_mins = k.maximum(pred_...
[ [ "tensorflow.keras.backend.expand_dims", "tensorflow.keras.backend.dtype", "tensorflow.keras.backend.sum", "tensorflow.keras.backend.sqrt", "tensorflow.keras.backend.minimum", "tensorflow.keras.backend.transpose", "tensorflow.keras.backend.stack", "tensorflow.keras.backend.square", ...
Fisher33318/yolov3-motebus
[ "96bf731cda088a18ebdc2e5a863adfef812e1095" ]
[ "utils/torch_utils.py" ]
[ "import math\nimport os\nimport time\nfrom copy import deepcopy\n\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\ndef init_seeds(seed=0):\n torch.manual_seed(seed)\n\n # Remove randomness (may be slower on Tesla GPUs) # https://pytorch.org/docs/...
[ [ "torch.zeros", "torch.device", "torch.sqrt", "torch.cuda.synchronize", "torch.nn.functional.interpolate", "torch.no_grad", "torch.cuda.get_device_properties", "torch.cuda.device_count", "torch.manual_seed", "torch.mm", "torch.nn.Conv2d", "torch.cuda.is_available", ...
volodymyrss/Concordance
[ "2bdbf551f85be7cfa924a4c8fefc77e08f6d1067" ]
[ "CalConcordanceCode/generatehistogram.py" ]
[ "import numpy as np\nimport math as math\nimport matplotlib.pyplot as plt\n\n\ndef generatehistogramfunc(mcmcChainBG, mapResultBG, N, M, B, G, sigma,\n figsize1=20, figsize2=6, ncolfig=5, sigmatheory=float('nan'),\n savefigname='fig.pdf', plotwhich=[1, 0, 1],\n ...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.axhline", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "numpy.exp", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "numpy.a...
tahentx/ecological-inference
[ "720217eeaf5b56fbc7337056f3f663731f66970a" ]
[ "pyei/data.py" ]
[ "\"\"\"Helpers for managing data files.\"\"\"\nfrom dataclasses import dataclass\n\nimport pandas as pd\n\n__all__ = [\"Datasets\"]\n\n\n@dataclass\nclass _DataSet:\n \"\"\"Class to hold datasets and related information.\n\n TODO: Add description, provenance, and other metadata here.\n \"\"\"\n\n url: s...
[ [ "pandas.read_csv" ] ]
mohitmunjal/pmdarima
[ "cd333d6d661bf9d9b4afa37fa8747b3dcccc7f3f" ]
[ "pmdarima/datasets/lynx.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Author: Taylor Smith <taylor.smith@alkaline-ml.com>\n#\n# This is the lynx dataset found in R.\n\nimport numpy as np\nimport pandas as pd\n\nfrom ..compat import DTYPE\n\n__all__ = [\n 'load_lynx'\n]\n\n\ndef load_lynx(as_series=False, dtype=DTYPE):\n \"\"\"Annual numbers of lyn...
[ [ "numpy.array" ] ]
saramsv/CCT
[ "27b4fd838a174a3c0fca582aa163e5bd426b055a" ]
[ "pseudo_labels/make_cam.py" ]
[ "import torch\nfrom torch import multiprocessing, cuda\nfrom torch.utils.data import DataLoader\nimport torch.nn.functional as F\nfrom torch.backends import cudnn\n\nimport numpy as np\nimport importlib\nimport os\n\nimport voc12.dataloader\nfrom misc import torchutils, imutils\n\ncudnn.enabled = True\n\ndef _work(...
[ [ "torch.nonzero", "torch.stack", "torch.nn.functional.adaptive_max_pool2d", "torch.no_grad", "torch.multiprocessing.spawn", "torch.cuda.device", "torch.cuda.device_count", "torch.unsqueeze", "torch.cuda.empty_cache", "torch.utils.data.DataLoader", "torch.load" ] ]
AmateurZhang/EnjoyWithDataOnPowerSystems
[ "64227d0505012d2b5650874c65268e85d9751a17" ]
[ "AnEnsembleForPointEstimate/Ensemble.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 3 11:00:38 2017\n\n@author: thuzhang\n\"\"\"\n\n# Ensemble\n\n\n# packages\nfrom PredictWindSpd import PredictWindSpd\nfrom Reduced_Noise import NoiseReduce\nfrom Former_Data import FormerData\n#from ReadTrueValue import ReadTrueValue\nimport matplotlib.pyplot a...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.axes", "matplotlib.pyplot.figure" ] ]
schmolly/timemachine
[ "7d13a0406dc2d09ac67892988641ba4965bfb206" ]
[ "examples/rhfe_dual.py" ]
[ "# relative hydration free energy\n\nimport numpy as np\n\nfrom rdkit import Chem\nfrom rdkit.Chem import AllChem\nfrom fe import pdb_writer\nfrom fe import topology\nfrom md import builders\nfrom md import minimizer\n\nfrom timemachine.lib import potentials, custom_ops\nfrom timemachine.lib import LangevinIntegrat...
[ [ "numpy.concatenate", "numpy.zeros_like", "numpy.eye", "numpy.any", "numpy.linspace" ] ]
srakhe/olympics
[ "0b85e33f51333802ba93d46eaaf1e40889861a0f" ]
[ "web/utils/predict_host.py" ]
[ "import pandas as pd\nfrom datetime import datetime\nimport pickle\nimport numpy as np\nimport plotly.graph_objects as go\nfrom sklearn.preprocessing import StandardScaler\n\n\nclass PredictHost:\n\n def __init__(self, data_path, web_data_path):\n self.data_path = data_path\n self.web_data_path = w...
[ [ "numpy.array", "sklearn.preprocessing.StandardScaler", "pandas.DataFrame", "numpy.cbrt", "pandas.read_csv" ] ]
hhieuu/garch-option-pricing
[ "bd5ccc2ce55d97768dddfcc13da95f2babff7c02" ]
[ "utils.py" ]
[ "import numpy as np\nfrom numba import jit\n\n\n@jit(nopython=True)\ndef normal_pdf(x, mean=0, sd=1):\n \"\"\"\n Calculate probability of x given X ~ N(mean, sd ** 2)\n \"\"\"\n return 1 / (sd * np.sqrt(2 * np.pi)) \\\n * np.exp(- 1 / 2 * ((x - mean) / sd) ** 2)" ]
[ [ "numpy.exp", "numpy.sqrt" ] ]
wakame1367/Titanic_submit_script
[ "d96fdf23e4f86caaa534dc1734d33c71d7371b01" ]
[ "titanic_sample/dataset.py" ]
[ "from pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\nfrom titanic_sample.utils import ON_KAGGLE\n\nDATA_ROOT = Path('../input/titanic' if ON_KAGGLE else './resources')\nCategorical_Features = ['Embarked', 'Pclass', 'Sex']\ntrain_path = DATA_RO...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv", "numpy.mean", "pandas.concat" ] ]
ByzanTine/AutoHOOT
[ "007bb423bfc8eefa64e4d1b0f8dad80b440bcf7a" ]
[ "examples/tucker.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.core.einsumfunc._parse_einsum_input" ] ]
TimothyDelille/tgn
[ "44ff0843467e152bb54099dc6a34f668cd9749f7" ]
[ "utils/data_processing.py" ]
[ "import numpy as np\nimport random\nimport pandas as pd\n\n\nclass Data:\n def __init__(self, sources, destinations, timestamps, edge_idxs, labels, game_ids, batch_idx):\n self.sources = sources\n self.destinations = destinations\n self.timestamps = timestamps\n self.edge_idxs = edge_idxs\n self.lab...
[ [ "numpy.quantile", "numpy.random.rand", "numpy.mean", "numpy.logical_and", "numpy.std" ] ]
mldmort/adVNTR
[ "412398924bc7f2ed1fa38c0c5456998d9cdd5b5a" ]
[ "advntr/coverage_bias.py" ]
[ "import logging\nfrom math import sqrt\nimport sys\n\nimport pysam\nimport numpy\n\nfrom advntr.settings import *\nfrom advntr.utils import get_chromosome_reference_sequence, get_gc_content\n\n\nclass CoverageBiasDetector:\n \"\"\"Find the coverage distribution based on GC content.\"\"\"\n\n def __init__(self...
[ [ "numpy.array" ] ]
uzair789/faster-rcnn.pytorch
[ "f9d984d27b48a067b29792932bcb5321a39c1f09" ]
[ "lib/model/rpn/bbox_transform.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n# --------------------------------------------------------\n#...
[ [ "torch.stack", "torch.min", "torch.max", "torch.log", "torch.exp" ] ]
marco-zangari/math
[ "8eea68b0f7c0457593814250b488343b7504972b" ]
[ "graphs/newtons_law.py" ]
[ "\"\"\"Newton's law of universal gravitation.\"\"\"\n\nimport matplotlib.pyplot as plt\n\n\ndef draw_graph(x, y):\n \"\"\"Draw relation between gravitational force & distance between bodies.\"\"\"\n plt.plot(x, y, marker='o')\n plt.xlabel('Distance in Meters')\n plt.ylabel('Gravitational Force in Newton...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
Dumpkin1996/clipper
[ "457088be2ebe68c68b94d90389d1308e35b4c844", "457088be2ebe68c68b94d90389d1308e35b4c844" ]
[ "applications/fatigue_bigball/container/container4/app/predict.py", "applications/prediction_clipper/container/c8_KNN/app/predict.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Apr 22 15:03:22 2019\n\n@author: davidzhou\n\"\"\"\nimport time\nimport cv2\nimport numpy as np\nimport os\nimport json\n\ndef image_string(image):\n image_encode=cv2.imencode('.jpg',image)[1]\n imagelist=image_encode.tolist()\n image...
[ [ "numpy.uint8", "numpy.array", "numpy.copy" ], [ "pandas.DataFrame", "pandas.read_json", "sklearn.preprocessing.MinMaxScaler", "sklearn.model_selection.GridSearchCV", "sklearn.neighbors.KNeighborsRegressor" ] ]
harrisonzhu508/Bayesian-Inference-on-Football
[ "08bd8bfd3aa1800ca59c7572405be2405641d881" ]
[ "wcAnalysis.py" ]
[ "\"\"\"\nThe aim of this project is to predict the scores head-to-head matches of world cup 2018 in Russia.\n\nIn particular, we work under the Bayesian framework, using the Poisson regression likelihood with a normalised Gaussian prior. Our 3\napproximations will be the:\n\n- Laplace approximation, \n- Metropolis-...
[ [ "torch.zeros", "numpy.random.binomial", "numpy.trace", "numpy.zeros", "pandas.DataFrame", "numpy.random.poisson", "matplotlib.pyplot.plot", "scipy.stats.poisson.pmf", "numpy.mean", "numpy.random.uniform", "torch.eye", "matplotlib.pyplot.show", "pandas.read_csv",...
fmelinscak/cognibench
[ "372513b8756a342c0df222dcea5ff6d1d69fbcec" ]
[ "cognibench/scores.py" ]
[ "import numpy as np\nfrom scipy.stats.mstats import pearsonr\nfrom sciunit import scores\nfrom sciunit import errors\nfrom cognibench.capabilities import PredictsLogpdf, ReturnsNumParams\nfrom overrides import overrides\nfrom cognibench.utils import negloglike\n\n\nclass BoundedScore(scores.FloatScore):\n @overr...
[ [ "numpy.dot", "numpy.asarray", "numpy.log", "scipy.stats.mstats.pearsonr", "numpy.sum", "numpy.mean", "numpy.sqrt", "numpy.clip", "numpy.abs", "numpy.squeeze" ] ]
mortenblaa/lut-generator
[ "ab00879a095582deb74eb760c7cbb603bb711785" ]
[ "lut-generator.py" ]
[ "import argparse\nimport math\nimport sys\n\nimport cv2\nimport numpy as np\n\n\ndef make_image_strip(samples=16, flipy=False):\n \"\"\"\n Creates a list containing the image data in a strip format.\n\n :param samples: The number of samples, should be 16, 32 or 64\n :type samples: int\n :param flipy:...
[ [ "numpy.array" ] ]
TcheL/Road2Filter
[ "0f18053824de6d654ac95c63271cd93077359139" ]
[ "IIR/o4zpsbwlpf.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import signal\n\nfs = 1000 # sampling frequency\nfc = 6 # cut-off frequency\nt = np.arange(1000)/fs\nsga = np.sin(2*np.pi*2*t) # signal with f = 2\nsgb = np.sin(2*np.pi*10*t) # signal with f = 10\nsgo = sga +...
[ [ "numpy.sin", "numpy.savetxt", "matplotlib.pyplot.plot", "scipy.signal.butter", "matplotlib.pyplot.legend", "scipy.signal.filtfilt", "numpy.loadtxt", "scipy.signal.lfilter", "numpy.arange", "matplotlib.pyplot.show" ] ]
JonasStankevicius/CenterPoint
[ "d3459c508385645b88301267aafdfcff999a01af" ]
[ "det3d/torchie/trainer/utils.py" ]
[ "\"\"\"\nThis file contains primitives for multi-gpu communication.\nThis is useful when doing distributed training.\n\"\"\"\n\nimport functools\nimport pickle\nimport sys\nimport time\nfrom getpass import getuser\nfrom socket import gethostname\n\nimport torch\nimport torch.distributed as dist\nfrom det3d import t...
[ [ "torch.distributed.get_world_size", "torch.distributed.is_available", "torch.cat", "torch.stack", "torch.IntTensor", "torch.no_grad", "torch.distributed.all_gather", "torch.ByteTensor", "torch.distributed.is_initialized", "torch.ByteStorage.from_buffer", "torch.distribu...
amangoel185/awkward-1.0
[ "892b5abca4a2e86842d160cede9836b1c4352e45", "892b5abca4a2e86842d160cede9836b1c4352e45" ]
[ "tests/v2/test_0404-array-validity-check.py", "tests/v2/test_0447-preserve-regularness-in-reduce.py" ]
[ "# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/master/LICENSE\n\nfrom __future__ import absolute_import\n\nimport pytest # noqa: F401\nimport numpy as np # noqa: F401\nimport awkward as ak # noqa: F401\n\nto_list = ak._v2.operations.convert.to_list\n\n\ndef test_BitMaskedArray():\n ...
[ [ "numpy.array", "numpy.arange", "numpy.unique" ], [ "numpy.sum", "numpy.array", "numpy.arange" ] ]
Indumathi31/rpp
[ "1380bcd27130a36e3ba26763209148c2275fae5b" ]
[ "utilities/rpp-performancetests/HIP_NEW/generatePerformanceLogs.py" ]
[ "import os\nimport subprocess\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--profiling', type=str, default='NO', help='Run with profiler? - (YES/NO)')\nparser.add_argument('--case_start', type=str, default='0', help='Testing range starting case # - (0-84)')\nparser.add_argument('--ca...
[ [ "pandas.read_csv" ] ]
leezu/gluon-nlp
[ "19de74c2b03f22dde8311a0225b4571c2deef0e4" ]
[ "scripts/machine_translation/train_transformer.py" ]
[ "\"\"\"\nTransformer\n=================================\n\nThis example shows how to implement the Transformer model with GluonNLP Toolkit.\n\n@inproceedings{vaswani2017attention,\n title={Attention is all you need},\n author={Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and Uszkoreit, Jakob and Jones,\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.random.seed", "numpy.load", "numpy.exp", "numpy.savez" ] ]
facebookresearch/alma
[ "02a6d0e76fedc6af315dd906698153edabbaea5a" ]
[ "crlapi/sl/clmodels/agg_ensemble.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom crlapi.core import CLModel\nfrom c...
[ [ "torch.stack", "torch.nn.ModuleList", "torch.no_grad", "numpy.mean", "torch.nn.functional.cross_entropy", "numpy.prod" ] ]
pondus314/MVPproject
[ "166b7b9ac982afb5ec005d543ef38580de2a61ef" ]
[ "zs3/modeling/aspp.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom zs3.modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d\n\n\nclass _ASPPModule(nn.Module):\n def __init__(self, inplanes, planes, kernel_size, padding, dilation, BatchNorm):\n super().__init__()\n self.atrous...
[ [ "torch.cat", "torch.nn.Dropout", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
jwkanggist/tpu
[ "1def89d0a750844bbff58d27ff1f1fcf6b304669" ]
[ "models/official/retinanet/anchors.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.minimum", "numpy.exp", "tensorflow.reshape", "numpy.where", "tensorflow.cast", "numpy.concatenate", "tensorflow.concat", "numpy.unravel_index", "numpy.swapaxes", "numpy.arange", "numpy.column_stack", "numpy.vstack", "numpy.expand_dims", "numpy.array",...
ummadiviany/image-segmenter
[ "906457a16765f7e1995a8dca7b222ba3abd13a3f" ]
[ "inference.py" ]
[ "import torch\nfrom torchvision.models.segmentation import fcn_resnet50\nfrom torchvision.utils import draw_segmentation_masks\nfrom PIL import Image\nimport io\nfrom torchvision.transforms import transforms\nfrom torchvision.utils import save_image\nimport torchvision.transforms.functional as F\n\ndef get_model():...
[ [ "torch.arange", "torch.nn.functional.softmax" ] ]
shenyann/NASLib
[ "6fad875f21e41bb9c91647bbd0620aa6e6dc8c7f" ]
[ "naslib/predictors/zerocost_estimators.py" ]
[ "# Author: Robin Ru @ University of Oxford\n# This is an implementation of zero-cost estimators based on:\n# https://github.com/BayesWatch/nas-without-training (Jacov)\n# and https://github.com/gahaalt/SNIP-pruning (SNIP)\n\nimport numpy as np\nimport torch\nimport logging\nimport gc\n\nfrom naslib.predictors.predi...
[ [ "numpy.array", "torch.cat", "numpy.log", "torch.no_grad", "torch.cuda.empty_cache", "torch.cuda.is_available", "numpy.linalg.eig", "torch.ones_like", "numpy.corrcoef", "torch.nn.CrossEntropyLoss" ] ]
Teradata/techbytes-using-python-with-vantage
[ "422cd3e4f79c56fda9fe51f9143c3e958418d5ae" ]
[ "Inputs/stoRFScoreSB.py" ]
[ "################################################################################\n# * The contents of this file are Teradata Public Content and have been released\n# * to the Public Domain.\n# * Please see license.txt file in the package for more information.\n# * Alexander Kolovos and Tim Miller - May 2021 - v.2....
[ [ "pandas.DataFrame", "pandas.to_numeric" ] ]
soldierofhell/yolov3-tf2
[ "36a40edece7b01051bb357f4153a13a40aaac4de" ]
[ "yolov3_tf2/dataset.py" ]
[ "import tensorflow as tf\n\n\n@tf.function\ndef transform_targets_for_output(y_true, grid_size, anchor_idxs, classes):\n # y_true: (N, boxes, (x1, y1, x2, y2, class, best_anchor))\n N = tf.shape(y_true)[0]\n\n # y_true_out: (N, grid, grid, anchors, [x, y, w, h, obj, class])\n y_true_out = tf.zeros(\n ...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.image.decode_jpeg", "tensorflow.cast", "tensorflow.shape", "tensorflow.concat", "tensorflow.argmax", "tensorflow.io.FixedLenFeature", "tensorflow.constant", "tensorflow.pad", "tensorflow.TensorArray", "tensorflow...
matsuren/crownconv360depth
[ "8f8f30b6739409e5cd762af92206fe72d74b0d54" ]
[ "models/icosweepnet.py" ]
[ "import random\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .costvolume_regularization import CostRegularization\nfrom .feature_extraction import FeatureExtraction\nfrom .icospherical_sweeping import IcoSphericalSweeping\n\n\nclass IcoSweepNet(nn.Module):\n ...
[ [ "torch.zeros", "numpy.finfo", "torch.nn.functional.softmax", "numpy.linspace", "torch.sum" ] ]
strawberrypie/simpletransformers
[ "20ad03322281e3c0f594b35fa885bff3dd526ca6" ]
[ "simpletransformers/t5/t5_utils.py" ]
[ "import logging\nimport os\nfrom os import truncate\nimport pickle\nfrom multiprocessing import Pool\nfrom typing import Tuple\n\nfrom tqdm.auto import tqdm\n\nimport pandas as pd\nimport torch\nfrom tokenizers.implementations import ByteLevelBPETokenizer\nfrom tokenizers.processors import BertProcessing\nfrom torc...
[ [ "torch.flatten" ] ]
jeffwdoak/pycalphad
[ "c5c8df6a0630d9bed20a79eb8617849b260c5925" ]
[ "pycalphad/tests/test_calculate.py" ]
[ "\"\"\"\nThe calculate test module verifies that calculate() calculates\nModel quantities correctly.\n\"\"\"\n\nimport nose.tools\nfrom pycalphad import Database, calculate\nimport numpy as np\ntry:\n # Python 2\n from StringIO import StringIO\nexcept ImportError:\n # Python 3\n from io import StringIO\...
[ [ "numpy.testing.assert_array_equal" ] ]
StefekVUT/Aberation_tool
[ "bb4dfa319a8d7a633321492a10a1cc47302e9b07" ]
[ "Aberrations_refactored.py" ]
[ "import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nfrom math import pi\nfrom skimage.color import rgb2gray\n\n# functions\n\n\ndef load_image(filename):\n image = cv2.imread(filename, 0)\n print(image)\n return image\n\n\ndef pipe_convert_normalize(image):\n gray_image = rgb2gray(image)\n...
[ [ "numpy.sin", "numpy.fft.ifft2", "numpy.fft.fft2", "numpy.log", "numpy.multiply", "numpy.arctan", "numpy.sqrt", "numpy.cos", "numpy.fft.fftshift", "numpy.size", "numpy.abs" ] ]
wykys/MIKS-FSK
[ "a28255a1a184fb0b9753fcb133ea12e1b75ae93d" ]
[ "src/bell202.py" ]
[ "# wykys 2019\n\nimport numpy as np\nfrom numpy import array, uint8\nfrom bin_print import bin_print\n\nFREQ_L = 2200\nFREQ_H = 1200\nSAMPLE_RATE = 9600\nDATA_RATE = 1200\nBIT_SIZE = SAMPLE_RATE/DATA_RATE\n\n\ndef find_data_bytes(s):\n l_cnt = 0\n h_cnt = 0\n\n flag_frame_start = False\n flag_change_fro...
[ [ "numpy.round", "numpy.uint8" ] ]
sapan-ostic/deep_prediction
[ "e4709e4a66477755e6afe39849597ae1e3e969b5" ]
[ "scripts/sgan/losses.py" ]
[ "import torch\nimport random\n\n\ndef bce_loss(input, target):\n \"\"\"\n Numerically stable version of the binary cross-entropy loss function.\n As per https://github.com/pytorch/pytorch/issues/751\n See the TensorFlow docs for a derivation of this formula:\n https://www.tensorflow.org/api_docs/pyth...
[ [ "torch.zeros_like", "torch.numel", "torch.ones_like", "torch.sum" ] ]
yazanobeidi/sentience
[ "f0556817f4673530719682253a9f140a00fb1d39" ]
[ "src/python/memory/dnc/access_test.py" ]
[ "# Copyright 2017 Google Inc.\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...
[ [ "numpy.random.rand", "numpy.sum", "tensorflow.python.ops.rnn.dynamic_rnn", "numpy.ones", "numpy.random.randn", "tensorflow.test.compute_gradient_error", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.test.main", "tensorflow.global_variables_initializer", "t...
ToBraun/RecLac
[ "0b4edef3322cef6e8d449176f980da3a1a130a68" ]
[ "RECLAC/boxcount.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 18 11:22:17 2021\n\n@author: tobraun\n\"\"\"\n\nimport numpy as np\nimport scipy.stats as stats\nimport scipy.optimize as opt\n\nfrom .recurrence_plot import RP\n\n\nclass Boxcount(RP):\n \n def __init__(self, x, boxes, glide = False...
[ [ "numpy.rot90", "numpy.random.normal", "numpy.array", "numpy.isnan", "scipy.stats.norm.logpdf", "numpy.zeros", "numpy.random.seed", "numpy.sum", "numpy.copy", "numpy.mean", "numpy.where", "numpy.arange", "numpy.log10", "scipy.optimize.minimize", "numpy.va...
rbSparky/umit-hack-backend
[ "a9402d35d07693b78498a2ba2d4ff08fcb6cab44" ]
[ "app.py" ]
[ "import pickle\nfrom flask import Flask, request, jsonify, session\nfrom flask_cors import CORS, cross_origin\nimport sklearn\nfrom sklearn.decomposition import TruncatedSVD\nimport pandas as pd\nimport numpy as np\n\n\nranks = []\napp = Flask(__name__)\ncors = CORS(app)\napp.config['CORS_HEADERS'] = 'Content-Type'...
[ [ "numpy.corrcoef", "sklearn.decomposition.TruncatedSVD", "pandas.DataFrame" ] ]
shrutipulstya/vision
[ "85982ac695e78af80bf59cd9c855e1729b7376f5" ]
[ "torchvision/models/detection/keypoint_rcnn.py" ]
[ "import torch\nfrom torch import nn\n\nfrom torchvision.ops import MultiScaleRoIAlign\n\nfrom ._utils import overwrite_eps\nfrom ..._internally_replaced_utils import load_state_dict_from_url\n\nfrom .faster_rcnn import FasterRCNN\nfrom .backbone_utils import resnet_fpn_backbone, _validate_trainable_layers\n\n\n__al...
[ [ "torch.nn.init.constant_", "torch.nn.init.kaiming_normal_", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
xidonett/pyprojects
[ "004ee23f01681301eeabc1b06f833a7efd7b89b3" ]
[ "odessa_news_scrapper/odessa_news_scrapper.py" ]
[ "from bs4 import BeautifulSoup\r\nimport pandas as pd\r\nimport requests\r\n\r\nclass OdessaNewsScrapper():\r\n \r\n def __init__( self, first_page:int = 1, last_page:int = 2, link:str = \"https://on.od.ua/category/news/2-odessa/page/\", csv_file:str = \"odessa_news.csv\" ) -> None:\r\n \r\n tit...
[ [ "pandas.DataFrame" ] ]
rudrapatel/numba
[ "5111ad5da17f914ca203e67f3026d2c0d890dfbb" ]
[ "numba/tests/test_record_dtype.py" ]
[ "from __future__ import print_function, division, absolute_import\n\nimport sys\n\nimport numpy as np\nimport ctypes\nfrom numba import jit, numpy_support, types\nfrom numba import unittest_support as unittest\nfrom numba.compiler import compile_isolated\nfrom numba.itanium_mangler import mangle_type\nfrom numba.ut...
[ [ "numpy.asarray", "numpy.zeros", "numpy.testing.assert_equal", "numpy.recarray", "numpy.arange", "numpy.dtype" ] ]
kaiogu/rasa
[ "9dadb8058f3a723096dcd96333801ecf11c12780" ]
[ "tests/nlu/featurizers/test_regex_featurizer.py" ]
[ "from typing import Text, List, Any, Tuple\n\nimport numpy as np\nimport pytest\n\nfrom rasa.shared.nlu.training_data.training_data import TrainingData\nfrom rasa.shared.nlu.training_data.message import Message\nfrom rasa.nlu.config import RasaNLUModelConfig\nfrom rasa.nlu.tokenizers.whitespace_tokenizer import Whi...
[ [ "numpy.allclose", "numpy.array" ] ]
lbny/albatros
[ "304889fa2ff96ac573f7e069c7ed2575803bdcf9" ]
[ "scripts/split_train_test.py" ]
[ "\"\"\"\nAuthor: Lucas Bony\n\nSplits train and valid csv\n\"\"\"\nimport os.path as osp\n\nimport argparse\n\nimport numpy as np\nimport pandas as pd\n\nparser: argparse.ArgumentParser = argparse.ArgumentParser()\nparser.add_argument('--train_ratio', type=float, default=0.8)\nparser.add_argument('--valid_ratio', t...
[ [ "pandas.read_csv", "numpy.arange", "numpy.intersect1d" ] ]
aaroexxt/Tacotron
[ "86a0a25d2bc574e7663f7c24c71e3f7d16ce3342" ]
[ "synthesizer.py" ]
[ "import io\nimport numpy as np\nimport tensorflow as tf\nfrom hparams import hparams\nfrom librosa import effects\nfrom models import create_model\nfrom text import text_to_sequence\nfrom util import audio\n\n\nclass Synthesizer:\n def load(self, checkpoint_path, model_name='tacotron'):\n print('Constructing mo...
[ [ "numpy.asarray", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.global_variables_initializer" ] ]
bastianalt/correlation_priors_for_rl
[ "9a98f345ac10e9767d854cd7a9681057a50a9737" ]
[ "simulations/sim_imitation_learning.py" ]
[ "import sys\nsys.path.append('..')\n\nimport numpy as np\nimport os\nimport pickle\nimport matplotlib.pyplot as plt\nimport packages.subgoal.inference as sg\nfrom packages.mdp.gridworld import Gridworld\nfrom packages.mdp.mdp import MDP, policyDivergence, normalizeQ, det2stoch\nfrom packages.policy.exploration impo...
[ [ "numpy.rot90", "numpy.zeros", "numpy.random.seed", "numpy.prod", "numpy.random.random", "numpy.logspace" ] ]
wuyaoyao99/mssdk
[ "9373e1a6d2b6e347319de3890b6a77b48a7e6922" ]
[ "mssdk/index/index_sw.py" ]
[ "# -*- coding:utf-8 -*-\n# /usr/bin/env python\n\"\"\"\nAuthor: Albert King\ndate: 2019/12/6 14:34\ncontact: jindaxiang@163.com\ndesc: 获取申万指数-申万一级\nhttp://www.swsindex.com/IdxMain.aspx\n部分代码要感谢: PKUJson\n\"\"\"\nimport time\nimport json\nimport datetime\n\nimport pandas as pd\nimport requests\nfrom bs4 import Beaut...
[ [ "pandas.DataFrame" ] ]
nikita-astronaut/poliastro
[ "7f675d76da413618f3bcc25317de750d74ea667e" ]
[ "src/poliastro/integrator_params.py" ]
[ "import numpy as np\n\nA = [np.array([]),\n np.array([5.26001519587677318785587544488e-2]),\n np.array([1.97250569845378994544595329183e-2, 5.91751709536136983633785987549e-2]),\n np.array([2.95875854768068491816892993775e-2, 0, 8.87627564304205475450678981324e-2]),\n np.array([2.4136513415926668550...
[ [ "numpy.array" ] ]
mrudula14/incubator-superset
[ "fdc645c1319f4dd72859059bac37327498af731a" ]
[ "tests/core_tests.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "pandas.Timestamp" ] ]
albanie/mcnPyTorch
[ "75d49c597e09f38fea7bea96123b40be9a9c43d5" ]
[ "python/import_pytorch.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# pytorch model importer\n\n# --------------------------------------------------------\n# mcnPyTorch\n# Licensed under The MIT License [see LICENSE.md for details]\n# Copyright (C) 2017 Samuel Albanie\n# --------------------------------------------------------\n\n...
[ [ "numpy.array", "numpy.empty" ] ]
junqi-jiang/mmxai
[ "08ae70a6d443fbdfa92dba6cd285429e85ac851f" ]
[ "web_app/interpretability4mmf/lime_mmf.py" ]
[ "from mmxai.interpretability.classification.lime.lime_multimodal import (\n LimeMultimodalExplainer,\n)\nfrom skimage.segmentation import mark_boundaries\nfrom skimage import img_as_ubyte\nimport numpy as np\nfrom PIL import Image\n\n\ndef lime_multimodal_explain(image_path, text, model, label_to_exp, num_sample...
[ [ "numpy.uint8", "numpy.array" ] ]
ruichen-v/normPredict
[ "9bc5cc03ba255652a79b7712d419c6b27e0a601c" ]
[ "testtf/digit/train_digit.py" ]
[ "\"\"\" Convolutional Neural Network.\nBuild and train a convolutional neural network with TensorFlow.\nThis example is using the MNIST database of handwritten digits\n(http://yann.lecun.com/exdb/mnist/)\nAuthor: Aymeric Damien\nProject: https://github.com/aymericdamien/TensorFlow-Examples/\n\"\"\"\n\nfrom __future...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.reshape", "tensorflow.data.Iterator.from_structure", "numpy.frombuffer", "tensorflow.nn.softmax", "tensorflow.contrib.layers.flatten", "tensorflow.global_variables_initializ...
wraith1995/Exasim
[ "ad475c7066c5bde1a7941e1703650e3a0db34fbb" ]
[ "tests/Euler/naca0012/pdeapp.py" ]
[ "# import external modules\nimport numpy, os\n\n# Add Exasim to Python search path\ncdir = os.getcwd(); ii = cdir.find(\"Exasim\");\nexec(open(cdir[0:(ii+6)] + \"/Installation/setpath.py\").read());\n\n# import internal modules\nimport Preprocessing, Postprocessing, Gencode, Mesh\n\n# Create pde object and mesh obj...
[ [ "numpy.array", "numpy.sin", "numpy.ones", "numpy.arange", "numpy.cos", "numpy.sqrt", "numpy.abs" ] ]
PinkDiamond1/LandBOSSE
[ "1920f8e9be37c91b5d17c774845159a1fa24d5f9" ]
[ "landbosse/tests/model/test_CollectionCost.py" ]
[ "from unittest import TestCase\nimport os\n\nimport pandas as pd\n\nfrom landbosse.model import Cable, Array, ArraySystem\nfrom landbosse.tests.model.test_WeatherDelay import generate_a_year\nfrom landbosse.tests.model.test_filename_functions import landbosse_test_input_dir\n\nimport pytest\n\npd.set_option('displa...
[ [ "pandas.read_csv", "pandas.set_option" ] ]
u6579559/fairseq
[ "0c36db41012c1fbd1dc570ff3ba1f0ef9b830191" ]
[ "fairseq/data/data_utils.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\ntry:\n from collections.abc import Iterable\nexcept ImportError:\n from collections import Iterable\nimport contextlib\nimport...
[ [ "numpy.random.rand", "numpy.random.choice", "numpy.copy", "numpy.min", "numpy.full", "numpy.random.normal", "numpy.random.poisson", "numpy.random.get_state", "numpy.random.randint", "numpy.array", "torch.max", "numpy.random.set_state", "numpy.asarray", "torc...
sonatsen/raven
[ "30764491e7ecaa16de2a4e0ddab3bc9e169e5f95" ]
[ "framework/Steps.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.atleast_1d" ] ]
Chonim/aqicn.org-Crawler
[ "3c47958acea7072b980a235b0e12847ba0349b97" ]
[ "aqlWorld.py" ]
[ "import csv\nimport time\nimport json\nimport requests\nimport numpy as np\nimport gevent.monkey\nimport urllib\nfrom datetime import datetime\nfrom urllib.request import urlopen\n\nstart_time = time.time()\nheader_row = False\ncount = 0\nfile_name = \"dust_result_\" + time.strftime(\"%Y%m%d-%H%M%S\") + \".csv\"\n\...
[ [ "numpy.arange" ] ]
cocoxu/OpenNMT-py
[ "820ad912dda0b5cbe49c53762374deb6bedd1299" ]
[ "tools/extract_embeddings.py" ]
[ "import argparse\n\nimport torch\n\nimport onmt\nimport onmt.model_builder\nimport onmt.inputters as inputters\nimport onmt.opts\n\nfrom onmt.utils.misc import use_gpu\nfrom onmt.utils.logging import init_logger, logger\n\nparser = argparse.ArgumentParser(description='translate.py')\n\nparser.add_argument('-model',...
[ [ "torch.cuda.set_device", "torch.load" ] ]
KevinGetandGive/flurs
[ "d64912a9c90b441de517e8264a7698434384a12d" ]
[ "flurs/recommender/user_knn.py" ]
[ "from ..base import RecommenderMixin\nfrom ..model import UserKNN\n\nimport numpy as np\n\n\nclass UserKNNRecommender(UserKNN, RecommenderMixin):\n\n \"\"\"User k-Nearest-Neighbor (kNN; user-based collaborative filtering) recommender\n\n References\n ----------\n\n - M. Pepagelis et al.\n **Increme...
[ [ "numpy.concatenate", "numpy.abs", "numpy.argsort", "numpy.zeros" ] ]
peter850706/VIPCUP2018
[ "76510531d57ba78e9c2bc364a10db05c4e9d0035" ]
[ "models/densehighres3dnet_multitasking/densehighres3dnet_multitasking.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function\n\nfrom six.moves import range\n\nimport tensorflow as tf\nfrom niftynet.layer import layer_util\nfrom niftynet.layer.activation import ActiLayer\nfrom niftynet.layer.base_layer import TrainableLayer, LayerFromCallable\nfrom niftynet.l...
[ [ "tensorflow.concat", "tensorflow.reshape", "tensorflow.squeeze", "tensorflow.slice", "tensorflow.split" ] ]
dmoebius-dm/prototorch_models
[ "71602bf38a09148eab13d98c9f89589b345ac570" ]
[ "examples/lvqmln_iris.py" ]
[ "\"\"\"LVQMLN example using all four dimensions of the Iris dataset.\"\"\"\n\nimport argparse\n\nimport prototorch as pt\nimport pytorch_lightning as pl\nimport torch\n\n\nclass Backbone(torch.nn.Module):\n def __init__(self, input_size=4, hidden_size=10, latent_size=2):\n super().__init__()\n self...
[ [ "torch.nn.Linear", "torch.utils.data.DataLoader", "torch.nn.Sigmoid" ] ]
jsngalloway/night-trader
[ "520e94e58f99e8670e2dbddf66955a737be9e0d6" ]
[ "night_trader/predictors/lstm/lstm_creator.py" ]
[ "from typing import List, Tuple\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom tensorflow.keras import layers, optimizers\nfrom sklearn.preprocessing import MinMaxScaler\n\n\ndef scaleData(\n paths_to_datasets: List[str], sub_sampling\n) -> Tuple[List[pd.DataFrame], MinMaxScaler]:\n s...
[ [ "numpy.array", "pandas.DataFrame", "tensorflow.keras.Sequential", "tensorflow.keras.layers.Dense", "sklearn.preprocessing.MinMaxScaler", "tensorflow.keras.layers.LSTM", "pandas.read_csv" ] ]
selinozdas/Mona
[ "f1cd3e31f1a607c454566337423cd3e7031c4374" ]
[ "mona.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"selin(1).ipynb\r\n\r\nAutomatically generated by Colaboratory.\r\n\r\nOriginal file is located at\r\n https://colab.research.google.com/drive/17_eVt28SluHB_hQNwNlwvH2KqPftxkh3\r\n\"\"\"\r\n\r\nimport os\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotli...
[ [ "matplotlib.pyplot.subplot", "numpy.array", "sklearn.preprocessing.LabelEncoder", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.ylabel", "sklearn...
murali513/pythonsample
[ "991b61ebdc7b1315a5618c0081ebdb45a217f223" ]
[ "application.py" ]
[ "from flask import request, Flask\nfrom flask_cors import CORS\n\napp = Flask(__name__)\napp.config['DEBUG'] = True\nCORS(app)\n\n# Setup configuration file\nimport configparser\n\nconfig = configparser.ConfigParser()\nconfig.read('api_config.ini')\n\n# Setup logs test\nimport logging\n\nlogging.basicConfig(filenam...
[ [ "tensorflow.expand_dims", "tensorflow.get_default_graph", "tensorflow.Graph", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.GraphDef", "tensorflow.gfile.GFile", "matplotlib.pyplot.figure", "tensorflow.cast", "tensorflow.squeeze", "tensorflow.greater",...
zehengl/ez-cuisine-classifier
[ "ba8f3f6a4bbeb738f75be400aec38ceda0c893ae" ]
[ "try_language_models.py" ]
[ "import json\nimport os\n\nimport pandas as pd\nfrom fastai.text import (\n AWD_LSTM,\n TextClasDataBunch,\n TextLMDataBunch,\n language_model_learner,\n text_classifier_learner,\n)\nfrom sklearn.model_selection import train_test_split\n\n\ndata = \"data\"\nmodel = \"model_fastai\"\n\nif __name__ == ...
[ [ "sklearn.model_selection.train_test_split", "pandas.DataFrame" ] ]
HephaestusProject/pytorch-ReCoSa
[ "eca171582a9021845009ade542cd99c2e5ddf701" ]
[ "train.py" ]
[ "\"\"\"\n This script was made by soeque1 at 24/07/20.\n To implement code for training your model.\n\"\"\"\n\nimport logging\nfrom argparse import ArgumentParser, Namespace\nfrom logging import getLogger\n\nimport pytorch_lightning as pl\nimport torch\nimport torch.nn.functional as F\nfrom pytorch_lightning ...
[ [ "torch.nn.functional.cross_entropy", "torch.cuda.is_available", "torch.exp", "torch.argmax" ] ]
kachiann/QMCSoftware
[ "0ed9da2f10b9ac0004c993c01392b4c86002954c", "0ed9da2f10b9ac0004c993c01392b4c86002954c" ]
[ "qmcpy/integrand/ml_call_options.py", "qmcpy/true_measure/lebesgue.py" ]
[ "from ._integrand import Integrand\nfrom ..discrete_distribution import Sobol\nfrom ..true_measure import Gaussian\nfrom ..util import ParameterError\nfrom numpy import *\nfrom scipy.stats import norm\n\n\nclass MLCallOptions(Integrand):\n \"\"\"\n Various call options from finance using Milstein discretizati...
[ [ "scipy.stats.norm.cdf" ], [ "scipy.stats.norm.pdf", "numpy.array", "scipy.stats.norm.ppf", "numpy.tile", "numpy.isscalar", "numpy.isfinite", "scipy.stats.norm.cdf" ] ]
Addalin/cameranetwork
[ "edb8bfc83ab3cd4be90b8c50d45190d98d91571a" ]
[ "scripts_sunphotometer/analyze_readings.py" ]
[ "##\n## Copyright (C) 2017, Amit Aides, all rights reserved.\n## \n## This file is part of Camera Network\n## (see https://bitbucket.org/amitibo/cameranetwork_git).\n## \n## Redistribution and use in source and binary forms, with or without modification,\n## are permitted provided that the following conditions are ...
[ [ "matplotlib.use", "numpy.array", "numpy.ascontiguousarray", "matplotlib.pyplot.plot", "numpy.mean", "matplotlib.pyplot.figure", "numpy.std", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
qwindelzorf/owon_hds200
[ "1914ca18b30927dc786513cba7758a6ce56df904" ]
[ "hds_stream.py" ]
[ "from typing import Any, Dict, List\nfrom owonHDS import owonHDS\nimport sys\nimport time\nimport re\nimport numpy as np\nimport pyqtgraph as pg\n\nfrom pyqtgraph.Qt import QtCore\n\nCHANNEL_COLORS = {\"CH1\": \"y\", \"CH2\": \"b\"}\n\n\ndef float_from_str(val: str) -> float:\n _prefix = {\n \"p\": 1e-12,...
[ [ "numpy.arange" ] ]
Mrmoore98/hedwig
[ "dc8c2f1f5e6886b9ce9999bbd071bce02cfbbaf1" ]
[ "common/trainers/bert_trainer.py" ]
[ "import datetime\nimport os\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader, RandomSampler, TensorDataset\nfrom tqdm import tqdm\nfrom tqdm import trange\n\nfrom common.evaluators.bert_evaluator import BertEvaluator\nfrom datasets.bert_processors.abstract_processor import c...
[ [ "torch.utils.data.RandomSampler", "torch.argmax", "torch.save", "torch.tensor", "torch.utils.data.DataLoader", "torch.utils.data.TensorDataset" ] ]
anyboby/mbpo
[ "98b75cb4cb13a2640fce1fbe1ddef466b864342e" ]
[ "mbpo/models/bnn.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport os\nimport time\nimport pdb\nimport itertools\nfrom collections import OrderedDict\n\nimport tensorflow as tf\nimport numpy as np\nfrom tqdm import trange\nfrom scipy.io import savemat, loadmat\...
[ [ "tensorflow.exp", "numpy.random.choice", "numpy.set_printoptions", "numpy.tile", "numpy.sort", "tensorflow.add_n", "tensorflow.ConfigProto", "tensorflow.variable_scope", "numpy.random.randint", "tensorflow.nn.softplus", "numpy.arange", "tensorflow.Session", "ten...
acmbo/MarketSimulation
[ "a6f5678f788118c27c8a17abfa494373e3cc2f48" ]
[ "tests/test.py" ]
[ "import unittest\nimport pandas as pd\n\nfrom context import market\nfrom market.Marketactor import marketactor, market_Buyer, market_Seller\n\nclass TestActors(unittest.TestCase):\n\n def test_is_actor(self):\n \n for obj in [marketactor, market_Buyer, market_Seller]:\n \n print('Tes...
[ [ "pandas.DataFrame" ] ]
peteWT/cbm_fia
[ "62de14a9f6ec3bc1d2af4158d0fd747e6531597e" ]
[ "cbm_curves.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom scipy.optimize import curve_fit\n\ndf = pd.read_csv('cabioage.csv')\n\n\ndef beta(data, pred='totage', resp='drybio_bole'):\n pmin = min(data[pred])\n pmax = max(data[pred])\n dmin = min(data[data[pred] == pmin][resp])\n dmax = max(data[data[pred] == pmax][...
[ [ "pandas.read_csv", "numpy.power", "numpy.exp" ] ]
adit-negi/cowin-alerts-app
[ "af34f717ba52677bd78852a0dd37b40ebe244760" ]
[ "alerts/tasks.py" ]
[ "import requests\nimport json\nimport smtplib, ssl\nimport time\nfrom datetime import datetime, timedelta\nfrom .models import *\nfrom django.conf import settings\nfrom django.template import Context\nfrom django.template.loader import render_to_string\nfrom django.core.mail import EmailMultiAlternatives, EmailMess...
[ [ "numpy.asarray", "numpy.random.RandomState" ] ]
hannahbrucemacdonald/molssi_project
[ "49fe030f7cc43638bab4dfd50faa39742aee6900" ]
[ "molssi_project/tests/test_math.py" ]
[ "import pytest\nimport molssi_project as mp\nimport numpy as np\n\n\n@pytest.mark.parametrize('n, answer', [(0, 0.), (1, 1.), (2, 2.), (3, 2.5), (4, 2.667)])\ndef test_euler(n, answer):\n assert (mp.math.euler(n) == pytest.approx(answer,\n abs=2)), 'Euler function for...
[ [ "numpy.random.seed" ] ]
sdgds/dnnbrain
[ "a28ef0dcc20fb16d30a1158f15558a8844827173" ]
[ "dnnbrain/dnn/tests/test_core.py" ]
[ "import os\nimport copy\nimport h5py\nimport pytest\nimport numpy as np\n\nfrom os.path import join as pjoin\nfrom dnnbrain.io import fileio as fio\nfrom dnnbrain.dnn import core as dcore\nfrom dnnbrain.dnn.base import dnn_mask, array_statistic, dnn_fe\n\nDNNBRAIN_TEST = pjoin(os.environ['DNNBRAIN_DATA'], 'test')\n...
[ [ "numpy.concatenate", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.testing.assert_equal", "numpy.testing.assert_almost_equal", "numpy.ones", "numpy.random.randn", "numpy.random.randint", "numpy.arange", "numpy.all" ] ]
yaojin17/adversarial-project
[ "76af16f126ae701fb3a0a83152b37cbec5e7b28f", "76af16f126ae701fb3a0a83152b37cbec5e7b28f" ]
[ "ChangedResnet18.py", "trades_awp_utils.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.nn import Parameter\r\n\r\n\r\nclass CosineLinear(nn.Module):\r\n def __init__(self, in_features, out_features):\r\n super(CosineLinear, self).__init__()\r\n\r\n self.in_features = in_features\r\n self.ou...
[ [ "torch.nn.functional.normalize", "torch.nn.functional.avg_pool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.init.xavier_uniform_", "torch.nn.Conv2d", "torch.nn.functional.relu", "torch.Tensor" ], [ "torch.max", "torch.autograd.Variable", "torch.no_gr...
electricbrainio/hyperopt
[ "68839dc3a82f146aad2307dd2eab33bf6ed5f3cb" ]
[ "hyperopt/mongoexp.py" ]
[ "\"\"\"\nMongodb-based Trials Object\n===========================\n\nComponents involved:\n\n- mongo\n e.g. mongod ...\n\n- driver\n e.g. hyperopt-mongo-search mongo://address bandit_json bandit_algo_json\n\n- worker\n e.g. hyperopt-mongo-worker --loop mongo://address\n\n\nMongo\n=====\n\nMongo (daemon pro...
[ [ "numpy.invert", "numpy.array", "numpy.random.randint", "numpy.random.rand" ] ]
estanislaoledesma/genper
[ "5996b8bc199d8cecc74b7f6d03b67a4c356b4beb" ]
[ "tests/utils/test_file_manager.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport unittest\n\nimport numpy as np\n\nfrom dataloader.image.image import Image\nfrom utils.file_manager import FileManager\n\nROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))\n\n\nclass TestFileManager(unittest.TestCase):\n\...
[ [ "numpy.random.rand" ] ]
notreal1995/once-for-all
[ "be6b47173e8d365e0712bade60a7cc6495e65d8e" ]
[ "ofa/model_zoo.py" ]
[ "# Once for All: Train One Network and Specialize it for Efficient Deployment\n# Han Cai, Chuang Gan, Tianzhe Wang, Zhekai Zhang, Song Han\n# International Conference on Learning Representations (ICLR), 2020.\n\nimport json\nimport torch\nimport torch.nn as nn\n# from layers import *\nfrom ofa.layers import MyModul...
[ [ "torch.squeeze", "torch.nn.ModuleList" ] ]
Build-Week-Airbnb-Optimal-Price-4/Deployment-Test
[ "60a7bd3bbfb890fd771ae1052ecf14ef586d384c" ]
[ "airbnb_api/application.py" ]
[ "\"\"\"Flask App for Predicting Optimal AirBnB prices in Berlin\"\"\"\r\nfrom flask import Flask, jsonify, request\r\nimport numpy as np\r\nimport pandas as pd\r\nimport pickle\r\nfrom joblib import load\r\n# import xgboost as xgb\r\nimport os\r\n\r\n# local import:\r\nfrom .api_function import get_lemmas\r\nfrom d...
[ [ "pandas.DataFrame" ] ]
rainarit/segmentation-benchmark
[ "bbdadf56ed2ff1049e7dd5925f61f524d0440401" ]
[ "semseg/train.py" ]
[ "import datetime\nimport os\nimport time\nimport torch\nimport torch.utils.data\nimport transforms as T\nfrom torch import nn\nimport torchvision\nimport numpy as np\nimport scipy.io\nimport random\nfrom PIL import Image\nimport matplotlib.image as mpimg\nfrom tqdm import tqdm\nfrom coco_utils import get_coco\nimpo...
[ [ "torch.cuda.manual_seed", "torch.utils.data.RandomSampler", "torch.cuda.amp.autocast", "torch.Generator", "numpy.min", "torch.nn.functional.cross_entropy", "torch.load", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.initial_seed", "torch.manual_seed", "torch.t...
linesd/SSGPR
[ "3728bf5aa25334c40955a211aa391a8721839901" ]
[ "test/test_predict.py" ]
[ "import sys\nsys.path.append(\"..\")\nimport numpy as np\nfrom model.ssgpr import SSGPR\nfrom math import floor\n\ndef test_predict():\n np.random.seed(1) # set seed\n precision = 5\n\n # load the data\n data = np.load(\"../data/test_data/test_predict_data.npy\")\n solution = np.load(\"../data/test_...
[ [ "numpy.random.seed", "numpy.load", "numpy.round" ] ]
iitm-sysdl/FuSeConv
[ "04cdf54abfdbf359235d1b4c0848f188b1abbf2d" ]
[ "yet_another_mobilenet_series/common.py" ]
[ "import copy\nimport importlib\nimport logging\nimport math\nimport os\n\nimport torch\nimport torch.distributed as dist\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom utils import distributed as udist\nfrom utils.model_profiling import model_profiling\nfrom utils.config import FLAGS\nfrom utils.meters ...
[ [ "torch.cat", "torch.distributed.all_gather", "torch.cuda.device_count", "torch.tensor", "torch.ones_like", "torch.mean", "torch.nn.DataParallel" ] ]
HARDIntegral/ADHD_Classifier
[ "f86c8eafa78ca241919d12134afe796c665f8021" ]
[ "Data/norm_plot.py" ]
[ "#!/usr/bin/env python3\n\nfrom numpy import linspace\nimport matplotlib.pyplot as plt\nimport scipy.stats as ss\n\nplt.style.use('seaborn') # pretty matplotlib plots\nplt.rcParams['figure.figsize'] = (8,5)\n\ndef plot_normal(data_points,x_range,mu,sigma,color,label):\n \n x = x_range\n y = ss.norm.pdf(x,m...
[ [ "scipy.stats.norm.pdf", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.hist", "matplotlib.pyplot.style.use", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "...
spradius/TensorRT
[ "eb5de99b523c76c2f3ae997855ad86d3a1e86a31" ]
[ "tools/Polygraphy/tests/util/test_util.py" ]
[ "#\n# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.array_equal" ] ]
khangthk/ITK
[ "f3c12edaf9cef07dbc34107e1a8aec9859204116" ]
[ "Modules/Bridge/NumPy/wrapping/test/itkImageMetaDataSetGetItem.py" ]
[ "# ==========================================================================\n#\n# Copyright NumFOCUS\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https:/...
[ [ "numpy.allclose", "numpy.array" ] ]
prasastoadi/tensor2tensor
[ "2e65bf2a4581761396ca0e737bcb2b79e700fee6" ]
[ "tensor2tensor/rl/model_rl_experiment.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir...
[ [ "tensorflow.Summary", "tensorflow.logging.set_verbosity", "tensorflow.expand_dims", "tensorflow.gfile.Copy", "tensorflow.Graph", "tensorflow.gfile.Exists", "tensorflow.Session", "tensorflow.logging.info", "tensorflow.reshape", "tensorflow.map_fn", "tensorflow.app.run", ...
danielschulz/SDV
[ "0a346f09a751490a0b0165ef0c11267604c99646" ]
[ "sdv/constraints/tabular.py" ]
[ "\"\"\"Table constraints.\n\nThis module contains constraints that are evaluated within a single table,\nand which can affect one or more columns at a time, as well as one or more\nrows.\n\nCurrently implemented constraints are:\n\n * CustomConstraint: Simple constraint to be set up by passing the python\n ...
[ [ "numpy.exp" ] ]
xuyannus/Machine-Learning-Collection
[ "425d196e9477dbdbbd7cc0d19d29297571746ab5" ]
[ "ML/Projects/text_generation_babynames/generating_names.py" ]
[ "\"\"\"\nText generation using a character LSTM, specifically we want to\ngenerate new names as inspiration for those having a baby :) \n\nAlthough this is for name generation, the code is general in the\nway that you can just send in any large text file (shakespear text, etc)\nand it will generate it.\n\nProgramme...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.LSTM", "torch.nn.CrossEntropyLoss", "torch.multinomial", "torch.cuda.is_available", "torch.nn.Embedding" ] ]
soufiomario/VideoSuperResolution
[ "82c3347554561ff9dfb5e86d9cf0a55239ca662e" ]
[ "VSR/Backend/TF/Framework/Motion.py" ]
[ "\"\"\"\nCopyright: Wenyi Tang 2017-2018\nAuthor: Wenyi Tang\nEmail: wenyi.tang@intel.com\nCreated Date: Aug 21st 2018\n\nUtility for motion compensation\n\"\"\"\nimport numpy as np\nimport tensorflow as tf\n\n\ndef _grid_norm(width, height, bounds=(-1.0, 1.0)):\n \"\"\"generate a normalized mesh grid\n\n Args:...
[ [ "tensorflow.scatter_nd", "tensorflow.sqrt", "tensorflow.clip_by_value", "tensorflow.stack", "tensorflow.tile", "tensorflow.to_float", "tensorflow.cast", "tensorflow.shape", "tensorflow.transpose", "tensorflow.add_n", "tensorflow.squared_difference", "tensorflow.floo...