repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
1298998/YOLOX-train-your-data
[ "be50386e5cab7614924796bf6b6bde581d14d4aa" ]
[ "train.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport argparse\nimport random\nimport warnings\nfrom loguru import logger\nimport os\nimport torch\nimport torch.backends.cudnn as cudnn\n\nfrom yolox.core import Trainer, launch\nfrom yolox.exp import get_exp\nfro...
[ [ "torch.manual_seed", "torch.cuda.device_count" ] ]
chenkianwee/py3dtileslib
[ "4674518cb870e6c99b378e13f67d3e404611b0a3" ]
[ "py3dtileslib/tile.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom enum import Enum\nfrom abc import ABC, abstractmethod\n\nclass TileContent(ABC):\n\n def __init__(self):\n self.header = None\n self.body = None\n\n def to_array(self):\n self.sync()\n header_arr = self.header.to_array()\n ...
[ [ "numpy.concatenate" ] ]
amanpreetsingh-BE/DeepRL-Protontherapy
[ "09ebcdcf73000b8c4d1876c3c369bd85d76ba455" ]
[ "DeepRL-PT/model/dose_engine/dose_engine.py" ]
[ "import matplotlib.pyplot as plt\nfrom matplotlib.colors import LinearSegmentedColormap\nimport numpy as np\nfrom get_voxel_index import get_voxel_index\nfrom cdirect import cdirect\n\n# Generate stopping power database\nSP_water = np.loadtxt(\"data/SP_water.txt\", 'float', '#', None, None, 8)\nSP_bone = np.loadtxt...
[ [ "numpy.square", "numpy.random.normal", "numpy.array", "matplotlib.pyplot.xlim", "numpy.zeros", "numpy.log", "matplotlib.pyplot.ylim", "numpy.ones", "matplotlib.pyplot.figure", "numpy.loadtxt", "numpy.sqrt", "matplotlib.pyplot.show", "matplotlib.colors.LinearSegm...
Data-Science-in-Mechanical-Engineering/joint_state_dynamics_estimation_HGOs_GPs
[ "5980ad4ec1e94c4a2eeb5829b27effee5e069370" ]
[ "plotting_kalman_rollouts.py" ]
[ "import os\n\nimport numpy as np\nimport pandas as pd\nimport seaborn as sb\nfrom matplotlib import pyplot as plt\n\nfrom observers import dynamics_traj_observer\nfrom utils import RMS, log_multivariate_normal_likelihood, reshape_pt1, \\\n reshape_dim1, interpolate\n\nsb.set_style('whitegrid')\n\n\n# Some useful...
[ [ "numpy.array", "numpy.zeros", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.ylabel", "n...
arcadia-devtools/catboost
[ "697f2c2589301d80a3ed7500631960410124da21" ]
[ "catboost/python-package/catboost/core.py" ]
[ "\nimport sys\nfrom copy import deepcopy\nfrom six import iteritems, string_types, integer_types\nimport os\nimport imp\nfrom collections import Iterable, Sequence, Mapping, MutableMapping\nimport warnings\nimport numpy as np\nimport ctypes\nimport platform\nimport tempfile\nfrom enum import Enum\nfrom operator imp...
[ [ "numpy.array", "numpy.reshape", "numpy.shape", "numpy.mean", "numpy.transpose", "numpy.int32", "numpy.dtype", "numpy.expand_dims" ] ]
gioannides/OpenSeq2Seq
[ "9e13da51eda2d239539cad6a56f8db2bf11492d6" ]
[ "open_seq2seq/decoders/decoder.py" ]
[ "# Copyright (c) 2018 NVIDIA Corporation\nfrom __future__ import absolute_import, division, print_function\nfrom __future__ import unicode_literals\n\nimport abc\nimport copy\n\nimport six\nimport tensorflow as tf\n\nfrom open_seq2seq.optimizers.mp_wrapper import mp_regularizer_wrapper\nfrom open_seq2seq.utils.util...
[ [ "tensorflow.variable_scope" ] ]
shantanutyagi67/CT303_Labs
[ "f1303cd9e8665dccfd1a60b07e3ac2713dff8a47" ]
[ "Lab 1/py files/1.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\ndef mysinplot(f, fs, n):\n x = np.linspace(-n/(2*f),n/(2*f),fs*n)\n plt.stem(x,np.sin(2*np.pi*f*x))\n plt.title('Sine Wave')\n plt.xlabel('Time')\n plt.ylabel('Amplitude')\n plt.grid(True, which='both')\n plt.show()\n\nwave_frequency = int...
[ [ "numpy.sin", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspace" ] ]
ulisespereira/map-ephys
[ "ff8293346232c973d86198621b9a901b0d25f7ab" ]
[ "pipeline/fixes/fix_0008_ingest_peak_chn_waveform.py" ]
[ "#! /usr/bin/env python\n\nimport os\nimport logging\nimport pathlib\nfrom datetime import datetime\nfrom os import path\n\nfrom glob import glob\nfrom tqdm import tqdm\nimport re\nfrom itertools import repeat\nimport pandas as pd\n\nimport scipy.io as spio\nimport h5py\nimport numpy as np\n\nimport datajoint as dj...
[ [ "numpy.load", "numpy.min", "numpy.where", "numpy.nanmean", "pandas.read_csv", "numpy.full_like", "numpy.max", "numpy.full", "numpy.logical_and", "numpy.in1d", "numpy.array", "numpy.matmul", "numpy.reshape", "numpy.round", "numpy.random.shuffle", "num...
ttungl/RLE-NOC
[ "77efb941ff8b9ddb24b5888a41748b3987e5394c" ]
[ "interconnect-routing-gym/example/Baseline_xyRouting_example.py" ]
[ "##\n# Author: Tung Thanh Le \n# ttungl@gmail.com\n##\n\nimport random\nimport os\nfrom collections import defaultdict, deque\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib\nmatplotlib.use('agg')\nimport matplotlib.pyplot as plt\nimport csv\nfrom icn_gym import *\n\n# from icn_gym import icn_routi...
[ [ "matplotlib.use", "numpy.savetxt", "matplotlib.rcdefaults", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.rcParams.update", "matplotlib.pyplot.ylabel" ] ]
m4r1vs/ehre-oder-mgn
[ "8e3b5ffb4c03c2ee6943aa8e78189deeebda5c4d" ]
[ "label_image.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.image.resize_bilinear", "tensorflow.expand_dims", "tensorflow.read_file", "tensorflow.Graph", "tensorflow.GraphDef", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.subtract", "tensorflow.gfile.GFile", "numpy.squeeze", "tensorflow.image.deco...
sumner-harris/SciFiReaders
[ "4494b7e7350ad2a6198c87590d193393566ad470" ]
[ "examples/plot_example_reader.py" ]
[ "\"\"\"\n=================\nCreating a Reader\n=================\n\n**Suhas Somnath**\n\n8/28/2020\n\nThis document illustrates an example of extracting data out of proprietary raw\ndata files, thereby describing how one would write a ``sidpy.Reader`` class.\n\nThe captured information would be populated into a / s...
[ [ "numpy.array", "numpy.linspace", "numpy.zeros" ] ]
HitAgain/Machine-Learning-practice
[ "85fc1ea4bead825e5033b8db737c1a1150ded40b" ]
[ "Least_Suqare_Method/Lsq_no_regular.py" ]
[ "import numpy as np\nimport scipy as sp\nfrom scipy.optimize import leastsq\nimport matplotlib.pyplot as plt\ndef real_fun(x):\n return np.sin(2*np.pi*x)\n\ndef fit_fun(p,x):\n f = np.poly1d(p)\n return f(x)\n\ndef res_fun(p,x,y_real):\n ret = fit_fun(p, x)-y_real\n return ret\ndef res_fun_addregular...
[ [ "numpy.square", "numpy.random.normal", "numpy.sin", "numpy.random.rand", "matplotlib.pyplot.plot", "scipy.optimize.leastsq", "numpy.poly1d", "matplotlib.pyplot.show", "numpy.linspace" ] ]
jacobmunson/lenskit_confidence
[ "2c06d81539b0a7697014e3b7164ea64695e687d5" ]
[ "lenskit/algorithms_ca/tf/biasedmf.py" ]
[ "import logging\n\ntry:\n import tensorflow as tf\n import tensorflow.keras as k\nexcept ImportError:\n tf = None\n\nfrom lenskit import util\nfrom ..mf_common import MFPredictor\nfrom ..bias import Bias\nfrom .util import init_tf_rng, check_tensorflow\n\n_log = logging.getLogger(__name__)\n\n\nclass Biase...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Embedding", "tensorflow.keras.Model", "tensorflow.keras.regularizers.l2", "tensorflow.keras.layers.Dot", "tensorflow.keras.Input" ] ]
Hattyoriiiiiii/snippets
[ "ecf44f9b226b2c483e1e45b6a37749c858675762" ]
[ "ds/ml/regression_multiple_linear.py" ]
[ "from sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.preprocessing import StandardScaler\nimport pandas as pd\n\nX = df.drop('target', axis=1)\ny = df.target\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=7)\n\...
[ [ "sklearn.model_selection.train_test_split", "pandas.Series", "sklearn.linear_model.LinearRegression", "sklearn.preprocessing.StandardScaler" ] ]
avinashsai/allennlp
[ "6da30e9d53bd2c8199848addc78ff0e29d79b542" ]
[ "allennlp/tests/training/learning_rate_schedulers/cosine_test.py" ]
[ "from typing import Dict, Any\n\nimport torch\n\nfrom allennlp.training.optimizers import Optimizer\nfrom allennlp.common.testing import AllenNlpTestCase\nfrom allennlp.training.learning_rate_schedulers import LearningRateScheduler\nfrom allennlp.common.params import Params\n\n\nclass CosineWithRestartsTest(AllenNl...
[ [ "torch.nn.Linear" ] ]
brain-research/flying-shapes
[ "e9a63576c92f3e1f7ae4933596977ded04b962ad" ]
[ "train.py" ]
[ "# Copyright 2018 Google LLC\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# https://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to i...
[ [ "tensorflow.contrib.rnn.BasicLSTMCell", "tensorflow.matmul", "tensorflow.contrib.rnn.ConvLSTMCell", "matplotlib.pyplot.gcf", "tensorflow.stack", "matplotlib.patches.Rectangle", "tensorflow.global_variables_initializer", "tensorflow.random_uniform", "tensorflow.train.Saver", ...
yezhengkai/shocktube1dcalc
[ "50fb3aaf37052b494fc60bcb8540eca3fbb9ce72" ]
[ "contrib/show-cese-animation.py" ]
[ "#!/usr/bin/env python\n# Usage:\n# ./run-animation.py\n#\n# Description:\n# An example to show the iteration animation\nimport matplotlib.animation as animation\nimport matplotlib.pyplot as plt\n\nimport shocktube1dcalc.cese as cese\nimport shocktube1dcalc.helper_plot as helper_plot\n\nfig = plt.figure()\n...
[ [ "matplotlib.animation.ArtistAnimation", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
bmorris3/rem
[ "be758a989fba62eac2a24bc201e855ee08173b47" ]
[ "toolkit/pca.py" ]
[ "import astropy.units as u\nimport numpy as np\nfrom astropy.time import Time\nfrom matplotlib import pyplot as plt\nfrom sklearn.decomposition import PCA\nfrom astropy.stats import mad_std\n\nfrom .regression import regression_coeffs, regression_model\n\n__all__ = ['PCA_light_curve']\n\n\ndef PCA_light_curve(pr, t...
[ [ "numpy.ones_like", "numpy.argmin", "numpy.median", "numpy.min", "numpy.zeros_like", "numpy.count_nonzero", "numpy.arange", "sklearn.decomposition.PCA", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.axvline", "matplotlib.pyplot.show", ...
guoyijie/SPTM
[ "21b4a3854b4acab363cb64118358c50739555b84" ]
[ "src/train/train_setup.py" ]
[ "import sys\nsys.path.append('..')\nsys.path.append('../common/')\nfrom common import *\n\n# limit memory usage\nimport tensorflow as tf\nfrom keras.backend.tensorflow_backend import set_session\nconfig = tf.ConfigProto()\nconfig.gpu_options.per_process_gpu_memory_fraction = TRAIN_MEMORY_FRACTION\nset_session(tf.Se...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
Electrostatics/osmolytes
[ "9f4ab639916bca5e1bf7e2244b0b4ed0e3560212" ]
[ "tests/test_pqr.py" ]
[ "\"\"\"Test PQR parsing.\"\"\"\nimport logging\nimport pytest\nfrom pathlib import Path\nimport yaml\nimport numpy as np\nimport pandas as pd\nfrom osmolytes.pqr import parse_pqr_file, count_residues\n\n\n_LOGGER = logging.getLogger(__name__)\nPQR_DATA = [\n [\"ATOM\", 1, \"N\", \"MET\", \"1\", -22.600, 7.684, -...
[ [ "numpy.testing.assert_almost_equal", "pandas.DataFrame", "numpy.array", "numpy.testing.assert_equal" ] ]
RImbriaco/OML
[ "4998cdebc3ac553ccd53b4caacf24d8c3d8fc07b" ]
[ "src/retrieval_core/models/pooling/pool_factory.py" ]
[ "from torch import nn\nfrom src.retrieval_core.models.pooling.GeM import GeM\n\n\nclass PoolFactory(nn.Module):\n def __init__(self, pool='max'):\n super(PoolFactory, self).__init__()\n\n pool_type = {\n 'avg': nn.AdaptiveAvgPool2d(1),\n 'max': nn.AdaptiveMaxPool2d(1),\n ...
[ [ "torch.nn.AdaptiveAvgPool2d", "torch.nn.AdaptiveMaxPool2d" ] ]
openvax/varcode
[ "a51a7dd0868ef05aee4962e66a9226ab70935a3d" ]
[ "test/test_cli_genes.py" ]
[ "from varcode.cli.genes_script import main as run_script\nfrom .data import ov_wustle_variants, db_snp_variants\n\nfrom tempfile import NamedTemporaryFile\nimport pandas as pd\n\n\ndef test_varcode_effects_script():\n \"\"\"\n Load a variant collection with combines the ovarian cancer test VCF\n and a smal...
[ [ "pandas.read_csv" ] ]
zbaoye/progressive_growing_of_gans_tensorflow
[ "0f77d9c749dd31ce03b104dc2d355267e3ced038" ]
[ "csgm/celebA_dcgan/ops.py" ]
[ "\"\"\"Ops used in the DCGAN model\nFile based on : https://github.com/carpedm20/DCGAN-tensorflow/blob/master/ops.py\nIt comes with the following license: https://github.com/carpedm20/DCGAN-tensorflow/blob/master/LICENSE\n\"\"\"\n# pylint: disable = C0103, C0111, C0301, R0913, R0903\n\nimport tensorflow as tf\n\ncl...
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.matmul", "tensorflow.ones", "tensorflow.nn.conv2d_transpose", "tensorflow.variable_scope", "tensorflow.truncated_normal_initializer", "tensorflow.maximum", "tensor...
Chelgan/st-gcn
[ "ea0aef5cf0b85d60215301eb4ee50c67f8115fb7" ]
[ "net/st_gcn.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nfrom net.utils.tgcn import ConvTemporalGraphical\nfrom net.utils.graph import Graph\n\nclass Model(nn.Module):\n r\"\"\"Spatial temporal graph convolutional networks.\n\n Args:\n in_channels (i...
[ [ "torch.nn.Dropout", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.tensor" ] ]
pbcanfield/ASCT
[ "27dba80c612c844971c545a1af0758272900f8c7" ]
[ "asct/src/Cell.py" ]
[ "from abc import abstractmethod\nfrom neuron import h\nimport matplotlib.pyplot as plt\nfrom scipy import signal\n\n#This is the base class for all cell wrapper objects reqiured for ASCT to run.\nclass Cell:\n\n #Constructs a Cell object.\n #Takes:\n # 1) The HOC template directory.\n # 2) The HOC o...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
ishmamt/Hierarchical-Co-attention-VQA
[ "94bd51e7c369bd9fa6d51eaceb1f621cb91fef62" ]
[ "vqa_dataset.py" ]
[ "import os\nimport numpy as np\nimport errno\nimport operator\nimport pickle\nfrom collections import defaultdict\nfrom statistics import mode\nimport torch\nfrom torch.utils.data import Dataset\nfrom torchvision import transforms\nfrom vqa import VQA\nfrom image_dataset import get_image_ids, get_image_names, load_...
[ [ "numpy.array" ] ]
seanngpack/swag-scanner
[ "8932e4823e7edd570cbb063702ef4be335d12881" ]
[ "swagscanner/scanner/sr305.py" ]
[ "import numpy as np\nimport pyrealsense2 as rs\nimport pcl\nfrom swagscanner.scanner.camera import Camera\n\n\nclass SR305(Camera):\n '''Camera object\n\n '''\n\n def __init__(self):\n # Configure depth stream\n self.pipeline = rs.pipeline()\n self.config = rs.config()\n self.co...
[ [ "numpy.asarray" ] ]
Angericky/KPConv
[ "d6d8d8273771e415d73c0b5e140c427478daa5bb" ]
[ "utils/visualizer.py" ]
[ "#\n#\n# 0=================================0\n# | Kernel Point Convolutions |\n# 0=================================0\n#\n#\n# ----------------------------------------------------------------------------------------------------------------------\n#\n# Class handling the visualization\n#\n# ...
[ [ "numpy.ones_like", "numpy.random.rand", "numpy.load", "numpy.tile", "numpy.min", "numpy.where", "tensorflow.zeros_like", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorflow.global_variables_initializer", "tensorflow.identity", "tensorflow.train.G...
mamaheux/pytorch-exemple-calcul-canada
[ "41bd1769aaf30bd3786589bd3e3252bb115fdd69" ]
[ "models/vanilla_cnn.py" ]
[ "import torch.nn as nn\n\nfrom models.blocks import GlobalAvgPool2d\n\n\nclass _VanillaConvBlock(nn.Module):\n def __init__(self, in_channels, out_channels, kernel_size):\n super(_VanillaConvBlock, self).__init__()\n\n self._block = nn.Sequential(\n nn.Conv2d(in_channels, out_channels, k...
[ [ "torch.nn.Softmax", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
liveseongho/DramaQA
[ "09470a8c29dcdbcef077fcddfc9f0bb8331f5da4" ]
[ "model/model.py" ]
[ "\"\"\"\n Multi-level Context Matching code\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom base import BaseModel\n\nfrom . rnn import RNNEncoder, max_along_time, mean_along_time\nfrom . modules import ContextMatching\n\n\nclass MCM(BaseModel):\n def __init__(self, pt_emb, **k...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.stack", "torch.nn.Softmax", "torch.nn.Conv1d", "torch.arange", "torch.from_numpy", "torch.randn", "torch.nn.functional.softmax", "torch.matmul", "torch.nn.Embedding", "torch.sum" ] ]
Vonderland/Knover
[ "73815ed6f91a301674001a8d29f3a0356e627ea6" ]
[ "knover/utils/tensor_utils.py" ]
[ "# Copyright (c) 2020 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.concatenate", "numpy.array" ] ]
Wang-Jinghui/python-for-data-Analysis
[ "a170f34196a631d88d598a9d9fe162b8c1bb8b72" ]
[ "passenger/code/show_kmeans_culster.py" ]
[ "#-*- coding:utf-8 -*-\nimport pandas as pd\nfilename = '../subset/classifision_data.xls'\ndata = pd.read_excel(filename)\nr = data[[u'聚类类别']]\ndata = data[['R','F','M','C','L']]\nout_fig = '../figures/'\ndef fig_plot(data,title): #自定义作图函数\n import matplotlib.pyplot as plt\n\n plt.rcParams['font.sans-serif'] = ...
[ [ "pandas.read_excel" ] ]
srogers47/Automated-Reporting
[ "de0125627dfb4541fcfcd3b00cd8570a94a4d88f" ]
[ "data-sources/test.py" ]
[ "import asyncio\nimport aiohttp\nimport bs4 \nimport pandas as pd \nimport json\nfrom datetime import datetime\nimport csv\n\nclass Main:\n \"\"\"\n Get real time quotes on Fortune 100 companies or whatever tickers populate symlist.csv.\n Output data points to MS SQL-Server \n \"\"\"\n # Without hea...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
vidalgp/AFVO_RayTrace
[ "af038995602a91f7bd02157a2fa030ab2673b255" ]
[ "main/wedgemodel.py" ]
[ "import numpy as np\nfrom seisig import* \n\ndef create_timewedgeModel(seismic, model, dtc, Theta, Beta, tBottom, tTop, wedgeAngle, Q=False):\n print('\\n\\n Cálculos del modelo de cuña sintético\\n\\n')\n FreqVel = model.vp[0]\n for z in range(seismic.zLen):\n print(('CDP #{} de {}').format(z+1, se...
[ [ "numpy.array", "numpy.delete", "numpy.ceil", "numpy.sin", "numpy.zeros", "numpy.isnan", "numpy.arcsin", "numpy.tan", "numpy.ones", "numpy.radians", "numpy.where", "numpy.arctan", "numpy.arange", "numpy.cos", "numpy.append", "numpy.linspace", "num...
andylucny/On-Lindenmayer-Systems-and-Autoencoders
[ "2a347d43c175291da3bd048a09f5134a6738d78c" ]
[ "decoder-perceptron.py" ]
[ "import numpy as np\nfrom keras.layers import Input, Dense\nfrom keras.models import Model\n\ndataset_size = 1498\n \ncodes = []\npath = 'encoder/rose'\nfor id in range(dataset_size):\n code = np.loadtxt(path+'{:04d}.txt'.format(id))\n codes.append(code)\n #code = np.loadtxt(path+'{:04d}v.txt'.format(id...
[ [ "numpy.stack" ] ]
mchoi8739/incubator-mxnet
[ "cff583250479b31c394f568ffb835b720cb84dc4", "cff583250479b31c394f568ffb835b720cb84dc4", "cff583250479b31c394f568ffb835b720cb84dc4", "cff583250479b31c394f568ffb835b720cb84dc4" ]
[ "example/cnn_text_classification/text_cnn.py", "example/deep-embedded-clustering/solver.py", "python/mxnet/contrib/quantization.py", "tests/python/unittest/test_image.py" ]
[ "#!/usr/bin/env python\n\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2....
[ [ "numpy.random.seed", "numpy.reshape" ], [ "numpy.fabs" ], [ "numpy.max", "numpy.histogram", "numpy.min" ], [ "numpy.array", "numpy.random.rand", "numpy.random.randint", "numpy.hstack", "numpy.linspace", "numpy.expand_dims" ] ]
recti/K_anonymity
[ "bbeeaf6cee541aac1e0c2a92f8b64164d187f70f" ]
[ "k_anonimity.py" ]
[ "import pandas as pd\nimport matplotlib.pylab as pl \nimport matplotlib.patches as patches \n\n\nnames = (\n\n 'age',\n 'workclass',#Private, Self-emp-not-inc, Self-emp-inc,Federal-gov, Local-gov, State-gov, Without-pay, Never-worked.\n 'fnlwgt',# \"weight\" of that person in the dataset (i.e. how many peo...
[ [ "matplotlib.patches.Rectangle", "pandas.DataFrame", "matplotlib.pylab.show", "matplotlib.pylab.figure", "matplotlib.pylab.subplot", "pandas.read_csv", "matplotlib.pylab.scatter" ] ]
jennysheng14/3CL_protease_DMS
[ "13d1ecd39260d01ee0826970ab19b27de44d814e" ]
[ "one_rep_no_syn.py" ]
[ "#!/Users/jennysheng/anaconda3/envs/tools/bin/python\n\nimport sys\nimport os\nimport glob\nimport numpy as np\nimport pandas as pd\nimport gzip\nimport matplotlib.pyplot as plt\nfrom scipy import stats\nfrom scipy.optimize import curve_fit\nimport itertools\nfrom collections import Counter\nfrom Bio.Seq import Seq...
[ [ "pandas.DataFrame", "numpy.log2", "pandas.concat" ] ]
karllark/hst_smc_ext
[ "f6043e502ed19b21389ab2c285f17830a0cdc1fe" ]
[ "Figs/plot_smc_2panel.py" ]
[ "import matplotlib.pyplot as pyplot\nimport matplotlib.gridspec as gridspec\nimport argparse\nimport matplotlib\n\nfrom plot_extinction import plot_ext_stack\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n parser.add_argument(\"--png\", help=\"save figure as a png file\", action=\"store...
[ [ "matplotlib.pyplot.subplots", "matplotlib.rc", "matplotlib.pyplot.show", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.subplot" ] ]
ryok/brain-tokyo-workshop
[ "b9a0569bcef77e43306c8a390e86768f38c613e9" ]
[ "es-clip/es_bitmap.py" ]
[ "#!/usr/bin/env python3\n\nimport os\n\nos.environ['OPENBLAS_NUM_THREADS'] = '1'\nos.environ['OMP_NUM_THREADS'] = '1'\n\nimport argparse\nimport cProfile\nimport json\nimport multiprocessing as mp\nimport os\nimport re\nimport wandb\n\nimport numpy as np\nfrom PIL import Image\nfrom pgpelib import PGPE\n\nfrom util...
[ [ "numpy.abs", "numpy.mean" ] ]
nens/dask-geomodeling
[ "9d929c7e708e90bc89109b72db6ed76c8fbae38a" ]
[ "dask_geomodeling/measurements.py" ]
[ "\"\"\"\nModule providing a percentile function analogous to the functions provided by\nscipy.ndimage.measurements.\n\"\"\"\n\nimport numpy as np\n\n\ndef _safely_castable_to_int(dt):\n \"\"\"Test whether the numpy data type `dt` can be safely cast to an int.\"\"\"\n int_size = np.dtype(int).itemsize\n saf...
[ [ "numpy.broadcast_arrays", "numpy.percentile", "numpy.int64", "numpy.isscalar", "numpy.unique", "numpy.searchsorted", "numpy.issubdtype", "numpy.asanyarray", "numpy.dtype" ] ]
pengzhi1998/ml-agents
[ "9c4d2de4264dd251a5b714936a93b142d398e2bf" ]
[ "ml-agents/mlagents/trainers/tests/simple_test_envs.py" ]
[ "import random\nfrom typing import Dict, List, Any, Tuple\nimport numpy as np\n\nfrom mlagents_envs.base_env import (\n ActionSpec,\n ObservationSpec,\n ObservationType,\n ActionTuple,\n BaseEnv,\n BehaviorSpec,\n DecisionSteps,\n TerminalSteps,\n BehaviorMapping,\n)\nfrom mlagents_envs.t...
[ [ "numpy.concatenate", "numpy.array", "numpy.ones", "numpy.expand_dims" ] ]
Giotje/openpilot
[ "1c29b20e72141c2beae6e32cf87dabded3095fda" ]
[ "selfdrive/test/test_onroad.py" ]
[ "#!/usr/bin/env python3\nimport json\nimport os\nimport subprocess\nimport time\nimport numpy as np\nimport unittest\nfrom collections import Counter\nfrom pathlib import Path\n\nfrom cereal import car\nimport cereal.messaging as messaging\nfrom cereal.services import service_list\nfrom common.basedir import BASEDI...
[ [ "numpy.max", "numpy.min", "numpy.mean", "numpy.diff", "numpy.std" ] ]
Qiza-lyhm/mmcv_on_mlu
[ "faa348c6e4083c858a855246b1218a6a4d23014e" ]
[ "mmcv/parallel/_functions.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nfrom torch.nn.parallel._functions import _get_stream\n\n\ndef scatter(input, devices, streams=None):\n \"\"\"Scatters tensor across multiple GPUs.\"\"\"\n if streams is None:\n streams = [None] * len(devices)\n\n if isinstance(input, li...
[ [ "torch.cuda.current_stream", "torch.cuda.device", "torch.is_mlu_available", "torch.cuda.stream", "torch.nn.parallel._functions._get_stream" ] ]
Northrend/snca.pytorch
[ "2165d54a91231e2643c015a723539fd5d91089e7" ]
[ "cifar.py" ]
[ "'''Train CIFAR10 with PyTorch.'''\nfrom __future__ import print_function\n\nimport sys\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport os\nimport arg...
[ [ "torch.save", "torch.cuda.device_count", "torch.cuda.is_available", "torch.LongTensor", "torch.utils.data.DataLoader", "torch.load" ] ]
xhuan28/MNN
[ "81df3a48d79cbc0b75251d12934345948866f7be" ]
[ "pymnn/examples/MNNTrain/mobilenet_finetune/mobilenet_transfer.py" ]
[ "from __future__ import print_function\nimport time\nimport argparse\nimport numpy as np\nfrom finetune_dataset import FinetuneDataset\nimport MNN\nnn = MNN.nn\nF = MNN.expr\n\n\ndef load_feature_extractor(model_file):\n var_dict = F.load_as_dict(model_file)\n input_var = var_dict['input']\n output_var = v...
[ [ "numpy.sum" ] ]
AnirudhSreeram/deepspeech.pytorch_aws
[ "2a146ada962dd28d47e4d4b6b4c85fb2c3792418" ]
[ "freq_masking.py" ]
[ "import random\nimport torch\nfrom math import exp\nfrom torch.fft import rfft, irfft\nimport numpy as np\nfrom scipy.signal import find_peaks\nfrom scipy.signal.windows import hamming\n#from audio import loadAudio, saveAudio\nfrom sys import exit\nfrom pdb import set_trace as bp\nimport librosa\nimport time\n\nEPS...
[ [ "scipy.signal.windows.hamming", "numpy.max", "numpy.zeros_like", "numpy.array", "numpy.zeros", "torch.fft.irfft", "numpy.round", "numpy.ones", "torch.fft.rfft", "torch.from_numpy", "torch.abs", "torch.DoubleTensor", "torch.log10", "numpy.sqrt", "torch.Te...
CGCL-codes/HierGAT
[ "df0353e589a00b2b9ac6c8eae87396233fe850ee" ]
[ "model/cmodel.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom transformers import BertModel\n\nfrom .layer import AttentionLayer as AL, GlobalAttentionLayer as GoAL, \\\n StructAttentionLayer as SAL, ResAttentionLayer as RAL, ContAttentionLayer as CAL\nfrom .dataset import get_lm_path\n\n\nclass Tr...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.stack", "torch.nn.Softmax", "torch.no_grad", "torch.matmul" ] ]
ahshale/keras-retinanet
[ "a8b325e83d10a3d2814bf03c65ec4258111eae59" ]
[ "keras_retinanet/bin/train.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless ...
[ [ "tensorflow.ConfigProto", "tensorflow.Session", "tensorflow.device" ] ]
jlim13/lifelines
[ "f2951143fcecb1064388c97898fee13da5c0bcc9" ]
[ "lifelines/tests/test_plotting.py" ]
[ "# -*- coding: utf-8 -*-\nimport os\nimport pytest\nimport pandas as pd\nimport numpy as np\nimport scipy\n\nfrom lifelines import (\n NelsonAalenFitter,\n KaplanMeierFitter,\n CoxPHFitter,\n CoxTimeVaryingFitter,\n AalenAdditiveFitter,\n WeibullFitter,\n LogNormalFitter,\n LogLogisticFitter...
[ [ "numpy.ones_like", "numpy.random.choice", "numpy.random.rand", "numpy.minimum", "numpy.random.exponential", "numpy.exp", "numpy.logspace", "numpy.random.binomial", "pandas.DataFrame", "numpy.random.randint", "numpy.arange", "numpy.sqrt", "matplotlib.pyplot.subpl...
APMplusplus/falkon
[ "95708ed0b28c4ec0f611446a478e9c3445eb3508" ]
[ "tasks/speech/antispoofing/baseline/local/seq_models/utils.py" ]
[ "from sklearn.metrics import *\nimport torch\nimport numpy as np\nfrom keras.utils import to_categorical\nimport sys\n\n# Utility to return predictions\ndef return_classes(logits, dim=-1):\n #print(logits.shape)\n _, predicted = torch.max(logits,dim) \n #print(predicted.shape)\n return predicted \n\ndef ...
[ [ "torch.FloatTensor", "numpy.absolute", "torch.max" ] ]
noamzilo/deep-head-pose
[ "31969b8cbeeea5423ab7d326945f7871c5aed57e" ]
[ "code/original_code_augmented/datasets.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\n\nimport torch\nfrom torch.utils.data.dataset import Dataset\n\nfrom PIL import Image, ImageFilter\n\nfrom Utils import utils\nimport random\nimport posixpath\n\n\ndef get_list_from_filenames(file_path):\n # input: relative path to .txt file with file names...
[ [ "numpy.array", "torch.FloatTensor", "numpy.random.random_sample", "numpy.digitize", "torch.LongTensor", "numpy.transpose", "numpy.random.randint", "numpy.arctan2", "numpy.sqrt", "pandas.read_csv" ] ]
secsilm/mosec
[ "89b7d8e6c763b22dcf49dad4ace3796e3ffccb0a" ]
[ "examples/distil_bert_server_pytorch.py" ]
[ "import logging\nfrom typing import List, TypeVar\n\nimport torch # type: ignore\nfrom transformers import ( # type: ignore\n AutoModelForSequenceClassification,\n AutoTokenizer,\n)\n\nfrom mosec import Server, Worker\n\nT = TypeVar(\"T\")\n\nlogger = logging.getLogger()\nlogger.setLevel(logging.DEBUG)\nfor...
[ [ "torch.device", "torch.nn.utils.rnn.pad_sequence", "torch.no_grad", "torch.cuda.is_available", "torch.tensor" ] ]
ZebinYang/SeqMM
[ "ed5105d2536fdc1c06158a4aaa98647d9874c446" ]
[ "sequd/pybatdoe/batch_grid.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom joblib import Parallel\nfrom joblib import delayed\nfrom itertools import product\nfrom tqdm import tqdm_notebook as tqdm\n\nfrom .batch_base import BatchBase\n\n\nclass GridSearch(BatchBase):\n \"\"\"\n Implementation of grid search.\n\n\n Parameters\n ---...
[ [ "pandas.DataFrame", "numpy.ceil", "numpy.array", "numpy.linspace" ] ]
qgallouedec/deep_rl
[ "33d1138939173bc5dddd1a4b03824f7c18dabbfe" ]
[ "deep_rl/utils.py" ]
[ "import numpy as np\n\n\ndef results_to_dat(timesteps, results, filename=\"results.dat\"):\n \"\"\"Generate a .dat with 4 columns : timestep, median value, low and high quantile value.\n\n Args:\n timesteps (list): Timesteps.\n results (list[list]): The the results from multiple experiences.\n ...
[ [ "numpy.quantile", "numpy.array", "numpy.savetxt", "numpy.median", "numpy.random.randn", "numpy.arange", "numpy.vstack" ] ]
pragupta/horovod
[ "7d7a9df9ffb77a121030207f1659ec6c9afaa8ed" ]
[ "horovod/torch/__init__.py" ]
[ "# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.\n# Modifications copyright Microsoft\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/l...
[ [ "torch.IntTensor", "torch.is_tensor", "torch.cuda.is_available", "torch.zeros_like", "torch.Tensor" ] ]
clematologie/COVID19
[ "0ccea2136ada0534a71db675d47c9e1feaaa7943" ]
[ "src/pdf_creation/daily_pdf.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 17 12:33:39 2021\n\n@author: Clement\n\"\"\"\nimport pandas\nimport PyPDF2\nimport os\nimport sys\nimport docx\nfrom docxtpl import DocxTemplate\nfrom docx2pdf import convert\n\nsys.path.append(os.path.dirname(os.path.dirname(os.path.real...
[ [ "pandas.to_datetime" ] ]
liutongyu0304/smartnet
[ "6c720165d3222366864163b39f0e2ba7db64253f" ]
[ "tests/net_test.py" ]
[ "import smartnet as sn\nimport smartnet.layers as layer\nimport smartnet.optims as optim\nimport numpy as np\nimport unittest\n\n\nclass SmartNetTest(unittest.TestCase):\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n\n @classmethod\n def setUpClass(cls):\n nsamples = 100...
[ [ "torch.nn.Linear", "numpy.linalg.norm", "numpy.random.rand", "torch.nn.MSELoss", "torch.nn.Sigmoid", "numpy.ones", "torch.nn.ReLU", "torch.Tensor" ] ]
rriyaldhi/flexinfer
[ "523b9bf49226001c0477a3635ffe9071387ae788" ]
[ "flexinfer/postprocess/obj_det/meshgrids/point_anchor_meshgrid.py" ]
[ "import torch\n\nfrom flexinfer.misc import registry\nfrom .base_meshgrid import BaseMeshGrid\n\n\n@registry.register_module('meshgrid')\nclass PointAnchorMeshGrid(BaseMeshGrid):\n\n def __init__(self, strides):\n super().__init__(strides)\n\n def gen_anchor_mesh(self,\n featmap_...
[ [ "torch.meshgrid", "torch.arange" ] ]
cjdjr/pysot
[ "358aee8975309fd8a30a39534f96bf061020de39" ]
[ "tools/train.py" ]
[ "# Copyright (c) SenseTime. All Rights Reserved.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport argparse\nimport logging\nimport os\nimport time\nimport math\nimport json\nimport random\nimport nump...
[ [ "torch.cuda.manual_seed", "numpy.random.seed", "torch.optim.SGD", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSampler" ] ]
toomastahves/ITI8565
[ "325c0bc50794ea1e7c89b479b134f6fcd0125bee" ]
[ "Project/celestial_stars.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.decomposition import PCA\nfrom sklearn.metrics import classifi...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "sklearn.metrics.classification_report", "sklearn.tree.DecisionTreeClassifier", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
rudyn2/cc5114
[ "16ee51ef168ff395ece6cd4e4bb04a01ee8277cd" ]
[ "src/neural_network/NeuronLayer.py" ]
[ "from src.neural_network.Neuron import Neuron\nfrom src.neural_network.exceptions import NotAvailableActivationFunction\nfrom src.neural_network.activation_function import Sigmoid, Step, Tanh\nimport numpy as np\n\n\nclass NeuronLayer:\n \"\"\"\n This class provides the functionality to operate a layer of neu...
[ [ "numpy.random.random", "numpy.array" ] ]
translationalneurosurgery/tool-scarpa
[ "61f6c2578acb564af73d7ba53fd6965bd8de717f" ]
[ "test/estimate/test_periodic.py" ]
[ "import pytest\nfrom scarpa.generate.modulation import create_modulation\nfrom scarpa.generate.template import stack_template\nfrom scarpa.generate.shapes import sinus, hanning\nfrom scarpa.estimate.periodic import fit_with_plen_known, vec2parms\nimport numpy as np\n\n\n@pytest.fixture\ndef mixture():\n pcount =...
[ [ "numpy.corrcoef" ] ]
kpedro88/triton-inference-server
[ "37b3441e59bd0da314f428e1dcddf0a2f67d52e1", "37b3441e59bd0da314f428e1dcddf0a2f67d52e1", "37b3441e59bd0da314f428e1dcddf0a2f67d52e1" ]
[ "src/clients/python/library/utils.py", "qa/common/gen_qa_models.py", "src/clients/python/library/httpclient.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. 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\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list of c...
[ [ "numpy.array", "numpy.empty", "numpy.asarray", "numpy.nditer", "numpy.ascontiguousarray" ], [ "torch.zeros", "tensorflow.saved_model.simple_save", "tensorflow.strings.to_number", "tensorflow.get_default_graph", "tensorflow.subtract", "tensorflow.reset_default_graph"...
AHalic/tabu-search
[ "7f543dbb112b6d1cce6be01c4a0e8541bb904156" ]
[ "src/initial_solution.py" ]
[ "from typing import List\n\nimport numpy as np\n\nfrom graph import show_routes, sum_route_capacity\nfrom utils import sort_with_key\nfrom moves import shift\n\ndef create_n_routes(nodes: List[dict], clients: int) -> List[np.array]:\n \"\"\"\n Cria lista de arrays em que cada array possui apenas o valor da ci...
[ [ "numpy.concatenate", "numpy.array", "numpy.delete", "numpy.zeros", "numpy.flipud", "numpy.append" ] ]
dingmingliu/quanttrade
[ "2d9eaf9f2339a51458ef1e130c60b0132d9e57bb", "2d9eaf9f2339a51458ef1e130c60b0132d9e57bb" ]
[ "bt/core.py", "tests/test_algos.py" ]
[ "\"\"\"\nContains the core building blocks of the framework.\n\"\"\"\nimport math\nfrom copy import deepcopy\n\nimport pandas as pd\nimport numpy as np\nimport cython as cy\n\n\nclass Node(object):\n\n \"\"\"\n The Node is the main building block in bt's tree structure design.\n Both StrategyBase and Secur...
[ [ "pandas.DataFrame", "numpy.isnan" ], [ "pandas.to_datetime", "pandas.DataFrame", "pandas.date_range", "pandas.DateOffset", "pandas.Series" ] ]
saaiiravi/ebcpy
[ "5794754ccc52431028aafbb11ffc24928fb8b824" ]
[ "examples/e4_optimization_example.py" ]
[ "\"\"\"\nGoals of this part of the examples:\n1. Learn how to create a custom `Optimizer` class\n2. Learn the different optimizer frameworks\n3. Learn the usage of `StatisticsAnalyzer`\n4. Understand the motivation behing `AixCaliBuHA`\n\"\"\"\n# Start by importing all relevant packages\nimport matplotlib.pyplot as...
[ [ "numpy.sin", "sklearn.metrics.mean_squared_error", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.mean", "matplotlib.pyplot.figure", "sklearn.metrics.r2_score", "matplotlib.pyplot.show", "numpy.linspace" ] ]
cookingcodewithme/turicreate
[ "a89e203d60529d2d72547c03ec9753ea979ee342" ]
[ "src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/reduce_transposes.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2020, Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can be\n# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\n\nfrom __future__ import print_function as _\nfrom __future__ impo...
[ [ "numpy.all", "numpy.transpose", "numpy.reshape", "numpy.zeros" ] ]
zhen08/deep-learning-bitcoin
[ "df2db4260bea2a8fdbf3b3af0b89c6fb4a28b9ec" ]
[ "data_manager.py" ]
[ "import datetime\nimport pandas as pd\nimport os\n\n# http://api.bitcoincharts.com/v1/csv/\n\ndef file_processor(data_file):\n if os.access('data/bitcoin_coinbase_M5.csv', os.R_OK):\n print('Reading bitcoin market data file from: data/bitcoin_coinbase_M5.csv')\n p = pd.read_csv('data/bitcoin_coinba...
[ [ "pandas.read_csv", "pandas.read_table" ] ]
songhwanjun/Coteaching
[ "3fc8fee7f44b0cc8e61bbfb650284e9c9462e6ee" ]
[ "src/reader/cifar10_reader.py" ]
[ "from __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport os, sys, tarfile\r\nfrom six.moves import urllib\r\nfrom tensorflow.python.eager import context\r\nfrom tensorflow.python.framework import ops\r\nfrom tensorflow.python.ops import data_f...
[ [ "tensorflow.image.random_flip_left_right", "tensorflow.reshape", "tensorflow.python.eager.context.executing_eagerly", "tensorflow.python.training.input._shapes", "tensorflow.python.training.input._validate_keep_input", "tensorflow.python.training.input._validate", "tensorflow.cast", ...
amirassov/topcoder-facial-marathon
[ "37f6828a589717d0004dd84d51eb7bc6a1b310fd" ]
[ "reid/predict_embeddings.py" ]
[ "import argparse\nimport os\nfrom functools import partial\n\nimport cv2\nimport numpy as np\nimport pandas as pd\nfrom multiprocessing import Pool\nfrom tqdm import tqdm\n\nfrom reid.insightface.model import ArcFaceModel\n\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser.add_argument('--mtc...
[ [ "numpy.array", "pandas.read_csv", "numpy.stack" ] ]
stephaneckstein/OT_Comparison
[ "2b8831a3044bd2b74eb3899a4af6341c77544add" ]
[ "General_RKHS_OT.py" ]
[ "import numpy as np\n\n\ndef ot_cont_rkhs(margs_fun, f, k, d, kernel, gamma=100, n=250000, decay='poly', p=2, start=0.0005, final=10**(-7),\n minmax=1, pen_fun=lambda x: np.exp(x-1), pen_der=lambda x: np.exp(x-1)):\n \"\"\"\n calculates a multi-marginal OT problem by a reproducing kernel hilbe...
[ [ "numpy.zeros", "numpy.sum", "numpy.tile", "numpy.exp", "numpy.mean" ] ]
caoxiaoyue/mock_lrg_spec
[ "35cae5eea838793664cbc20da1a2c6b87446a9cf" ]
[ "pca_spec/fig_spec_decompositions.py" ]
[ "\"\"\"\nSDSS spectra Decompositions\n---------------------------\nFigure 7.4\n\nA comparison of the decomposition of SDSS spectra using PCA (left panel -\nsee Section 7.3.1), ICA (middle panel - see Section 7.6) and NMF (right panel\n- see Section 7.4). The rank of the component increases from top to bottom. For\n...
[ [ "matplotlib.pyplot.ylim", "matplotlib.pyplot.figure", "matplotlib.pyplot.MultipleLocator", "sklearn.decomposition.NMF", "matplotlib.pyplot.show", "sklearn.decomposition.FastICA", "sklearn.decomposition.PCA", "matplotlib.pyplot.NullFormatter", "numpy.vstack" ] ]
stevenagl12/SlicerMorph
[ "b5159aeb4ef291926f41f98ef2dc83097a3b87fc" ]
[ "ALPACA/ALPACA.py" ]
[ "##BASE PYTHON\nimport os\nimport unittest\nimport logging\nimport vtk, qt, ctk, slicer\nfrom slicer.ScriptedLoadableModule import *\nfrom slicer.util import VTKObservationMixin\nimport glob\nimport copy\nimport multiprocessing\nimport vtk.util.numpy_support as vtk_np\nimport numpy as np\n\n#\n# ALPACA\n#\n\nclass ...
[ [ "numpy.reshape", "numpy.asarray", "numpy.append" ] ]
HettyPatel/ivy
[ "90b5be3745bb4f72c51853311967e7d30dfd1f36" ]
[ "ivy_tests/test_functional/test_core/test_linalg.py" ]
[ "\"\"\"\nCollection of tests for unified linear algebra functions\n\"\"\"\n\n# global\nimport pytest\nimport numpy as np\n\n# local\nimport ivy\nimport ivy.functional.backends.numpy\nimport ivy_tests.helpers as helpers\n\n\n# svd\n@pytest.mark.parametrize(\n \"x\", [[[[1., 0.], [0., 1.]]], [[[[1., 0.], [0., 1.]]...
[ [ "numpy.allclose", "numpy.array" ] ]
ItamarWilf/pytorch-bonsai
[ "d8091cfa731d5168ce9a0a1d98e555f7d1364244" ]
[ "bonsai/pruning/__init__.py" ]
[ "import numpy as np\nimport torch\n\nfrom bonsai.pruning.abstract_pruners import WeightBasedPruner, ActivationBasedPruner, GradBasedPruner\n\n\nclass WeightL2Prunner(WeightBasedPruner):\n\n @staticmethod\n def compute_single_layer_ranks(module, *args, **kwargs):\n size = module.weights.size()\n ...
[ [ "numpy.prod", "torch.mean", "torch.sum" ] ]
cliftbar/switch_suncode2019
[ "cad8fcca50a4848ba946f39aeaa624a230af679d" ]
[ "api_server/switch_api/services/osemo/Code/Import_Load_Profile_Data_SC2019.py" ]
[ "def Import_Load_Profile_Data(Input_Output_Data_Directory_Location=None, OSESMO_Git_Repo_Directory=None, delta_t=None, Load_Profile_Name_Input=None):\n\n # Load Python Packages\n import os\n import numpy as np\n\n # Set Directory to Box Sync Folder\n os.chdir(Input_Output_Data_Directory_Location)\n\n...
[ [ "numpy.genfromtxt" ] ]
dalexa10/Hypersonic_Aerothermodynamics
[ "9bbb33c525b43d624db969b18e87f9d2345c7154" ]
[ "Hypersonic_pkg/hyper_class/post_fan.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom scipy.optimize import fsolve\nfrom ambiance import Atmosphere\nimport math\n\nclass Post_Fan():\n def __init__(self, Ma1, theta, gamma):\n self.Ma1 = Ma1\n self.theta = theta\n self.gamma = gamma\n self.Ma2 = self.Prandl_Meyer_inv()\n ...
[ [ "numpy.sqrt" ] ]
vriesdemichael/sklearn-onnx
[ "e7984b20e6d8c990221829f65a1a9a893aba24a5" ]
[ "tests/test_algebra_meta_onnx.py" ]
[ "import os\nimport unittest\nfrom distutils.version import StrictVersion\nfrom io import StringIO\nimport contextlib\nimport warnings\nimport numpy\nfrom numpy.testing import assert_almost_equal\nimport onnx\nimport onnxruntime\nfrom onnx import numpy_helper, helper\nfrom skl2onnx.algebra.onnx_ops import dynamic_cl...
[ [ "numpy.testing.assert_almost_equal" ] ]
SomeAnonimCoder/gravity-simulation
[ "77885fcc69eddb3ca07895adf5774893f3277e08" ]
[ "examples/q.py" ]
[ "import numba, numpy as np\n\n# Define the row-wise function to be vectorized:\n\n\ndef f(a,b):\n b = a.sum() \n\n# Apply the function to an array with five rows:\na = np.arange(10).reshape(5,2)\nb = f(a) \nprint(b)\n\n\n@vectorize(signature='(m),(m,n),(),(m)->(m)' )\ndef inner3(a,b,m,M):\n c = a+b\n d =...
[ [ "numpy.sum", "numpy.array", "numpy.arange" ] ]
ansobolev/shs
[ "7a5f61bd66fe1e8ae047a4d3400b055175a53f4e" ]
[ "shs/voronoi/numpy/base_numpy.py" ]
[ "#!/usr/bin/python\n# __*__ coding: utf8 __*__\n\noneline = \"Read, write and operate with models\"\n\nimport numpy as N\nimport numpy.lib.recfunctions as nlrf\n\nclass model_base:\n# --------------------------------------------------------------------\n def __init__(self,d={}):\n# time: timestep number\n ...
[ [ "numpy.array", "numpy.lib.recfunctions.append_fields", "numpy.zeros", "numpy.diag", "numpy.unique" ] ]
RudrakshTuwani/MAPIE
[ "11940aed9c8eb85943513b26677d684cafda363c" ]
[ "mapie/classification.py" ]
[ "from __future__ import annotations\nfrom typing import Optional, Union, Tuple, Iterable, List, cast\n\nimport numpy as np\nfrom joblib import Parallel, delayed\nfrom sklearn.base import BaseEstimator, ClassifierMixin, clone\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.model_selection import B...
[ [ "numpy.min", "numpy.mean", "numpy.ma.masked_less", "numpy.cumsum", "sklearn.utils.validation.indexable", "numpy.full_like", "numpy.empty", "sklearn.utils.validation._num_samples", "numpy.argmax", "sklearn.base.clone", "numpy.empty_like", "numpy.array", "sklearn....
hsinorshin/Flood_Warning_System_159
[ "16e12115e31c872c84d4299d574e95fe5cd5a37d" ]
[ "Task2F.py" ]
[ "from floodsystem.datafetcher import fetch_measure_levels\nfrom floodsystem.stationdata import build_station_list\nimport matplotlib.pyplot as plt\nimport datetime\nfrom floodsystem.stationdata import build_station_list,update_water_levels\nfrom floodsystem.station import MonitoringStation\nfrom floodsystem.analysi...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks" ] ]
souptc/keras-onnx
[ "c08d52bf4d4ec2bba69ec4ffd2ea14f47fecb1f5" ]
[ "keras2onnx/_builtin.py" ]
[ "###############################################################################\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n##########################################################################...
[ [ "numpy.array", "numpy.isscalar", "numpy.dtype" ] ]
riccardoscheda/covid-xprize
[ "d7a77ee870b229e10ba1d50c7d18e6ba11577607" ]
[ "pipeline/custom_models.py" ]
[ "from sklearn.base import BaseEstimator, RegressorMixin\nfrom sklearn.utils.validation import check_X_y, check_array, check_is_fitted\nfrom scipy.integrate import solve_ivp\nimport numpy as np\nfrom tqdm import tqdm\nfrom scipy.optimize import curve_fit\nfrom functools import partial\nimport multiprocessing as mp\n...
[ [ "pandas.to_datetime", "numpy.array", "numpy.isnan", "sklearn.utils.validation.check_is_fitted", "sklearn.utils.validation.check_X_y", "numpy.nan_to_num", "scipy.optimize.curve_fit", "pandas.DataFrame", "sklearn.utils.validation.check_array", "numpy.diff", "scipy.integra...
forkbabu/torch-fidelity
[ "34b673beeffcf853e1fa40174d6c81a884495883" ]
[ "torch_fidelity/metric_kid.py" ]
[ "# Functions mmd2 and polynomial_kernel are adapted from\n# https://github.com/mbinkowski/MMD-GAN/blob/master/gan/compute_scores.py\n# Distributed under BSD 3-Clause: https://github.com/mbinkowski/MMD-GAN/blob/master/LICENSE\n\nimport numpy as np\nimport torch\nfrom tqdm import tqdm\n\nfrom torch_fidelity.helpe...
[ [ "numpy.trace", "numpy.matmul", "numpy.zeros", "torch.is_tensor", "numpy.mean", "numpy.diagonal", "numpy.std" ] ]
felipessalvatore/ContraQA
[ "6c4eb599df4c9a1dc3ac4250598e8b1b7cc1169d" ]
[ "contra_qa/train_functions/util.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport torch # noqa\nimport torch.nn as nn # noqa\nimport torch.optim as optim # noqa\nimport numpy as np # noqa\nimport matplotlib.pyplot as plt # noqa\nimport pandas as pd # noqa\nfrom torchtext import data # noqa\nimport os # noqa\nimport inspect # noqa\nimport...
[ [ "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "torch.cuda.is_available", "matplotlib.pyplot.ylabel", "pandas.read_csv", "torch.nn.CrossEntropyLoss" ] ]
colflip/FourStepGCN
[ "e647c913435613c275befeca04ec032908642a6b" ]
[ "modle.py" ]
[ "# -*- encoding: utf-8 -*-\n\"\"\"\n@Time : 2021/10/31 23:25\n@Email : colflip@163.com\n\"\"\"\nimport math\nimport torch\nimport torch.nn as nn\nfrom torch.nn import Parameter\nfrom torch.nn import Module\n\n\nclass GraphConvolution(Module):\n def __init__(self, in_features_dim, out_features_dim, activatio...
[ [ "torch.nn.Dropout", "torch.nn.ModuleList", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.spmm", "torch.nn.init.zeros_" ] ]
schrodinger/schrodingerdeepchem
[ "0bc47be0fb66140be251d8d6d971bc5bfef8f8b4" ]
[ "deepchem/models/tf_new_models/multitask_regressor.py" ]
[ "\"\"\"\nImplements a multitask graph-convolutional regression.\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\n__author__ = \"Han Altae-Tran and Bharath Ramsundar\"\n__copyright__ = \"Copyright 2016, Stanford University\"\n__license__ = \"...
[ [ "tensorflow.train.AdamOptimizer", "numpy.zeros", "tensorflow.Session", "tensorflow.add_n", "tensorflow.truncated_normal", "tensorflow.constant", "tensorflow.placeholder", "tensorflow.div", "tensorflow.squeeze", "tensorflow.split", "tensorflow.global_variables_initialize...
jjw-DL/mmdetection3d_Noted
[ "69f68d9a8890cb8608cb7aba586ca97d49b01b7e" ]
[ "mmdet3d/models/detectors/voxelnet.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nfrom mmcv.runner import force_fp32\nfrom torch.nn import functional as F\n\nfrom mmdet3d.core import bbox3d2result, merge_aug_bboxes_3d\nfrom mmdet3d.ops import Voxelization\nfrom mmdet.models import DETECTORS\nfrom .. import builder\nfrom .single_stag...
[ [ "torch.nn.functional.pad", "torch.no_grad", "torch.cat" ] ]
barslmn/picus
[ "f4d84dda925d0a638969f3f7dab0421e5c697541" ]
[ "picus/core/evidencecollection.py" ]
[ "# coding: utf-8\n\n'''\n# Criteria\n\n## Pathogenic\n\n### Pathogenic Very Strong\n* PVS1 null variant (nonsense, frameshift, canonical ±1 or 2 splice sites, initiation codon, single or multiexon deletion) in a gene where LOF is a known mechanism of disease\n\n### Pathogenic Strong\n* PS1 Same amino acid change as...
[ [ "pandas.merge" ] ]
ajcallegari/pipecaster
[ "dc283db67662385a54179310e3dbede04ec3db84" ]
[ "pipecaster/cross_validation.py" ]
[ "\"\"\"\nCross validation functions supporting both MultichannelPipeline and\nscikit-learn predictors.\n\"\"\"\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom sklearn.metrics import balanced_accuracy_score, explained_variance_score\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.preprocessing impo...
[ [ "numpy.concatenate", "numpy.array", "sklearn.model_selection.StratifiedKFold", "sklearn.model_selection.GroupKFold", "sklearn.model_selection.KFold", "numpy.unique" ] ]
luana-afonso/Comunidade-DS
[ "be2ac267786767a32957a90d999d67de81dc4b17" ]
[ "dashboard.py" ]
[ "\nimport folium\nimport geopandas\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\nimport streamlit as st\n\nfrom datetime import datetime\nfrom folium.plugins import MarkerCluster\nfrom streamlit_folium import folium_static\n\n# -------------------------------------...
[ [ "pandas.to_datetime", "pandas.read_csv", "pandas.merge", "pandas.concat" ] ]
KTH-RPL-Planiacs/stl_multiclass
[ "c4d7de8882780337382d266096d69cd2eb89d14e" ]
[ "nn_learn.py" ]
[ "import numpy as np\nfrom tensorflow import keras\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport pickle\nfrom evaluation_metrics import hamming_loss\nfrom evaluation_metrics import example_based_accuracy\nimport time\nfrom sklearn.metrics import confusion_matrix\nimport time\n\n\ndef plot_cm(y_true...
[ [ "numpy.concatenate", "sklearn.metrics.confusion_matrix", "numpy.array", "tensorflow.keras.layers.LSTM", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "tensorflow.keras.Sequential", "tensorflow.keras.layers.Dense", "tensorflow.keras.mode...
mehrdad-dev/scikit-learn-mooc
[ "9c03fb14784ab447a2477039c07f8e8a0d191742" ]
[ "python_scripts/ensemble_random_forest.py" ]
[ "# %% [markdown]\n# # Random forest\n#\n# In this notebook, we will present the random forest models and\n# show the differences with the bagging classifiers.\n#\n# Random forests are a popular model in machine learning. They are a\n# modification of the bagging algorithm. In bagging, any classifier or\n# regressor...
[ [ "sklearn.datasets.fetch_california_housing", "sklearn.ensemble.RandomForestRegressor", "sklearn.ensemble.BaggingRegressor", "sklearn.tree.DecisionTreeRegressor", "sklearn.model_selection.cross_val_score" ] ]
CGe0516/pandas
[ "37a9f7e6c310738ad078168c4b268a0e2154b9b3" ]
[ "pandas/core/tools/numeric.py" ]
[ "from __future__ import annotations\n\nimport numpy as np\n\nfrom pandas._libs import lib\n\nfrom pandas.core.dtypes.cast import maybe_downcast_numeric\nfrom pandas.core.dtypes.common import (\n ensure_object,\n is_datetime_or_timedelta_dtype,\n is_decimal,\n is_integer_dtype,\n is_number,\n is_nu...
[ [ "pandas.Index", "numpy.array", "pandas.core.dtypes.common.is_number", "numpy.zeros", "pandas.core.dtypes.common.is_scalar", "numpy.min", "pandas.core.dtypes.cast.maybe_downcast_numeric", "pandas.core.dtypes.common.is_numeric_dtype", "pandas.core.dtypes.common.is_datetime_or_tim...
SaahilParikh/Interceptor
[ "2c9f1baa7d655cd585e03057fbda114e73995bf9" ]
[ "src/motion_predict/src/main.py" ]
[ "#!/usr/bin/env python\n\"\"\"Motion Prediction Node.\nUses position data from the camera to estimate the velocity and acceleration of the ball.\n\"\"\"\n\nimport rospy\n\nimport math\nimport tf2_ros\nimport geometry_msgs.msg\nimport turtlesim.srv\nfrom filterpy.kalman import KalmanFilter\nfrom filterpy.common impo...
[ [ "numpy.array", "numpy.zeros" ] ]
JameScottX/Quasi-static-control-of-quadruped-robot
[ "1e34d8805301c02287804228fac8367056983855" ]
[ "Webots/controllers/dog_c/comm/dynamics/wbc.py" ]
[ "# Whole Body Control - Hand make\n# Updated in 2020 1/4\n# Author Junwen Cui / JameScottX\n# Other: \n\nimport numpy as np\nimport numba as nb\n\nif __name__ == '__main__':\n from qp_solver import *\nelse:\n from comm.dynamics.qp_solver import *\n from comm.action.basis import R_Matrix \n\n\ndef k...
[ [ "numpy.array", "numpy.reshape", "numpy.shape", "numpy.identity", "numpy.hstack", "numpy.vstack", "numpy.mat" ] ]
AK391/LoFTR
[ "104ba1f414491381003671aaf811f979a709b0b6" ]
[ "src/loftr/loftr.py" ]
[ "import torch\nimport torch.nn as nn\nfrom einops.einops import rearrange\n\nfrom .backbone import build_backbone\nfrom .utils.position_encoding import PositionEncodingSine\nfrom .loftr_module import LocalFeatureTransformer, FinePreprocess\nfrom .utils.coarse_matching import CoarseMatching\nfrom .utils.fine_matchin...
[ [ "torch.cat" ] ]
Marlin-Na/canine
[ "5a56360231d381239934e4a44143f9c9aed7ef22" ]
[ "canine/adapters/firecloud.py" ]
[ "import typing\nimport json\nimport os\nimport warnings\nimport pandas as pd\nimport numpy as np\nfrom .base import AbstractAdapter\nimport dalmatian\n\nclass FirecloudAdapter(AbstractAdapter):\n \"\"\"\n Job input adapter\n Parses inputs as firecloud expression bois\n if enabled, job outputs will be wr...
[ [ "numpy.isnan" ] ]