repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
bgruening/Galaxy-ML-1 | [
"47514940c7ac39d6ca1d595b58b5d1311b3f3840"
] | [
"galaxy_ml/preprocessors/_z_random_over_sampler.py"
] | [
"import numpy as np\n\nfrom collections import Counter\nfrom imblearn.over_sampling.base import BaseOverSampler\nfrom imblearn.over_sampling import RandomOverSampler\nfrom imblearn.utils import check_target_type\nfrom scipy import sparse\nfrom sklearn.utils import _safe_indexing\nfrom sklearn.utils.validation impor... | [
[
"sklearn.utils._safe_indexing",
"numpy.nanpercentile",
"scipy.sparse.issparse",
"numpy.arange",
"sklearn.utils.validation.check_X_y",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
aholyoke/python-hll | [
"30793aeb18103600fce0f3ad0b0c9e99e8b756fe"
] | [
"python_hll/util.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom math import log\nimport numpy as np\n\n\nclass BitUtil:\n \"\"\"\n A collection of bit utilities.\n \"\"\"\n\n # The set of least-significant bits for a given ``byte``. ``-1``\n # is used if no bits are set (so as to not be confused with \"index of zero\"\n # meani... | [
[
"numpy.uint32",
"numpy.int32",
"numpy.int8",
"numpy.int64",
"numpy.int",
"numpy.uint64",
"numpy.left_shift"
]
] |
priyamtejaswin/KernelGAT | [
"10a5e2e72e8ab0436b11f18be045e5d41ccefe6c"
] | [
"kgat/modeling_roberta.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.zeros",
"torch.nn.Embedding",
"torch.tanh",
"torch.nn.Linear",
"torch.arange",
"torch.nn.MSELoss"
]
] |
XuboLyu/BaRC | [
"89c3bee98e4b4069e7920f80374c73cec4bc6b3b"
] | [
"source/utils.py"
] | [
"import os, errno\nimport numpy as np\nfrom numpy.random import choice\nfrom plotting_with_theta_sections import visualize_eval\nfrom rl import rl_utils\n\n#############\n# Selecting #\n#############\ndef dedupe_list_of_np_arrays(lst):\n return list(map(np.asarray, set(map(tuple, lst))))\n\n\ndef select(starts, ... | [
[
"numpy.power",
"numpy.cos",
"numpy.stack",
"numpy.sin",
"numpy.mean",
"numpy.sum"
]
] |
taneishi/theano-rnn | [
"fae7d0c1670781ca882024755a8b81fc366d6571"
] | [
"base.py"
] | [
"'''Base classes for all estimators.'''\n# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>\n# License: BSD 3 clause\n\nimport copy\nimport inspect\nimport warnings\n\nimport numpy as np\nfrom scipy import sparse\nimport six # from sklearn.externals\n\ndef clone(estimator, safe=True):\n '''Constructs a new... | [
[
"numpy.all",
"numpy.set_printoptions",
"scipy.sparse.issparse",
"numpy.get_printoptions"
]
] |
justinshaffer/DEICODE | [
"b7cd4da09c993bdd9ab536b1a5919dbc28d2b9ca"
] | [
"benchmarking/case_studies/scripts/subsample.py"
] | [
"import pandas as pd\nimport numpy as np\nimport os\nfrom gneiss.util import match\nfrom biom.util import biom_open\nfrom biom import load_table\nfrom collections import Counter\nimport numpy as np\nimport shutil\nimport os\nnp.random.seed(42)\n\ndef make_safe_dir(tmp_w):\n if not os.path.exists(tmp_w):\n ... | [
[
"numpy.arange",
"numpy.random.seed",
"numpy.random.choice"
]
] |
valeriia-rohoza/planetary_orbits | [
"8222a88a2c82b027d14a48106b271a8cb3d8ebbf"
] | [
"odesolver.py"
] | [
"''' interface to import C functions from inside Jupyter Notebook\n'''\n\nimport ctypes\nfrom ctypes import *\nfrom numpy.ctypeslib import ndpointer\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport numba\n\n#load our C library, it's as simple as that!\nlib = ctypes.CDLL(\"libode.so\")\n#rename C-based s... | [
[
"numpy.ctypeslib.ndpointer",
"numpy.zeros",
"numpy.asarray",
"numpy.linspace"
]
] |
benemer/pyTorchChamferDistance | [
"067243c92f89b0cbef4b12f6c7551c66a447887e"
] | [
"chamfer_distance/chamfer_distance.py"
] | [
"\nimport torch\nimport os\n\nfrom torch.utils.cpp_extension import load\ncd = load(name=\"cd\",\n sources=[os.path.abspath(\"pyTorchChamferDistance/chamfer_distance/chamfer_distance.cpp\"),\n os.path.abspath(\"pyTorchChamferDistance/chamfer_distance/chamfer_distance.cu\")])\n\nclass Cham... | [
[
"torch.zeros"
]
] |
liubarnabas/hifi3dface | [
"33886a82aadd2da7ff7c2d5a91303413d096b778"
] | [
"optimization/rgbd/RGBD_utils/FitTools.py"
] | [
"# -*- coding:utf8 -*-\n\"\"\"\nThis file is part of the repo: https://github.com/tencent-ailab/hifi3dface\n\nIf you find the code useful, please cite our paper: \n\n\"High-Fidelity 3D Digital Human Head Creation from RGB-D Selfies.\"\nACM Transactions on Graphics 2021\nCode: https://github.com/tencent-ailab/hifi3d... | [
[
"numpy.reshape",
"numpy.squeeze",
"numpy.tile",
"numpy.linalg.lstsq",
"numpy.zeros",
"numpy.where",
"numpy.vstack"
]
] |
kasanari/ParlAIForSocialRobotTraining | [
"5018dafe28f387b6b22e89d3f8d67a69109e6d98"
] | [
"parlai/utils/torch.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\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\n\"\"\"\nUtility methods for dealing with torch code.\n\"\"\"\n\nfrom typing import Union, Optional, Tuple, Any,... | [
[
"torch.LongTensor",
"torch.full",
"torch.cat",
"torch.Tensor",
"torch.sum",
"torch.split",
"torch.cuda.device_count"
]
] |
ss1004124654/DGFraud-TF2 | [
"18c2bcc03e850afb7d9b507464b366cad30d675f"
] | [
"test.py"
] | [
"\"\"\"\r\nThis code is attributed to Yingtong Dou (@YingtongDou) and UIC BDSC Lab\r\nDGFraud (A Deep Graph-based Toolbox for Fraud Detection in TensorFlow 2.X)\r\nhttps://github.com/safe-graph/DGFraud-TF2\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport argparse\r\nfrom sklearn.model_selection import train_test_spli... | [
[
"tensorflow.convert_to_tensor",
"numpy.random.seed",
"sklearn.model_selection.train_test_split",
"tensorflow.SparseTensor",
"numpy.random.rand",
"numpy.array",
"tensorflow.random.set_seed"
]
] |
bryab/psd-tools | [
"e8c8978e0ffb8292c869d2ee03852c7ba371b5c5"
] | [
"src/psd_tools/composer/vector.py"
] | [
"\"\"\"\nVector module.\n\"\"\"\nfrom __future__ import absolute_import, unicode_literals\nimport logging\n\nfrom psd_tools.api.pil_io import convert_pattern_to_pil\nfrom psd_tools.terminology import Enum, Key, Type, Klass\n\nlogger = logging.getLogger(__name__)\n\n_COLORSPACE = {\n Klass.CMYKColor: 'CMYK',\n ... | [
[
"numpy.radians",
"numpy.minimum",
"numpy.linspace",
"numpy.power",
"numpy.cos",
"numpy.sin",
"numpy.arctan2",
"numpy.ones",
"scipy.interpolate.interp1d",
"scipy.ndimage.filters.maximum_filter1d",
"numpy.random.RandomState",
"scipy.ndimage.filters.uniform_filter1d"
... |
siat-nlp/dialogue-baselines | [
"0476fcf01b1c0f7ef3aedeb190ac4b6fa0448bc3"
] | [
"CCM/src/model.py"
] | [
"# -*- coding: utf-8 -*-\nimport tensorflow as tf\nfrom tensorflow.python.ops.nn import dynamic_rnn\nfrom tensorflow.contrib.rnn import GRUCell, MultiRNNCell\nfrom tensorflow.contrib.lookup.lookup_ops import MutableHashTable\nfrom tensorflow.python.framework import constant_op\nfrom tensorflow.contrib.layers.python... | [
[
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.contrib.rnn.GRUCell",
"tensorflow.reduce_sum",
"tensorflow.global_variables",
"tensorflow.train.AdamOptimizer",
"tensorflow.where",
"tensorflow.summary.scalar",
"tensorflow.Variable",
"tensorflow.gradients",
"t... |
tingshao/catapult | [
"a8fe19e0c492472a8ed5710be9077e24cc517c5c"
] | [
"dashboard/dashboard/pinpoint/models/compare/thresholds_performance.py"
] | [
"#!/usr/bin/env python\n# Copyright 2018 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n\"\"\"Calculates significance thresholds for performance comparisons.\"\"\"\nfrom __future__ import print_function\nfrom __fu... | [
[
"scipy.stats.norm.ppf",
"scipy.stats.mannwhitneyu",
"scipy.stats.norm.rvs",
"numpy.percentile"
]
] |
RedWagon/cad | [
"db742ec977b225848d67e330017c40135cb593ac"
] | [
"bb/wtf.py"
] | [
"#!/usr/bin/python\nimport fastopc as opc\nimport numpy as np\nimport time\nimport vox_color\nfrom optparse import OptionParser\n\n# parse options\nparser = OptionParser()\nparser.add_option(\"--host\", dest=\"host\", default=\"127.0.0.1\",\n help=\"hostname or IP of opc server\")\nparser.add_optio... | [
[
"numpy.empty_like",
"numpy.zeros",
"numpy.roll"
]
] |
mattfirth7/BSMR2 | [
"a30d8bc45da38a4cb3c2f606e09a56154dbe42ac"
] | [
"svm_no_feature_select.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import svm\n\ndata = pd.read_csv('C:/Users/Matt/Documents/max_relevancy_min_redundancy/breast_cancer_data.csv')\ny = data.pop('diagnosis')\nx = data\n\nx_train, x_test, y_train, y_test = train_test_split(x,y... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"numpy.std",
"numpy.mean",
"sklearn.svm.SVC"
]
] |
zoobree/MachineLearning | [
"69a381efa35436a6d211005c320576db966eea11"
] | [
"timeseries/test.py"
] | [
"# -*- coding: utf-8 -*-\nimport unittest\nimport arima\nimport os\nimport pandas as pd\n\n\nclass Arima_Test(unittest.TestCase):\n def set_data_dir(self):\n print(\"set_data_dir\")\n self.dir = \"E:/code/python/MachineLearning/data/test_data/\"\n self.error = 0.001\n self.num_percent... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
vtcaregorodtcev/pawls-1 | [
"32cfb7bc56edac2fe972467a1133a31ae901c727"
] | [
"cli/pawls/commands/metric.py"
] | [
"import os\nimport sys\nimport tempfile\nfrom glob import glob\nfrom copy import deepcopy\nfrom collections import defaultdict\nfrom typing import List, NamedTuple, Union, Dict, Any, Set, Tuple\n\nimport click\nimport pandas as pd\nimport numpy as np\nfrom tabulate import tabulate\nfrom pycocotools.coco import COCO... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.mean",
"pandas.isna",
"sklearn.metrics.classification_report"
]
] |
notallheroeswearcapes/ML_Ex3 | [
"420b815d6e86558e8272b51fcac8153ace06f534"
] | [
"deeplearn/classifier.py"
] | [
"import click\nfrom sklearn import neighbors, metrics, neural_network, ensemble\nfrom deeplearn import io, evaluator\nfrom timeit import default_timer\n\n\nclass Classifier:\n KNN_PARAMS = {\n 'n_neighbors': 3,\n 'weights': 'distance'\n }\n MLP_PARAMS = {\n 'activation': 'relu',\n ... | [
[
"sklearn.neural_network.MLPClassifier",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.accuracy_score"
]
] |
BoboDance/RL-Project | [
"7177655aa815b1d0f06ee838abb2c93ba2d8a8c3"
] | [
"a3c/util/normalizer/mean_std_normalizer.py"
] | [
"#######################################################################\n# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# Permission given to modify the code as long as you keep this #\n# declaration at the top #\n#######################... | [
[
"numpy.asarray",
"numpy.sqrt"
]
] |
saransh738/ELL-409-NEURAL-NETWORKS | [
"69e423d4728543d362420d7220952d241aa1203a"
] | [
"backpropagation.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\nimport random\r\nimport time\r\nimport math\r\nfrom timeit import default_timer as timer\r\n\r\nclass NEURAL(object):\r\n def __init__(self,num_inputs,hidden_layers,num_outputs):\r\n \r\n # num_inputs = number of input... | [
[
"numpy.dot",
"matplotlib.pyplot.imshow",
"pandas.read_csv",
"numpy.amax",
"numpy.random.randn",
"numpy.average",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.show"
]
] |
dair-iitd/ECQA | [
"a74bb658194e647e5d7955a84cc895bf5a5d8b3e"
] | [
"generation/generation_eval_free_flow.py"
] | [
"import os\r\nimport argparse\r\nimport subprocess\r\nfrom tqdm import tqdm\r\n\r\nfrom semantic_text_similarity.models import WebBertSimilarity\r\nfrom semantic_text_similarity.models import ClinicalBertSimilarity\r\n\r\nweb_model = WebBertSimilarity(device='cpu', batch_size=10) #defaults to GPU prediction\r\n\r\n... | [
[
"numpy.array",
"numpy.average"
]
] |
vpellegrain/RNN-Time-series-Anomaly-Detection | [
"1e1fb54f97975685c140cb4138bff4277deec762"
] | [
"1_train_predictor.py"
] | [
"import argparse\nimport time\nimport torch\nimport torch.nn as nn\nimport preprocess_data\nfrom model.model import TimeSeriesLSTMStochastic\nfrom torch import optim\nfrom matplotlib import pyplot as plt\nfrom pathlib import Path\nfrom anomalyDetector import fit_norm_distribution_param\nfrom dataloading import Time... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"torch.enable_grad",
"torch.cuda.manual_seed",
"torch.cat",
"matplotlib.pyplot.title",
"torch.manual_seed",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylabel",
"torch.no_grad",
"matplotlib.pyplot.close",
... |
Seb-Good/ecg-features | [
"f9a4c986f8e460a081c71b8e2c7e3ddb26eabae8"
] | [
"utils/tools/higuchi_fractal_dimension.py"
] | [
"\"\"\"\nhiguchi_fractal_dimension.py\n----------------------------\nFunction to calculate the Higuchi Fractal Dimension from a time series. This function was taken from the pyrem\nunivariate library (https://github.com/gilestrolab/pyrem/blob/master/src/pyrem/univariate.py).\n----------------------------\nBy: Sebas... | [
[
"numpy.linalg.lstsq",
"numpy.log",
"numpy.abs",
"numpy.floor"
]
] |
holgerroth/MONAI | [
"91ea1b676a8fda066fd07ba6b55e87151da16dde"
] | [
"monai/handlers/checkpoint_loader.py"
] | [
"# Copyright 2020 - 2021 MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre... | [
[
"torch.load"
]
] |
adamreeve/mlflow | [
"d0d307f7f7b49f013727191a672ae2139bf37343"
] | [
"tests/lightgbm/test_lightgbm_autolog.py"
] | [
"import os\nimport json\nimport functools\nimport pickle\nimport pytest\nimport yaml\nimport numpy as np\nimport pandas as pd\nfrom sklearn import datasets\nimport lightgbm as lgb\nimport matplotlib as mpl\nfrom packaging.version import Version\n\nimport mlflow\nimport mlflow.lightgbm\nfrom mlflow.lightgbm import _... | [
[
"numpy.random.random",
"matplotlib.use",
"sklearn.datasets.load_iris",
"pandas.DataFrame",
"matplotlib.pyplot.get_fignums",
"numpy.random.randint"
]
] |
RuochenWang/darts-pt | [
"a5393d5c9731a6eff0bc379f3153bf24a2ab8ec5"
] | [
"sota/cnn/model_search_sdarts_proj.py"
] | [
"import torch.nn.functional as F\n\nfrom sota.cnn.operations import *\nfrom sota.cnn.genotypes import Genotype\nimport sys\nsys.path.insert(0, '../../')\nfrom sota.cnn.model_search_darts_proj import DartsNetworkProj\n\n\nclass SDartsNetworkProj(DartsNetworkProj):\n def __init__(self, C, num_classes, layers, crit... | [
[
"torch.nn.functional.softmax"
]
] |
linsats/Python-Parser-for-Robotic-Gripper | [
"4089a89ab3eb96a4dc0674df481658e6e217d8e9"
] | [
"gripper_files.py"
] | [
"import sys\nimport argparse\nimport os\nimport numpy as np\nimport numpy\nfrom geolib.objfile import OBJ\nfrom geolib.cuboid import Cuboid\nfrom urdf_parser_py.urdf import URDF\nfrom mayavi import mlab as mayalab\nimport math\nimport scipy.optimize\n\nimport inverse_kinematics as ik\nfrom geolib.objfile import OBJ... | [
[
"numpy.dot",
"numpy.min",
"numpy.eye",
"numpy.compress",
"numpy.linalg.norm",
"numpy.ones",
"numpy.max",
"numpy.copy",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"numpy.place"
]
] |
BoykoMihail/marketBubblePrediction | [
"beaaad50c709a6a4dffd4881e5648104a5c9d200"
] | [
"lppls.py"
] | [
"#!/usr/bin/env python\n\nimport random\nimport numpy as np\nimport pandas as pd\nimport multiprocessing\nfrom scipy.optimize import minimize\nfrom matplotlib import pyplot as plt\n\n\nclass LPPLS(object):\n\n def __init__(self, observations):\n \n self.observations = observations\n self.coef_ =... | [
[
"numpy.log",
"numpy.ones_like",
"numpy.power",
"numpy.subtract",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.cos",
"numpy.sin",
"numpy.linalg.lstsq",
"scipy.optimize.minimize",
"numpy.array",
"numpy.sum"
]
] |
valyukov/catalyst | [
"a1d2638f22ff7bede74410baeb8bc6a7aff036df"
] | [
"catalyst/dl/callbacks/mixup.py"
] | [
"from typing import List # isort:skip\n\nimport numpy as np\n\nimport torch\n\nfrom catalyst.dl import CriterionCallback, State\n\n\nclass MixupCallback(CriterionCallback):\n \"\"\"\n Callback to do mixup augmentation.\n\n Paper: https://arxiv.org/abs/1710.09412\n\n Note:\n MixupCallback is inhe... | [
[
"torch.randperm",
"numpy.random.beta"
]
] |
wahtak/alpha_viergewinnt | [
"569b66e656722387e450f72842ed7fe8c7d1a732"
] | [
"alpha_viergewinnt/agent/alpha/alpha.py"
] | [
"from copy import deepcopy\nimport logging\n\nimport numpy as np\n\nfrom .graph import GameStateGraph\nfrom .mcts import Mcts\n\n\nclass Alpha(object):\n def __init__(self, evaluator, mcts_steps, random_seed, draw_graph):\n self.logger = logging.getLogger(self.__class__.__module__ + \".\" + self.__class__... | [
[
"numpy.random.RandomState"
]
] |
nikwl/mime-release | [
"2f3d09d1d04bee2505bbb416f960c90f73f4346c",
"2f3d09d1d04bee2505bbb416f960c90f73f4346c"
] | [
"mime/envs/table_envs/table_scene.py",
"mime/envs/table_envs/pick_scene.py"
] | [
"import numpy as np\nfrom copy import deepcopy\n\nfrom ...scene import Body, DebugCamera, VRCamera, Camera, Scene, UR5\nfrom .table_modder import TableModder\n\n\nclass TableScene(Scene):\n \"\"\" Base scene for tasks with robot on table \"\"\"\n\n def __init__(self,\n robot_type='UR5',\n ... | [
[
"numpy.abs",
"numpy.allclose",
"numpy.median",
"numpy.ptp",
"numpy.array"
],
[
"numpy.array",
"numpy.random.RandomState",
"numpy.subtract"
]
] |
puzis/OverflowPrediction | [
"1d9c94b106d40317146f7f09d79fad489f1059dc"
] | [
"model_impls/oh_parkinson.py"
] | [
"from braindecode.torch_ext.util import np_to_var\nimport numpy as np\nfrom braindecode.torch_ext.modules import Expression\nfrom torch import nn\nfrom EEGNAS import global_vars\n\n\nclass MyModel:\n # remove empty dim at end and potentially remove empty time dim\n # do not just use squeeze as we never want t... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.Softmax",
"torch.nn.Conv2d",
"numpy.ones",
"torch.nn.Linear",
"torch.nn.MaxPool2d"
]
] |
Locust2520/python-fairmodels | [
"0572f7c205b67c148bdc83b8dc4eaf70c06468a5"
] | [
"fairmodels/plotnine/stats/stat.py"
] | [
"from copy import deepcopy\n\nimport pandas as pd\n\nfrom ..aes import get_calculated_aes\nfrom ..layer import layer\nfrom ..utils import data_mapping_as_kwargs, remove_missing\nfrom ..utils import groupby_apply, copy_keys, uniquecols\nfrom ..utils import is_string, Registry, check_required_aesthetics\nfrom ..excep... | [
[
"pandas.concat"
]
] |
jasag/object-detection-darkflow | [
"eb7b9689b6e6af84fc29dc385ed5ed626afad431"
] | [
"darkflow/net/yolov2/test.py"
] | [
"import numpy as np\nimport math\nimport cv2\nimport os\n#from scipy.special import expit\n#from utils.box import BoundBox, box_iou, prob_compare\n#from utils.box import prob_compare2, box_intersection\nfrom darkflow.utils.box import BoundBox\nfrom darkflow.cython_utils.cy_yolo2_findboxes import box_constructor\n\n... | [
[
"numpy.max",
"numpy.exp"
]
] |
kuehno/FromScratch | [
"5d05afa2c51a2a54abb0ee61a1437583d90cba41"
] | [
"Reinforcement Learning/DQN.py"
] | [
"import numpy as np\nimport time\nfrom random import uniform\nimport cv2\n\n\nclass bcolors:\n HEADER = '\\033[95m'\n OKBLUE = '\\033[94m'\n OKCYAN = '\\033[96m'\n OKGREEN = '\\033[92m'\n WARNING = '\\033[93m'\n FAIL = '\\033[91m'\n ENDC = '\\033[0m'\n BOLD = '\\033[1m'\n UNDERLINE = '\\0... | [
[
"numpy.dot",
"numpy.hstack",
"numpy.maximum",
"numpy.sqrt",
"numpy.clip",
"numpy.stack",
"numpy.concatenate",
"numpy.max",
"numpy.argmax",
"numpy.zeros_like",
"numpy.mean",
"numpy.random.randn",
"numpy.random.rand",
"numpy.zeros",
"numpy.sum",
"numpy... |
BoPeng112/HAM | [
"ab623ef9c7a7030738e4f0329f0a8f890a1d1ebc"
] | [
"data/dataset/Amazon/CDs/attention_weight_test.py"
] | [
"import pickle\nimport pdb\nfrom scipy.stats import pearsonr\nimport numpy as np\n\nwith open('CDs_item_sequences.pkl', 'rb') as f:\n item_lists = pickle.load(f)\n\nwith open('att_dict.pkl', 'rb') as f:\n att = pickle.load(f)\n\nwith open('time_dict.pkl', 'rb') as f:\n time = pickle.load(f)\n\nfreq_dict = ... | [
[
"numpy.asarray",
"scipy.stats.pearsonr"
]
] |
rashmi123456789/sympy | [
"a8a3a3b026cc55aa14010fc7cd7909806b6e116c"
] | [
"sympy/matrices/tests/test_matrices.py"
] | [
"import random\n\nfrom sympy import (\n Abs, Add, E, Float, I, Integer, Max, Min, N, Poly, Pow, PurePoly, Rational,\n S, Symbol, cos, exp, log, expand_mul, oo, pi, signsimp, simplify, sin,\n sqrt, symbols, sympify, trigsimp, tan, sstr, diff, Function)\nfrom sympy.matrices.matrices import (ShapeError, Matri... | [
[
"numpy.array",
"scipy.sparse.csr_matrix"
]
] |
mydre/MultiLayerGRU | [
"00ad86c5aee4a88413ba575f0b5543c13e61338a"
] | [
"test.py"
] | [
"\"\"\"main.py\"\"\"\nimport argparse\nimport os\nos.environ['CUDA_VISIBLE_DEVICES'] = '1'\n\nimport numpy as np\nimport torch\n\nfrom solver import Solver\nfrom utils.utils import str2bool\nfrom bottleneck_transformer_pytorch import BottleStack\n\ndef main(args):\n\n torch.backends.cudnn.enabled = True\n tor... | [
[
"numpy.random.seed",
"torch.cuda.manual_seed",
"torch.set_printoptions",
"torch.manual_seed",
"numpy.set_printoptions"
]
] |
Ir1d/datasets | [
"2a04ce5208e53bcf9b5acacf690bb7446285176e",
"2a04ce5208e53bcf9b5acacf690bb7446285176e",
"2a04ce5208e53bcf9b5acacf690bb7446285176e"
] | [
"tensorflow_datasets/translate/flores.py",
"tensorflow_datasets/video/bair_robot_pushing.py",
"tensorflow_datasets/image/cifar.py"
] | [
"# coding=utf-8\n# Copyright 2020 The TensorFlow Datasets 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 ... | [
[
"tensorflow.compat.v2.io.gfile.GFile"
],
[
"numpy.reshape",
"tensorflow.compat.v2.compat.v1.io.tf_record_iterator",
"tensorflow.compat.v2.train.SequenceExample.FromString",
"numpy.frombuffer",
"tensorflow.compat.v2.io.gfile.listdir"
],
[
"tensorflow.compat.v2.io.gfile.GFile",
... |
rucsa/thesis_diversification | [
"732591d0a9e8042b45853dd1abe7f8f6ba769c9f"
] | [
"data/merge/make_msci_regions.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jun 19 17:42:03 2018\n\n@author: rucsa\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\n\ndef add_msci_regions():\n\n fundamentals_2016 = pd.read_hdf(\"../sources/data_ANR_2016.hdf5\").sort_index()\n fundamentals_2017 = pd.read_hdf(\"... | [
[
"pandas.read_hdf",
"pandas.read_excel",
"pandas.Series"
]
] |
SJTMusicTeam/Muskits | [
"b27eb27170b28cf6b20498bf9ea8732650939b93"
] | [
"muskit/train/trainer.py"
] | [
"#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# MIT License (https://opensource.org/licenses/MIT)\n\nimport argparse\nfrom contextlib import contextmanager\nimport dataclasses\nfrom dataclasses import is_dataclass\nfrom distutils.version import LooseVersion\nimport logging\nfrom pathlib import Path\nimport ... | [
[
"matplotlib.pyplot.Figure",
"matplotlib.pyplot.title",
"torch.cuda.current_device",
"matplotlib.use",
"matplotlib.pyplot.savefig",
"torch.tensor",
"torch.cuda.amp.autocast",
"torch.cuda.amp.GradScaler",
"torch.distributed.is_available",
"torch.no_grad",
"matplotlib.pypl... |
xhinker/nn_sample_code | [
"39eb501322af34a1d43e20d2d96d4ac1ee9c8104"
] | [
"nn_1_linear_one_weight.py"
] | [
"# Use plain Python code using Numpy to build a workable NN model\nimport numpy as np\nX = np.array([1,2,3,4],dtype=np.float32)\nw,w_r = 0.0,2.0\nY = np.array([(x*w_r) for x in X],dtype=np.float32)\nlearning_rate,num_epoch = 0.01,100\nfor epoch in range(num_epoch):\n for i,x in enumerate(X):\n ... | [
[
"numpy.array"
]
] |
ogrisel/fastmri-reproducible-benchmark | [
"f18a4f7d7fdfcc08fd28c84f2bed8dbdedab4a9a"
] | [
"fastmri_recon/training_scripts/nc_train_block.py"
] | [
"import math\nimport os\nimport os.path as op\nimport time\n\nimport pickle\nimport tensorflow as tf\nimport tensorflow.keras.backend as K\nfrom tensorflow.keras.callbacks import TensorBoard\nfrom tensorflow.keras.mixed_precision import experimental as mixed_precision\nfrom tensorflow_addons.callbacks import TQDMPr... | [
[
"tensorflow.keras.backend.batch_get_value",
"tensorflow.keras.mixed_precision.experimental.Policy",
"tensorflow.keras.mixed_precision.experimental.set_policy",
"tensorflow.zeros_like",
"tensorflow.keras.callbacks.TensorBoard"
]
] |
fede-vaccaro/cnnimageretrieval-pytorch | [
"56bf4ee865e9769801819943f75fff207f0c2f00"
] | [
"cirtorch/networks/imageretrievalnet.py"
] | [
"import os\nimport pdb\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\n\nimport torchvision\n\nfrom cirtorch.layers.pooling import MAC, SPoC, GeM, GeMmp, RMAC, Rpool\nfrom cirtorch.layers.netvlad import NetVLAD, MyNetVLAD\nfrom cirtorch.layers.normalization import L2N, PowerLaw\nf... | [
[
"torch.nn.Sequential",
"torch.zeros",
"torch.nn.Linear",
"torch.nn.Identity",
"torch.no_grad",
"torch.nn.functional.interpolate",
"torch.nn.ReLU",
"torch.utils.model_zoo.load_url"
]
] |
janosh/thermo | [
"0202a47ec8abacfd49b065ddd13ad060b0b9a1a3"
] | [
"thermo/data/load.py"
] | [
"from pandas import DataFrame, read_csv\n\nfrom thermo.utils import ROOT\n\n\ndef to_type(df: DataFrame, dtype: str = \"float32\") -> DataFrame:\n \"\"\"Convert all non-string columns to a different data type.\n E.g. float64 and int to float32.\n \"\"\"\n df_not_str = df.select_dtypes(exclude=[object]).... | [
[
"pandas.read_csv"
]
] |
rabernat/intake | [
"34dd38089ccb805759508659b5e8475034df2f0c"
] | [
"intake/container/serializer.py"
] | [
"#-----------------------------------------------------------------------------\n# Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors\n# All rights reserved.\n#\n# The full license is in the LICENSE file, distributed with this software.\n#--------------------------------------------------------------... | [
[
"pandas.read_msgpack"
]
] |
SecretMG/NTIRE21 | [
"1d22afc46a792f56693e32ed5df484fd910aa056"
] | [
"codebase/Exposure Fusion/ZYL/exposure_fusion.py"
] | [
"import cv2 as cv\r\nimport numpy as np\r\nimport os\r\nimport math\r\n\r\n\r\ndef softmax(x):\r\n return np.exp(x) / np.sum(np.exp(x), axis=0)\r\n\r\n\r\ndef load_img(dir): ## 载入图片\r\n\r\n img_name = os.listd... | [
[
"numpy.einsum",
"numpy.ones",
"numpy.std",
"numpy.prod",
"numpy.float32",
"numpy.array",
"numpy.exp",
"numpy.zeros",
"numpy.empty"
]
] |
Souvic108/startpadML | [
"198b80360f2eec4fa0757d29c05a1efb0b962828"
] | [
"NNwithNumpy.py"
] | [
"import numpy as np\ndef sigmoid(x):\n return 1 / (1 + np.exp(-x))\n# derivative of sigmoid\n# sigmoid(y) * (1.0 - sigmoid(y))\n# the way we use this y is already sigmoided\ndef dsigmoid(y):\n return y * (1.0 - y) \n\nclass NeuralNetwork(object):\n def __init__(self, input, hidden, output):\n \"\"\"... | [
[
"numpy.exp",
"numpy.random.randn",
"numpy.zeros",
"numpy.random.randint"
]
] |
hholst80/tenorflow | [
"79df325975402e03df89747947ff5b7f18407c52"
] | [
"tensorflow/python/ops/rnn.py"
] | [
"# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.python.ops.array_ops.constant",
"tensorflow.python.framework.tensor_shape.TensorShape",
"tensorflow.python.ops.array_ops.shape",
"tensorflow.python.ops.math_ops.reduce_max",
"tensorflow.python.framework.tensor_shape.matrix",
"tensorflow.python.framework.ops.op_scope",
"tens... |
TrungQuocNguyen/tf2-gnn | [
"9437041baa924e8ded4de56560ae77859ad18f81"
] | [
"tf2_gnn/data/ppi_dataset.py"
] | [
"from typing import Any, Dict, Iterable, List, Iterator, Tuple, Optional, Set\n\nimport numpy as np\nimport tensorflow as tf\nfrom dpu_utils.utils import RichPath\n\nfrom .graph_dataset import DataFold, GraphSample, GraphBatchTFDataDescription, GraphDataset\nfrom .utils import compute_number_of_edge_types, get_tied... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.shuffle"
]
] |
isseikz/keras-deeplab-v3-plus | [
"1043a9ea350f64bbe9d6c8114e907ecc5bc9d2cf"
] | [
"model.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\" Deeplabv3+ model for Keras.\nThis model is based on TF repo:\nhttps://github.com/tensorflow/models/tree/master/research/deeplab\nOn Pascal VOC, original model gets to 84.56% mIOU\n\nMobileNetv2 backbone is based on this repo:\nhttps://github.com/JonathanCMitchell/mobilenet_v2_kera... | [
[
"tensorflow.python.keras.layers.Conv2D",
"tensorflow.python.keras.applications.imagenet_utils.preprocess_input",
"tensorflow.python.keras.layers.DepthwiseConv2D",
"tensorflow.python.keras.layers.BatchNormalization",
"tensorflow.python.keras.layers.Activation",
"tensorflow.keras.backend.int... |
adoval4/CS231n-Convolutional-Neural-Networks-for-Visual-Recognition | [
"044f5b50bddd8626ebda6fa7ac71fed2292da1ad"
] | [
"assignment2/cs231n/classifiers/fc_net.py"
] | [
"from builtins import range\nfrom builtins import object\nimport numpy as np\n\nfrom cs231n.layers import *\nfrom cs231n.layer_utils import *\n\nclass TwoLayerNet(object):\n\t\"\"\"\n\tA two-layer fully-connected neural network with ReLU nonlinearity and\n\tsoftmax loss that uses a modular layer design. We assume a... | [
[
"numpy.dot",
"numpy.maximum",
"numpy.ones",
"numpy.max",
"numpy.random.randn",
"numpy.zeros",
"numpy.sum"
]
] |
hrnoh/speech-preprocessor | [
"14498803967a5bec96114053d9d2bae84b376cd3"
] | [
"preprocess_utils.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport librosa\nfrom librosa.filters import mel as librosa_mel_fn\nfrom librosa.core import load\nfrom hparams import hparams\nimport pyworld\nfrom pysptk import sptk\n\nclass Audio2Mel(nn.Module):\n def __init__(self, hpa... | [
[
"numpy.abs",
"torch.sqrt",
"numpy.nan_to_num",
"torch.from_numpy",
"torch.exp",
"torch.matmul",
"torch.log",
"torch.clamp",
"torch.hann_window",
"torch.nn.functional.pad",
"torch.stft"
]
] |
Erotemic/crall-thesis-2017 | [
"0f340b55dffb8545312abf0e43813f8b5c128888"
] | [
"fixes.py"
] | [
"# import bibtexparser\nfrom fixtex import fix_bib\nimport utool as ut\nimport numpy as np\nimport pandas as pd\n\npd.options.display.max_rows = 20\npd.options.display.max_columns = 40\npd.options.display.width = 160\npd.options.display.float_format = lambda x: '%.4f' % (x,)\n\n# PARSE DATABASE\n# full_bibman = fix... | [
[
"pandas.isnull",
"pandas.DataFrame.from_dict"
]
] |
RPGLite/analysis | [
"13f683beb26d77c6f7ae7de54808b0cb5acb9eee"
] | [
"legacy_scripts/DEPR_helper_fns.py"
] | [
"# William Kavanagh, April 2020\n\n\"\"\" Collection of helper functions for the analysis of data for the RPGLite project\n\"\"\"\n\nfrom pymongo import MongoClient\nfrom Constants import *\nimport numpy as np\n\n\nclient = MongoClient(\n \"mongodb://takuu.dcs.gla.ac.uk:27017/?readPreference=primary&appname=Mong... | [
[
"numpy.std",
"numpy.average"
]
] |
scottwittenburg/vcs | [
"5b9f17fb78f7ab186fc0132ab81ada043a7ba348"
] | [
"tests/test_vcs_1D_in_boxfill.py"
] | [
"import basevcstest\nimport numpy\n\n\nclass TestVCS1DBoxfill(basevcstest.VCSBaseTest):\n def testVCS1DBoxfill(self):\n d = numpy.sin(numpy.arange(100))\n\n b = self.x.createboxfill()\n\n self.x.plot(d, b, bg=self.bg)\n\n fnm = \"test_vcs_1d_in_boxfill.png\"\n self.checkImage(f... | [
[
"numpy.arange"
]
] |
rattaoup/invclr | [
"615ce0c51746cd6b13807b844f31453772fc944a"
] | [
"data/augmentation.py"
] | [
"import numbers\nimport torch\nfrom torch import nn\nfrom math import pi\n\n\ndef ColourDistortion(s=1.0):\n color_jitter = TensorColorJitter(0.8*s, 0.8*s, 0.8*s, 0.2*s)\n rnd_color_jitter = TensorRandomApply([color_jitter], p=0.8)\n rnd_gray = TensorRandomApply([TensorGrayscale()], p=0.2)\n color_disto... | [
[
"torch.ones",
"torch.sin",
"torch.zeros",
"torch.nn.ModuleList",
"torch.tensor",
"torch.matmul",
"torch.rand",
"torch.stack",
"torch.cos",
"torch.as_tensor"
]
] |
chenbinghui1/DSL | [
"0ac8c6e64804134e2d18ae5dcdd60ef03bdac028"
] | [
"mmdet/core/evaluation/eval_hooks.py"
] | [
"import os.path as osp\n\nimport torch.distributed as dist\nfrom mmcv.runner import DistEvalHook as BaseDistEvalHook\nfrom mmcv.runner import EvalHook as BaseEvalHook\nfrom torch.nn.modules.batchnorm import _BatchNorm\n\n\nclass EvalHook(BaseEvalHook):\n\n def _do_evaluate(self, runner):\n \"\"\"perform e... | [
[
"torch.distributed.broadcast"
]
] |
cviss-lab/Learning_based_Image_Scale_Estimation_for_Quantitative_Visual_Inspection | [
"0527af7464563bf96865800413c99e1ed14498ca"
] | [
"code/model_training.py"
] | [
"# import the necessary packages\nimport os, shutil, pickle, cv2, errno, json\nfrom tensorflow.keras import applications\nfrom tensorflow.keras.backend import clear_session\nfrom tensorflow.keras.layers import Dense, GlobalAveragePooling2D\nfrom tensorflow.keras.models import Model, load_model\nfrom tensorflow.kera... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.mean_absolute_error",
"pandas.DataFrame",
"sklearn.model_selection.KFold",
"matplotlib.pyplot.plot",
"numpy.round",
"tensorflow.keras.backend.clear_session",
"numpy.mean",
"tensorflow.keras.optimizers.SGD",
"pandas.read_csv",
... |
mhaseeb123/timemory | [
"815bb68edf8a36f309d43a911ef7e39da08ce5ae"
] | [
"timemory/test/test_rusage.py"
] | [
"#!@PYTHON_EXECUTABLE@\n# MIT License\n#\n# Copyright (c) 2018, The Regents of the University of California,\n# through Lawrence Berkeley National Laboratory (subject to receipt of any\n# required approvals from the U.S. Dept. of Energy). All rights reserved.\n#\n# Permission is hereby granted, free of charge, to ... | [
[
"numpy.fromfile",
"numpy.ones"
]
] |
XiaojiaoChen/origarm_ros | [
"59d1b05e9c13c50a9281ab2a670621f3f04d8cc1"
] | [
"scripts/pythonTest.py"
] | [
"#!/usr/bin/env python3\n#coding=utf-8\nimport numpy as np\nfrom numpy import linalg as LA\n\nfrom pydrake.common import FindResourceOrThrow\nfrom pydrake.math import RigidTransform\nfrom pydrake.multibody.parsing import Parser\nfrom pydrake.systems.analysis import Simulator\nfrom pydrake.all import MultibodyPlant\... | [
[
"numpy.dot",
"numpy.set_printoptions",
"numpy.round",
"numpy.random.rand",
"numpy.zeros",
"numpy.sum"
]
] |
xptree/BioNEV | [
"9a5272af6f705eccaf98b387f2dafbe08ee066b8"
] | [
"src/bionev/evaluation.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import accuracy_score, average_precision_score, f1_score, roc_auc_score\nfrom sklearn.multiclass import OneVsRestClassifier\nfrom sklearn.preprocessing import MultiLabelBinarizer\n\nfrom bionev.utils import *\n\n\n... | [
[
"sklearn.metrics.roc_auc_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.preprocessing.MultiLabelBinarizer",
"sklearn.metrics.average_precision_score",
"sklearn.metrics.f1_score",
"sklearn.metrics.accuracy_score"
]
] |
edithlzh/Automation_VNL_Depth_Estimation | [
"694955aba1bc028dfb448c88c3cb2a701865b283"
] | [
"VNL_Monocular_Depth_Prediction/lib/models/VNL_loss.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\n\n\nclass VNL_Loss(nn.Module):\n \"\"\"\n Virtual Normal Loss Function.\n \"\"\"\n def __init__(self, focal_x, focal_y, input_size,\n delta_cos=0.867, delta_diff_x=0.01,\n delta_diff_y=0.01, delta_diff_z=0.01,\n ... | [
[
"torch.abs",
"torch.mean",
"torch.norm",
"torch.cat",
"numpy.asarray",
"numpy.arange",
"torch.sum",
"numpy.tile",
"numpy.random.shuffle",
"numpy.ones",
"torch.tensor",
"torch.bmm",
"torch.sort",
"torch.cross"
]
] |
whdgusdl48/Perfect_ML | [
"ae49d2dff62f872c74355a5bbe4d768d45a1d957",
"ae49d2dff62f872c74355a5bbe4d768d45a1d957"
] | [
"transformer.py",
"mask_former/modeling/heads/pixel_decoder.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# Modified by Bowen Cheng from: https://github.com/facebookresearch/detr/blob/master/models/transformer.py\n\"\"\"\nTransformer class.\nCopy-paste from torch.nn.Transformer with modifications:\n * positional encodings are passed in MHattention\n * extra LN ... | [
[
"torch.nn.Dropout",
"torch.nn.MultiheadAttention",
"torch.einsum",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.nn.functional.interpolate",
"torch.nn.init.xavier_uniform_",
"torch.stack"
],
[
"torch.nn.init.xavier_uniform... |
Wvsnow/fractal | [
"14990477d4626dd1f5acec2551328cdc36b00987"
] | [
"src/client/fractal/factory/mandelbrot_extend.py"
] | [
"# -*- coding: utf-8 -*-\n# @desc:\n\nimport numpy as np\n\nimport random\nfrom client.fractal import get_divide_pnt\nfrom client.fractal.tools.draw_tools import draw_points\n\n\ndef getEscapeTime(c):\n \"计算参数c的逃逸时间,该逃逸时间将用作点的颜色\"\n z = 0\n for i in range(100):\n if abs(z) > 2:\n return i... | [
[
"numpy.frompyfunc",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
coherent17/pandas_practice | [
"f7e83bab859e5e9aa6cc0a5528cb7b63a9fe795c"
] | [
"pd2.py"
] | [
"import pandas as pd\n\n#1. build the dataframe\na=pd.DataFrame([[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15]])\nprint(a)\n# 0 1 2 3 4\n#0 1 2 3 4 5\n#1 6 7 8 9 10\n#2 11 12 13 14 15\n#直的是index,橫的是column\n\n#setting index and column\nb=pd.DataFrame(a.values,index=['a','b','c'],column... | [
[
"pandas.concat",
"pandas.Series",
"pandas.DataFrame"
]
] |
mreismendes/AutoTS | [
"a874b531ae1f06db69fdd1211ddc0ca908d033c9"
] | [
"autots/evaluator/metrics.py"
] | [
"\"\"\"Tools for calculating forecast errors.\"\"\"\nimport warnings\nimport numpy as np\nimport pandas as pd\n\n\ndef smape(actual, forecast):\n \"\"\"Expect two, 2-D numpy arrays of forecast_length * n series.\n Allows NaN in actuals, and corresponding NaN in forecast, but not unmatched NaN in forecast\n ... | [
[
"numpy.nanmax",
"pandas.concat",
"numpy.isnan",
"pandas.DataFrame",
"numpy.nansum",
"numpy.diff",
"numpy.nanmean",
"numpy.count_nonzero",
"numpy.array",
"numpy.where",
"numpy.sum"
]
] |
tianle91/faas | [
"6b9062c62ebd99b6eef0cf6d771303919c03d62e"
] | [
"faas/transformer/tests/test_scaler.py"
] | [
"import pandas as pd\nfrom pyspark.sql import DataFrame, SparkSession\n\nfrom faas.transformer.scaler import NumericScaler, StandardScaler, get_mean_std\n\n\ndef create_test_df(spark: SparkSession, n: int = 100) -> DataFrame:\n pdf = pd.DataFrame({\n 'p': ['abcdefghijklmnopqrstuvwxyz'[i % 26] for i in ran... | [
[
"pandas.testing.assert_frame_equal"
]
] |
Diego999/pygcn | [
"d3e4f39f68ff90abb19ea3da54812574a4f8b151"
] | [
"pygcn/train.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport time\nimport argparse\nimport numpy as np\n\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.autograd import Variable\n\nfrom pygcn.utils import load_data, accuracy\nfrom pygcn.models import GCN\... | [
[
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.nn.functional.nll_loss",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.autograd.Variable"
]
] |
huxin711/ColossalAI-Examples | [
"fa3560683dec891315d5356e76c10ff20e41266f"
] | [
"image/simclr/train_linear.py"
] | [
"from colossalai.nn.metric import Accuracy\nimport torch\nimport colossalai\nfrom colossalai.core import global_context as gpc\nfrom colossalai.logging import get_dist_logger\nfrom colossalai.trainer import Trainer, hooks\nfrom colossalai.utils import get_dataloader, MultiTimer\nfrom colossalai.nn.lr_scheduler impo... | [
[
"torch.nn.CrossEntropyLoss",
"torch.load"
]
] |
zhujiagang/realtime-for-test | [
"8d15fa42a11689a91231813194230ce6a77a7d05"
] | [
"my_test_0.5.py"
] | [
"\"\"\"\n Copyright (c) 2017, Gurkirt Singh\n\n This code and is available\n under the terms of MIT License provided in LICENSE.\n Please retain this notice and LICENSE if you use\n this file (or any portion of it) in your project.\n ---------------------------------------------------------\n\"\"\... | [
[
"torch.set_default_tensor_type",
"torch.cuda.synchronize",
"numpy.hstack",
"torch.load",
"numpy.asarray",
"torch.utils.data.DataLoader",
"torch.cuda.is_available"
]
] |
jrmontag/tweet-image-labels | [
"b11f4a63b6867d8f1d406b25231a29f1cbcfe476",
"b11f4a63b6867d8f1d406b25231a29f1cbcfe476"
] | [
"bin/label_images.py",
"bin/simple-demo.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n__author__=\"Josh Montague\"\n__license__=\"MIT License\"\n\nimport argparse\nfrom io import BytesIO\nimport logging\nimport sys\n\nimport numpy as np\nfrom PIL import Image\nfrom pprint import pprint\nimport requests\ntry:\n import ujson as json\n JSON_error =... | [
[
"numpy.expand_dims"
],
[
"numpy.expand_dims"
]
] |
PaolaRB/class6-homework | [
"fb951ff5304f828021d27e2c4af324ff223d0d7b"
] | [
"dataset-processor.py"
] | [
"import os\nimport argparse\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nimport random as rnd\nsns.set(style=\"ticks\", color_codes=True)\n\n# Create directories\nos.makedirs('plots/matplotlib', exist_ok=True)\nos.makedirs('plots/seaborn', exist_ok=True)\n\n# Tre... | [
[
"pandas.read_csv",
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.close",
"matplotlib.pyplot.suptitle"
]
] |
HuangCongQing/sklearn | [
"2728838bc820012a3062c157c80480abb6ac134f"
] | [
"PointCloud_Classification_using_ML-master/Training/train_xgb.py"
] | [
"# -*- coding: utf-8 -*-\n\n#################\n# train xgboost #\n#################\n\nfrom sklearn import metrics\nfrom xgboost.sklearn import XGBClassifier\nimport numpy as np \nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.metrics import fbeta_score, make_scorer\n\n# load data for training\nfeat... | [
[
"sklearn.externals.joblib.dump",
"sklearn.model_selection.GridSearchCV",
"sklearn.metrics.make_scorer",
"numpy.loadtxt"
]
] |
clydemcqueen/orca2 | [
"9a8add5e65201e84af19f037c187d0ce6ec702e3"
] | [
"orca_base/scripts/plot_corners.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) 2020, Clyde McQueen.\n# All rights reserved.\n#\n# Software License Agreement (BSD License 2.0)\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#\n# * Redistributio... | [
[
"matplotlib.use",
"matplotlib.pyplot.get_backend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close"
]
] |
Lucas2012/simplified-SIM-structure-inference-machine | [
"45998fd52ed19753ed0c8c3658cde7e3d964218c"
] | [
"caffe-master/python/MyLayers/structured_gate_background_2.py"
] | [
"import unittest\nimport tempfile\nimport os\nimport numpy\n\nimport caffe\n\nclass structured_gate(caffe.Layer):\n \"\"\"A layer that initialize messages for recurrent belief propagation\"\"\"\n\n def setup(self, bottom, top):\n self.nScene = 5\n self.nAction = 7\n self.nPeople = 14\n ... | [
[
"numpy.multiply",
"numpy.ones",
"numpy.tanh",
"numpy.zeros",
"numpy.sum"
]
] |
DongxiaW/mixing-patterns | [
"e841a934b826ecc98bf443026c32e7c6b7aa75bc",
"e841a934b826ecc98bf443026c32e7c6b7aa75bc"
] | [
"analysis_results/scripts/fig_6.py",
"analysis_results/scripts/make_matrices_diff_aggregations.py"
] | [
"\"\"\"Plot figure 6: attack rates vs R0.\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import linregress\n\nimport matplotlib as mplt\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as colors\nimport matplotlib.cm as cm\nimport matplotlib.font_manager as font_manager\n\nimport cmocean... | [
[
"pandas.read_csv",
"numpy.linalg.eigvals",
"matplotlib.pyplot.minorticks_off",
"numpy.arange",
"matplotlib.pyplot.subplots",
"scipy.stats.linregress",
"numpy.loadtxt"
],
[
"pandas.read_csv",
"numpy.allclose",
"numpy.arange",
"numpy.ones",
"numpy.savetxt",
"n... |
Hakuna-Patata/BU_MSDS_PTW | [
"4759cb2db3e63ae5722bd42771e4d228dfbc733d"
] | [
"DSC 530 - Data Exploration and Analysis/ThinkStats2/code/analytic.py"
] | [
"\"\"\"This file contains code used in \"Think Stats\",\nby Allen B. Downey, available from greenteapress.com\n\nCopyright 2010 Allen B. Downey\nLicense: GNU GPLv3 http://www.gnu.org/licenses/gpl.html\n\"\"\"\n\nfrom __future__ import print_function, division\n\nimport math\n\nimport numpy as np\nimport pandas\n\ni... | [
[
"numpy.random.normal",
"pandas.DataFrame"
]
] |
cameronwp/MMGIS | [
"5e6277bd4f0c8ff77cd12dce51d41abffe0ac394"
] | [
"auxiliary/gdal2tiles4extent/gdal2tiles4extent.py"
] | [
"#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n# ******************************************************************************\r\n# $Id$\r\n#\r\n# Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/)\r\n# Support: BRGM (http://www.brgm.fr)\r\n# Purpose: Convert a raster into TMS (Tile ... | [
[
"numpy.zeros"
]
] |
smivv/tensorflow-grpc-serving | [
"417b4d741851355204d6079c31e58ac3725f09b4"
] | [
"classes/classifier.py"
] | [
"import time\nimport numpy as np\nimport tensorflow as tf\n\nfrom classes.logger import Logger\n\n\nclass Classifier:\n\n def __init__(self, graph_path, labels_path, input_layer, output_layer,\n input_height=224, input_width=224, input_mean=0, input_std=255):\n\n self.logger = Logger()\n ... | [
[
"tensorflow.gfile.GFile",
"numpy.squeeze",
"tensorflow.image.decode_png",
"tensorflow.image.decode_gif",
"tensorflow.string_split",
"tensorflow.image.central_crop",
"tensorflow.Graph",
"tensorflow.import_graph_def",
"tensorflow.read_file",
"tensorflow.image.decode_bmp",
... |
sberl/supersid-1 | [
"6368bc1be2a7e01ec4a8a08baa8a15283d87c8dc"
] | [
"supersid/wxsidviewer.py"
] | [
"\"\"\"\nClass wxSidViewer implements a graphical user interface for SID on wxPython.\n\nAbout Threads and wxPython\nhttp://www.blog.pythonlibrary.org/2010/05/22/wxpython-and-threads/\n\nEach Viewer must implement:\n- __init__(): all initializations\n- run(): main loop to get user input\n- close(): cleaning up\n- s... | [
[
"matplotlib.use",
"matplotlib.backends.backend_wxagg.FigureCanvasWxAgg",
"matplotlib.figure.Figure"
]
] |
pgleeson/bmtk | [
"992cbf26e1c543331a456873bd3a501cd267f678"
] | [
"bmtk/simulator/filternet/lgnmodel/movie.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nfrom .utilities import convert_tmin_tmax_framerate_to_trange\n\n\nclass Movie(object):\n def __init__(self, data, row_range=None, col_range=None, labels=('time', 'y', 'x'),\n units=('second', 'pixel', 'pixel'), frame_rate=None, t_range=None):\... | [
[
"matplotlib.pyplot.imshow",
"numpy.linspace",
"numpy.logical_and",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.sin",
"numpy.cos",
"matplotlib.pyplot.colorbar",
"numpy.testing.assert_almost_equal",
"numpy.diff",
"numpy.array",
"... |
plang85/tcstats | [
"0f49669e5faf8680c5e3609fd210debb12c416a0",
"0f49669e5faf8680c5e3609fd210debb12c416a0",
"0f49669e5faf8680c5e3609fd210debb12c416a0"
] | [
"adjustText.py",
"cost.py",
"effortvstime.py"
] | [
"from __future__ import division\nimport sys\nfrom matplotlib import pyplot as plt\nfrom itertools import product\nimport numpy as np\nfrom operator import itemgetter\n\nif sys.version_info >= (3, 0):\n xrange = range\n\ndef get_text_position(text, ax=None):\n ax = ax or plt.gca()\n x, y = text.get_positio... | [
[
"matplotlib.pyplot.gca",
"numpy.abs",
"matplotlib.pyplot.title",
"numpy.unique",
"matplotlib.pyplot.savefig",
"numpy.sign",
"numpy.max",
"numpy.zeros_like",
"numpy.array",
"numpy.logical_and",
"numpy.where"
],
[
"numpy.ceil",
"numpy.array",
"numpy.floor"... |
kishdubey/sentichat_streamlit | [
"b9ee2e16db6b1ecd9785e8b172c396ba5b630e26"
] | [
"stream.py"
] | [
"import streamlit as st\nimport pickle\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.preprocessing.text import Tokenizer\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences\n\ndef predict(message):\n model=load_model('keras/model.h5')\n with open('keras/tokenizer.pickle... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.preprocessing.sequence.pad_sequences"
]
] |
mosalaheg/sklearn | [
"d275bdfaf0db4b01f45231889a37a8e004e2f77c",
"d275bdfaf0db4b01f45231889a37a8e004e2f77c"
] | [
"Data Preparetion/1.4 Feature Selection/A.4.2.2.generic_univeriate_select_ex.py",
"Data Preparetion/1.3 Metrics Module/A.3.12.1.roc_curve.py"
] | [
"from sklearn.datasets import load_breast_cancer\nfrom sklearn.feature_selection import GenericUnivariateSelect, chi2\n#X, y = load_breast_cancer(return_X_y=True)\ndataset = load_breast_cancer()\nX, y = dataset.data, dataset.target\nprint(X.shape)\n\ntransformer = GenericUnivariateSelect(chi2, 'k_best', param=5)\nX... | [
[
"sklearn.feature_selection.GenericUnivariateSelect",
"sklearn.datasets.load_breast_cancer"
],
[
"sklearn.metrics.roc_curve"
]
] |
chaoyu1999/DRUNet | [
"cfe5e4183f601b6480d3a384a0413c534b742fa9"
] | [
"model/DRUNet_parts.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass InputCov(nn.Module):\n \"\"\"\n 对输入的原始图像进行卷积\n \"\"\"\n\n def __init__(self, in_channels, out_channels):\n super().__init__()\n self.input_cov = nn.Sequential(\n nn.Conv2d(in_channels, out_channels, kernel_size=(3, 3), padding=(1, ... | [
[
"torch.div",
"torch.add",
"torch.nn.Conv2d",
"torch.sum",
"torch.nn.PixelShuffle",
"torch.nn.ReLU"
]
] |
DonatoMeoli/NumericalOptimization | [
"e60144458026a6ddbe1612f92b838c342db572eb"
] | [
"optiml/ml/neural_network/_base.py"
] | [
"import warnings\nfrom abc import ABC\n\nimport autograd.numpy as np\nfrom sklearn.base import BaseEstimator, RegressorMixin, ClassifierMixin\nfrom sklearn.exceptions import ConvergenceWarning\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\n\nfrom .activations impo... | [
[
"sklearn.model_selection.train_test_split"
]
] |
shonohs/shtorch_models | [
"afc20dbc9fd272a74ca08ec460401721b1476e72"
] | [
"mitorch/models/heads/mnas_fpn.py"
] | [
"\"\"\"MnasFPN: Learning Latency-aware Pyramid Architecture for Object Detection on Mobile Devices\n (https://arxiv.org/pdf/1912.01106.pdf)\n\nThis is an implementation of the figure 2 architecture in the paper.\n\"\"\"\nimport collections\nimport torch\nfrom ..model import Model\nfrom ..modules import Conv2dAct,... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.interpolate"
]
] |
jsmithedin/envirotemp | [
"31dd6a7965d35fe6bd0a8555811bbbbb46308f6e"
] | [
"envirotemp.py"
] | [
"#!/usr/bin/env python3\n\nimport os\nimport time\nimport numpy\nimport colorsys\nfrom PIL import Image, ImageDraw, ImageFont, ImageFilter\nfrom fonts.ttf import RobotoMedium as UserFont\n\nimport ST7735\nfrom bme280 import BME280\nfrom ltr559 import LTR559\n\nimport pytz\nfrom pytz import timezone\nfrom astral.geo... | [
[
"numpy.var",
"numpy.polyfit",
"numpy.mean"
]
] |
kyungjin96/12_04_hackathon | [
"5792aff9cecebf88931a83072f6f97c85a66e9bc"
] | [
"ddrawa/torchcode.py"
] | [
"import torch\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torchvision\nimport torchvision.datasets as datasets\nimport torchvision.models as models\nimport torchvision.transforms as transforms\nimport pickle\n\ndef learn():\n dataset = datasets.ImageFolder(\n '/content/drive/MyDr... | [
[
"torch.device",
"torch.nn.Linear",
"torch.nn.functional.cross_entropy",
"torch.utils.data.DataLoader"
]
] |
Emberwhirl/squidpy | [
"456c49ac9149e16562617a8a4236a9faa2c0480d"
] | [
"squidpy/im/_feature_mixin.py"
] | [
"from __future__ import annotations\n\nfrom typing import Any, Dict, Union, Callable, Iterable, Sequence, TYPE_CHECKING\nfrom typing_extensions import Protocol\n\nimport numpy as np\nimport xarray as xr\n\nfrom skimage.util import img_as_ubyte\nfrom skimage.feature import graycoprops, graycomatrix\nimport skimage.m... | [
[
"numpy.min",
"numpy.issubdtype",
"numpy.quantile",
"numpy.max",
"numpy.std",
"numpy.mean",
"numpy.array",
"numpy.histogram"
]
] |
Dwopplee/frccontrol | [
"8dac9373515697a6d7d92bd0d267fb4c156677cb"
] | [
"frccontrol/system_writer.py"
] | [
"\"\"\"A class that handles writing out matrices of a system to a C++ or Java file.\n\"\"\"\n\nimport numpy as np\nimport os\n\n\nclass SystemWriter:\n def __init__(\n self,\n system,\n class_name,\n header_path_prefix,\n header_extension,\n period_variant=False,\n ):... | [
[
"numpy.linalg.inv"
]
] |
xuyoji/AlphaZero_Gomoku | [
"f693a55864ba1f436dc516dd1605fe55a507b944"
] | [
"game.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@author: Junxiao Song & xuyj & okarev-TT-33\n\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\nfrom GUI_v1_4 import GUI\n\nclass Board(object):\n \"\"\"board for the game\"\"\"\n\n def __init__(self, **kwargs):\n self.width = int(kwargs.get('width', ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
yuanming-hu/elements | [
"e9eccbd61ac45f178ea88b7b405aa2c01549337d"
] | [
"demo/demo_quantized_simulation_letters.py"
] | [
"import taichi as ti\nimport math\nimport time\nimport numpy as np\nfrom plyfile import PlyData, PlyElement\nimport os\nimport utils\nfrom engine.mpm_solver import MPMSolver\nimport argparse\n\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser.add_argument('-s',\n '--sho... | [
[
"numpy.zeros",
"numpy.stack"
]
] |
thisisiron/dcgan-tf | [
"4833412a2fc65909576c0adff07c5cdadadc4249"
] | [
"dcgan/utils.py"
] | [
"import tensorflow as tf\nimport matplotlib.pyplot as plt\n\n\ndef discriminator_loss(loss_object, real_output, fake_output):\n real_loss = loss_object(tf.ones_like(real_output), real_output)\n fake_loss = loss_object(tf.zeros_like(fake_output), fake_output)\n total_loss = real_loss + fake_loss\n return... | [
[
"matplotlib.pyplot.imshow",
"tensorflow.cast",
"tensorflow.ones_like",
"tensorflow.zeros_like",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
]
] |
rbracco/fastai2 | [
"2f72da76d37ad4fd831ba48ea9fb2b3be4ec1723"
] | [
"fastai2/layers.py"
] | [
"#AUTOGENERATED! DO NOT EDIT! File to edit: dev/01_layers.ipynb (unless otherwise specified).\n\n__all__ = ['Identity', 'Lambda', 'PartialLambda', 'View', 'ResizeBatch', 'Flatten', 'Debugger', 'sigmoid_range',\n 'SigmoidRange', 'AdaptiveConcatPool2d', 'PoolType', 'pool_layer', 'PoolFlatten', 'NormType', '... | [
[
"torch.nn.utils.weight_norm",
"torch.nn.utils.spectral_norm"
]
] |
Anysub/TKDESubmission | [
"5c209865429cc711a40d6b529c7f3ab26083633b"
] | [
"nn_modules.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\n nn_modules.py\n\"\"\"\nimport os\nimport psutil\nimport sys\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.autograd import Variable\nimport gc\n\nimport numpy as np\nfrom scipy import sparse\nfrom helpers import to_numpy\n\nimport inspect\... | [
[
"torch.nn.functional.softmax",
"torch.randint",
"torch.max",
"torch.zeros",
"torch.randperm",
"torch.cat",
"torch.nn.functional.dropout",
"torch.sum",
"torch.nn.Embedding",
"torch.tanh",
"torch.FloatTensor",
"torch.where",
"torch.split",
"torch.nn.Dropout",
... |
sharksmhi/stations | [
"e0b893d4f14239452ced4b1d0b4fd48f2a444c5f"
] | [
"stations/handler.py"
] | [
"# Copyright (c) 2020 SMHI, Swedish Meteorological and Hydrological Institute \n# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).\n\"\"\"\nCreated on 2020-09-25 13:43\n\n@author: a002028\n\n\"\"\"\nimport pandas as pd\n\n\nclass Meta(dict):\n \"\"\"\n \"\"\"\n def __init__(sel... | [
[
"pandas.Series"
]
] |
chris4540/DD2430-ds-proj | [
"b876efabe949392b27a7ebd4afb2be623174e287"
] | [
"network/clsf_net.py"
] | [
"import torch.nn as nn\n\n\nclass ClassificationNet(nn.Module):\n \"\"\"\n A feed forward network to map embedding vector to classfying layer\n \"\"\"\n\n def __init__(self, emb_dim=512, nb_classes=46):\n super().__init__()\n self.emb_dim = emb_dim\n self.nb_classes = nb_classes\n ... | [
[
"torch.nn.Linear",
"torch.nn.ReLU"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.