repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
tijsmaas/Graph-WaveNet
[ "353ea28687b425c584039278b5705e2a3651094d" ]
[ "model_static.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport sys\n\n\n# RNN model for every sensor\nclass StaticNet(nn.Module):\n def __init__(self, device, num_nodes, dropout=0.3, supports=None, gcn_bool=True, addaptadj=True, aptinit=None, in_dim=2,out_dim=1...
[ [ "torch.broadcast_tensors", "torch.nn.Conv2d", "torch.arange", "torch.zeros" ] ]
tzemicheal/cuml
[ "377f3c2773e3fc64d93d3d64a3f2fcd6c8759044", "377f3c2773e3fc64d93d3d64a3f2fcd6c8759044" ]
[ "python/cuml/test/experimental/test_explainer_permutation_shap.py", "python/cuml/_thirdparty/sklearn/preprocessing/_data.py" ]
[ "#\n# Copyright (c) 2020, NVIDIA CORPORATION.\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 applicabl...
[ [ "sklearn.datasets.make_classification", "numpy.allclose", "sklearn.model_selection.train_test_split", "numpy.ones", "sklearn.datasets.make_regression", "numpy.zeros" ], [ "scipy.stats.norm.ppf", "scipy.optimize.brent", "scipy.stats.norm.cdf" ] ]
pawlodkowski/Movie_Recommender
[ "2294081ec439b43feb2596835aa3508c7a3e4d28" ]
[ "MovieRec/mvr/core.py" ]
[ "###############################################################################\n''' \nSpicy Movie Recommender 5000\n\n\n# todo\n# apply superior filtering algorithm\n# magic merger returns duplicates sometimes...\n# prepare data for sending it to the website --> convert to IMDB Ids\n'''\n#########################...
[ [ "numpy.dot", "pandas.merge", "pandas.concat", "sklearn.metrics.pairwise.cosine_similarity", "pandas.DataFrame", "pandas.read_sql" ] ]
pekzeki/stlthmd_task
[ "0824d17a727f4a09a4ba2c7f909b12d0880cd289" ]
[ "src/features/build_features.py" ]
[ "from nltk.tokenize import RegexpTokenizer\nfrom sklearn.model_selection import train_test_split\nfrom collections import Counter\nfrom nltk.stem import PorterStemmer, WordNetLemmatizer, SnowballStemmer\nfrom sklearn.preprocessing import LabelEncoder\nimport re\nimport string\nfrom sklearn.preprocessing import Labe...
[ [ "sklearn.preprocessing.LabelEncoder", "sklearn.model_selection.train_test_split" ] ]
marionleborgne/EIT_Dashboard
[ "057e05d20325fa6a9b9b0183f63a73c8b7e6cd3b" ]
[ "sandbox/sand/OpenEIT/reconstruction/pyeit/eit/fem.py" ]
[ "# coding: utf-8\n# pylint: disable=invalid-name, no-member, too-many-locals\n# pylint: disable=too-many-instance-attributes\n\"\"\" 2D/3D FEM routines \"\"\"\n# Copyright (c) Benyuan Liu. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\nfrom __future__ import divisio...
[ [ "numpy.dot", "numpy.ix_", "numpy.hstack", "numpy.linalg.inv", "scipy.sparse.csr_matrix", "numpy.ones", "numpy.linalg.det", "numpy.isscalar", "numpy.cross", "numpy.repeat", "numpy.array", "numpy.zeros", "numpy.vstack" ] ]
SynStratos/dim_ae
[ "8840437574e7e3fee24fd78af6d1e74c6df4b68b" ]
[ "dimae/autoencoders/autoencoder.py" ]
[ "import numpy as np\nimport math\nfrom tensorflow.keras.layers import Input, Dense\nfrom tensorflow.keras import Model\n\n\nclass AE(Model):\n def __init__(self,\n n_input=None,\n code_nodes=None,\n summary=False,\n _code_activation='relu',\n ...
[ [ "numpy.log", "numpy.logspace", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflow.keras.layers.Input" ] ]
aceilers/TheCannon
[ "c140a0c9555bb98956b013d1a9d29eb94ed4c514" ]
[ "code/lamost/xcalib_5labels/paper_plots/teff_logg_training.py" ]
[ "import pyfits\nimport matplotlib.pyplot as plt\nfrom matplotlib import rc\nimport matplotlib.gridspec as gridspec\nfrom matplotlib.colors import LogNorm\nplt.rc('text', usetex=True)\nplt.rc('font', family='serif')\nimport numpy as np\n\n\ndirec = \"/Users/annaho/TheCannon/data/lamost_paper\"\nsnr = np.load(\"%s/re...
[ [ "matplotlib.pyplot.gca", "matplotlib.colors.LogNorm", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "matplotlib.pyplot.colorbar", "numpy.load", "matplotlib.pyplot.show", "numpy.vstack" ] ]
szqtc/MyMachineLearningNotes
[ "87fa278290d211fa9390dfdfb081acd90ceaeab9" ]
[ "sharedcode/linear_models.py" ]
[ "import numpy as np\nfrom . import kernels\n\nclass linear_regressor:\n \n def __init__(self):\n self.w_, self.b_ = None, 0.\n \n def fit(self, X, y):\n \"\"\"\n Parameters\n ------------\n X : numpy array, (m, n)\n features of training examples\n ...
[ [ "numpy.diag", "numpy.log", "numpy.maximum", "numpy.unique", "numpy.linalg.inv", "numpy.eye", "numpy.ones", "numpy.array", "numpy.exp", "numpy.zeros" ] ]
progrunner17/blueoil
[ "5cbe8b2ceebaaa7a6582a377031ae92855bed0aa" ]
[ "lmnet/lmnet/data_processor.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Copyright 2018 The Blueoil 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.apa...
[ [ "numpy.eye", "numpy.array" ] ]
emsloate/nba-movement-data
[ "d2ed96e7ac4f1060e60561bf9c4fc77bf9c63f27" ]
[ "scripts/game_df.py" ]
[ "\n# coding: utf-8\n\n# In[5]:\n\nimport pandas as pd\nimport os\nimport glob\nimport numpy as np\n# In[6]:\n\n#get game data\ndef get_game(path):\n game = pd.read_json(path)\n #get ids from events, home team and visiting team info\n game['event_id'] = game['events'].apply(lambda x: int(x['eventId']))\n ...
[ [ "pandas.merge", "pandas.concat", "pandas.read_csv", "numpy.arctan", "numpy.linalg.norm", "pandas.DataFrame", "pandas.read_json", "numpy.argsort" ] ]
nithinksath96/Small_object_detection
[ "b2ccd29d128487909f92e4fc796f72a0a4458e32" ]
[ "argo_data_scripts/det/models/darknet.py" ]
[ "from os.path import basename\r\nimport numpy as np\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nfrom mmdet.models.registry import BACKBONES\r\n\r\nclass weightedFeatureFusion(nn.Module): # weighted sum of 2 or more layers https://arxiv.org/abs/1911.09070\r\n def __init...
[ [ "torch.nn.Sequential", "torch.sigmoid", "numpy.fromfile", "torch.zeros", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.from_numpy", "torch.nn.MaxPool2d", "torch.nn.Upsample", "torch.nn.LeakyReLU", "torch.nn.functional.interpolate", "torch.nn.Batc...
iorodeo/lia_video
[ "a362ea70c63e31da2e24401b66f4cfd058417d6c" ]
[ "lia_progress/nodes/progress_bar_node.py" ]
[ "#!/usr/bin/env python\nimport roslib\nroslib.load_manifest('lia_progress')\nimport rospy\nimport numpy\nimport cv\n\nfrom sensor_msgs.msg import Image\nfrom cv_bridge.cv_bridge import CvBridge \nfrom cv_bridge.cv_bridge import CvBridgeError\nfrom lia_messages.msg import ProgressMsg\n\nclass Progress_Bar(object):\n...
[ [ "numpy.array", "numpy.ones" ] ]
runxi-shen/Modeling-Evolution-at-bam
[ "22e00a9da4f434335cdbbb553aa519145c60279e" ]
[ "vcf2fasta.py" ]
[ "#!/home/rs2474/anaconda3/envs/imktData/bin/python\n\n### Convert VCF ouput from SLiM to fasta file for iMKT analysis\n\nimport pandas as pd\nimport numpy as np\nimport sys\n\n\ndef output_ref_sub_seq(slim_out, gen):\n with open(slim_out, 'r') as f:\n f_lines = f.readlines()\n ## get the original refer...
[ [ "pandas.read_csv" ] ]
Kar1suMAX/python-machine-learning-book-2nd-edition
[ "3150aee458592c20acf974f370e0a7399d373e7e" ]
[ "Chap10.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.linear_model import RANSACRegressor\nfrom sklearn.model_selection import train_test_split\nimport scipy ...
[ [ "sklearn.ensemble.RandomForestRegressor", "matplotlib.pyplot.legend", "numpy.dot", "sklearn.metrics.r2_score", "numpy.sqrt", "sklearn.linear_model.ElasticNet", "sklearn.preprocessing.PolynomialFeatures", "sklearn.metrics.mean_squared_error", "matplotlib.pyplot.plot", "matpl...
b1quint/samfp
[ "1cd9b85851c02dc61a2294d67a309f62083d358d" ]
[ "samfp/phmxtractor.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf8 -*-\n\"\"\"\n Phase-map eXtractor\n by Bruno C Quint\n\n v1a - Phase extraction for Fabry-Perot.\n 2014.04.16 15:45 - Created an exception for errors while trying to access\n 'CRPIX%' cards on cube's header.\n\n Todo\n ----\n ...
[ [ "numpy.split", "scipy.polyfit", "numpy.linspace", "scipy.signal.correlate", "matplotlib.pyplot.plot", "numpy.max", "numpy.argmin", "numpy.mean", "scipy.signal.general_gaussian", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.empty_like", "matplotlib.py...
dbstein/ipde
[ "834e16a617f47a3eabe3307ba151d5b7db527b30" ]
[ "examples/semi_lagrangian_experiments/unsteady_semi_experiment_curvilinear.py" ]
[ "import numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport finufftpy\nimport time\nimport pybie2d\nfrom ipde.embedded_boundary import EmbeddedBoundary\nfrom ipde.ebdy_collection import EmbeddedBoundaryCollection, EmbeddedFunction, BoundaryFunction\nfrom ipde.heavisides import SlepianMoll...
[ [ "numpy.fft.fft2", "numpy.linalg.solve", "numpy.fft.ifft2", "numpy.abs", "numpy.linspace", "numpy.fft.fft", "numpy.empty_like", "matplotlib.pyplot.subplots", "numpy.cos", "numpy.sin", "numpy.concatenate", "numpy.hypot", "numpy.zeros_like", "numpy.fft.fftfreq"...
FlanFlanagan/d3ploy
[ "076324637d66d82b91ff34110f8458e182a28dab" ]
[ "d3ploy/DO_solvers.py" ]
[ "\"\"\"\nThis file manages Deterministic-optimizing libaries for the D3ploy cyclus modules.\n\n\"\"\"\nimport numpy as np\nimport statsmodels.tsa.holtwinters as hw\n\n\ndef polyfit_regression(ts, back_steps=10, degree=1):\n \"\"\"\n Fits a polynomial to the entries in timeseries [ts]\n to predict the next ...
[ [ "numpy.polyfit", "numpy.poly1d", "numpy.absolute", "numpy.fft.fft", "numpy.arange", "numpy.cos", "numpy.mean", "numpy.fft.fftfreq", "numpy.angle", "numpy.zeros" ] ]
fschur/ODIN-with-second-order-derivatives
[ "6192ce3213cf5864721921d145eaf74f96e1500e" ]
[ "odin/utils/kernels_auto.py" ]
[ "\"\"\"\nCollection of kernel classes to be used in the Gaussian Process Regression. Compared to the standard implementation\nof the kernels, here the derivatives are not hard coded, but automatically derived using sympy.\n\nFelix Schur, ETH Zürich\n\nbased on code from\n\nGabriele Abbati, Machine Learning Research...
[ [ "numpy.log", "tensorflow.sign", "tensorflow.concat", "tensorflow.constant", "tensorflow.zeros", "tensorflow.reshape", "tensorflow.ones", "tensorflow.repeat", "tensorflow.exp", "tensorflow.variable_scope", "tensorflow.abs" ] ]
aida-ugent/FIPR
[ "723b3330fd95542803bf72184411b3fcfa48c168" ]
[ "src/predictors/maxent_predictor.py" ]
[ "import numpy as np\nimport pandas as pd\nimport torch\nimport torch.utils.data as torch_data\nfrom tqdm import tqdm\n\nfrom fip.fairness_loss import FairnessLoss\nfrom .predictor import Predictor\nfrom utils.adjacency_data import build_adjacency_matrix, AdjacencySampler, map_edges\n\n\nclass MaxEntPredictor(Predic...
[ [ "torch.sigmoid", "torch.ones", "torch.empty", "numpy.unique", "torch.zeros", "numpy.arange", "numpy.vstack", "torch.utils.data.DataLoader", "torch.from_numpy", "numpy.ones", "numpy.concatenate", "torch.sparse_coo_tensor", "torch.nn.BCEWithLogitsLoss", "torch...
oraschewski/CommunityFirnModel
[ "3041cd604d9a5c7eed7cbfd676934d970417818c" ]
[ "CFM_main/reader.py" ]
[ "#!usr/bin/env python\n'''\nFunctions to read model inputs.\n'''\n\nimport os\nimport numpy as np\n# from string import join\nfrom constants import *\nimport h5py\n\ndef read_input(filename,StartDate=None):\n '''\n Read in data from csv input files\n\n :param filename: name of the file which holds the accu...
[ [ "numpy.minimum", "numpy.shape", "numpy.transpose", "numpy.where", "numpy.loadtxt" ] ]
crazywiden/Hangman_AI_solver
[ "b2b1028b6d26bc3454e59ecb3ee4ab27642b6317" ]
[ "main.py" ]
[ "\nimport argpase\nimport collections\nimport pandas as pd\nimport numpy as np\nfrom model import RNN_model\nimport torch\n\ndef arg_parser():\n parser = argparse.ArgumentParser(description=\"hangman game config\")\n parser.add_argument(\"--train_path\", type=str, default=\"words_250000_train.txt\",\n ...
[ [ "numpy.unique", "numpy.asarray", "torch.load", "torch.from_numpy", "numpy.zeros", "torch.argmax" ] ]
JoePowers/multifil
[ "f2a60b6265f7278cbfe618de6cadc29642270bb6" ]
[ "multifil/af.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"\naf.py - An actin filament\n\nCreate and maintain a thin filament and the subgroups that comprise it.\n\nCreated by Dave Williams on 2010-01-04.\n\"\"\"\n\nimport numpy as np\n\n\nclass BindingSite(object):\n \"\"\"A singular globular actin site\"\"\"\n def __...
[ [ "numpy.hstack", "numpy.abs", "numpy.multiply", "numpy.nonzero", "numpy.flipud", "numpy.subtract", "numpy.arctan2", "numpy.diff", "numpy.searchsorted", "numpy.add", "numpy.array", "numpy.sum" ] ]
blevine37/blarf
[ "8f1d1abb05d72069323d7911f2afb38ad3d9146b" ]
[ "blarf/rbfn_center.py" ]
[ "import numpy as np\nimport math\nfrom blarf.dataset import dataset\nfrom blarf.cluster import cluster\n\nclass rbfn_center():\n def __init__(self,nd):\n self.numdims = nd\n self.positions = np.zeros(nd)\n self.numbf = 0\n self.bf_icoords = np.zeros((0,nd),dtype=np.intc)\n self...
[ [ "numpy.resize", "numpy.zeros" ] ]
Wang518hongyu/PyGEMwangtest
[ "f6ff507681b45599d0ecce5be2e5292e94fd09f7" ]
[ "pygem.pygem_input.py" ]
[ "\"\"\"Model inputs to run PyGEM\"\"\"\r\n\r\n# Built-in libraries\r\nimport os\r\n# External libraries\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\n\r\n# %% Functions to select specific glacier numbers\r\ndef get_same_glaciers(glac_fp):\r\n \"\"\"\r\n Get same 1000 glaciers for testing of priors\r\n\r...
[ [ "numpy.arange", "pandas.read_csv" ] ]
zsef123/darts-multi_gpu
[ "31ab50096b31812ebba542ca0ad9034870a3a586" ]
[ "cnn/train_search.py" ]
[ "import os\nimport sys\nimport time\nimport glob\nimport numpy as np\nimport torch\nimport utils\nimport logging\nimport argparse\nimport torch.nn as nn\nimport torch.utils\nimport torch.nn.functional as F\nimport torchvision.datasets as dset\nimport torch.backends.cudnn as cudnn\n\nfrom model_search import Network...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.functional.softmax", "torch.cuda.manual_seed", "numpy.random.seed", "torch.manual_seed", "torch.utils.data.sampler.SubsetRandomSampler", "torch.no_grad", "torch.cuda.is_available", "torch.optim.SGD", "numpy.floor", "torch.nn.DataPa...
svetli-n/Castor
[ "c731061eac238f5efb630e45449af50940962992" ]
[ "han/model.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\n#from utils import \nimport torch.nn.functional as F\nfrom han.sent_level_rnn import SentLevelRNN\nfrom han.word_level_rnn import WordLevelRNN\n \n\nclass HAN(nn.Module):\n def __init__(self, config):\n super(HAN, self)...
[ [ "torch.cat" ] ]
jepegit/cellpy
[ "b9ddb7afa3f7453bfb5f2f24a3268279bccf24c6" ]
[ "cellpy/readers/cellreader.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Datareader for cell testers and potentiostats.\n\nThis module is used for loading data and databases created by different cell\ntesters. Currently it only accepts arbin-type res-files (access) data as\nraw data files, but we intend to implement more types soon. It also creates\nproce...
[ [ "numpy.amax", "pandas.read_csv", "pandas.concat", "pandas.Series", "numpy.unique", "numpy.amin", "numpy.median", "pandas.DataFrame", "numpy.ceil", "scipy.interpolate.interp1d", "pandas.HDFStore", "pandas.set_option" ] ]
wuch15/FedKD
[ "6166696e4abd74a16c2d7d80aa7983b99c17e153" ]
[ "model.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nimport os\nimport math\n\n\nclass AdditiveAttention(nn.Module):\n ''' AttentionPooling used to weighted aggregate news vectors\n Arg: \n d_h: the last dimension of input\n '''\n def __init__(self, d_h, hidde...
[ [ "torch.nn.Softmax", "torch.mean", "numpy.sqrt", "torch.nn.functional.dropout", "torch.cat", "torch.sum", "torch.nn.Embedding", "torch.narrow", "torch.FloatTensor", "torch.nn.Embedding.from_pretrained", "torch.nn.CrossEntropyLoss", "torch.ones", "torch.reshape", ...
nogawanogawa/image_search
[ "77367cecb27940891c3283ee40af1495c52b730e" ]
[ "etl/main.py" ]
[ "import os\nimport glob\nfrom metaflow import FlowSpec, step\nfrom lib.es.document import Document\nfrom lib.es.index import Index\nfrom step.extract.extract import *\nfrom lib.feature.src.embedding import *\nfrom lib.feature.src.phash import *\nfrom lib.feature.src.akaze import *\n\nimport torch\nfrom torchvision ...
[ [ "torch.no_grad", "torch.nn.Identity", "torch.utils.data.DataLoader", "sklearn.cluster.KMeans" ] ]
arokem/scipy
[ "4d15ee3e32d53a8bad00c0cf7d465ec27a5b876d" ]
[ "scipy/fft/_pocketfft/tests/test_real_transforms.py" ]
[ "from __future__ import division, print_function, absolute_import\n\nfrom os.path import join, dirname\n\nimport numpy as np\nfrom numpy.testing import (\n assert_array_almost_equal, assert_equal, assert_allclose)\nimport pytest\nfrom pytest import raises as assert_raises\n\nfrom scipy.fft._pocketfft.realtransfo...
[ [ "numpy.sqrt", "numpy.linspace", "numpy.issubdtype", "numpy.max", "numpy.random.randn", "scipy.fft._pocketfft.realtransforms.dst", "numpy.testing.assert_equal", "numpy.arange", "numpy.sin", "numpy.frombuffer", "numpy.zeros", "numpy.testing.assert_array_almost_equal",...
bhsimon0810/text-classification
[ "01f303e7ac75341f9881a9f4af8d0a1d4c05c8aa" ]
[ "textcnn/model.py" ]
[ "import tensorflow as tf\r\nimport numpy as np\r\n\r\n\r\nclass TextCNN(object):\r\n \"\"\"\r\n A CNN for text classification.\r\n Uses an embedding layer, followed by a convolutional, max-pooling and softmax layer.\r\n \"\"\"\r\n\r\n def __init__(\r\n self, sequence_length, num_class, voc...
[ [ "tensorflow.device", "tensorflow.concat", "tensorflow.cast", "tensorflow.nn.l2_loss", "tensorflow.nn.conv2d", "tensorflow.compat.v1.trainable_variables", "tensorflow.name_scope", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.argmax", "tensorflow.compat.v1.vari...
DarioRugg/Self-Supervised_Pearson_Search
[ "731ff0888b336076ec42c26808417809fb78e3cf" ]
[ "lib/datasets/cuhk_sysu.py" ]
[ "import os.path as osp\nimport numpy as np\nimport torch\nfrom scipy.io import loadmat\nfrom sklearn.metrics import average_precision_score\n#from numba import jit\n\nfrom .ps_dataset import PersonSearchDataset\n#from ..utils.serialization import pickle, unpickle\nfrom ..utils.evaluator import _compute_iou\n\n\ncla...
[ [ "numpy.asarray", "numpy.ones", "numpy.all", "numpy.argmax", "numpy.mean", "sklearn.metrics.average_precision_score", "numpy.prod", "numpy.argsort", "numpy.array", "numpy.where", "numpy.zeros" ] ]
t9s9/BeeMeter
[ "d0dfbf621a9147c047708a18540ba61266324176", "d0dfbf621a9147c047708a18540ba61266324176" ]
[ "detection/dataset/data_analysis.py", "jetson_nano/model.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom sklearn.cluster import KMeans\nfrom tqdm import tqdm\n\nfrom detection.dataset.clustering import avg_iou, kmeans_iou\nfrom detection.dataset.dataset_generator import Dataset\n\n\nclass Analyser:\n def __init__(...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.imshow", "sklearn.cluster.KMeans", "numpy.around", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.max", "numpy.concatenate", "numpy.mean", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "pandas.read_cs...
tegg89/magnet
[ "740160aa1ae367d22eeffcd04268adac52ab9108" ]
[ "env_processing/shaping.py" ]
[ "import numpy as np\n\nREWARD_FOR_KILLING = 100\nREWARD_FOR_KILLING_YOURSELF = -100\nREWARD_FOR_INCREASING_CAN_KICK = 10\nREWARD_FOR_INCREASING_AMMO = 10\nREWARD_FOR_INCREASING_BLAST_POWER = 10\nREWARD_FOR_DESTROING_WOODEN_WALL = 20\n\n# contain dictionary which describe current bombs on field\nlist_of_sest_boobms ...
[ [ "numpy.asmatrix" ] ]
timothijoe/DI-engine
[ "f0014586f7043334b5ce78a62c824be90ee1c2d9" ]
[ "ding/entry/tests/test_serial_entry.py" ]
[ "import pytest\nimport time\nimport os\nfrom copy import deepcopy\n\nfrom ding.entry import serial_pipeline, collect_demo_data, serial_pipeline_offline\nfrom dizoo.classic_control.cartpole.config.cartpole_dqn_config import cartpole_dqn_config, cartpole_dqn_create_config\nfrom dizoo.classic_control.cartpole.config.c...
[ [ "torch.load" ] ]
liyiliuxingyu/Data-preprocessing-goes-from-getting-started-to-real-world
[ "c83fc7b92b52bc106d9a803a6fec24d6470889c3" ]
[ "preprocess/004_join/03_d/python_not_awesome.py" ]
[ "from preprocess.load_data.data_loader import load_hotel_reserve\nimport pandas as pd\ncustomer_tb, hotel_tb, reserve_tb = load_hotel_reserve()\n\n# 本书刊登内容如下\nimport pandas.tseries.offsets as offsets\nimport operator\n\n# 为了进行日期计算,这里将数据类型由字符串转换为日期型(详见第10章)\nreserve_tb['reserve_datetime'] = \\\n pd.to_datetime(rese...
[ [ "pandas.merge", "pandas.to_datetime", "pandas.tseries.offsets.Day" ] ]
WanyuGroup/CVPR2022-OrphicX
[ "98d8d8259439c45661573e575cf956331df16abc" ]
[ "orphicx_graph.py" ]
[ "\"\"\" explainer_main.py\n\n Main user interface for the explainer module.\n\"\"\"\nimport argparse\nimport os\nfrom networkx.algorithms.components.connected import connected_components\n\nimport sklearn.metrics as metrics\nfrom functools import partial\nfrom tensorboardX import SummaryWriter\n\nimport sys\nim...
[ [ "torch.nn.functional.kl_div", "torch.nn.Softmax", "torch.nn.functional.softmax", "torch.randn_like", "torch.load", "torch.cat", "torch.randperm", "torch.utils.data.DataLoader", "pandas.DataFrame", "torch.no_grad", "torch.cuda.is_available", "torch.device", "torc...
bbjy/DAN
[ "02e04e0aea2aa65373e7d9b4827ce76b80223149" ]
[ "encoder.py" ]
[ "import os\r\nimport numpy as np\r\nfrom scipy import sparse\r\nfrom scipy.sparse import coo_matrix\r\nfrom scipy.sparse import vstack\r\nfrom scipy.spatial.distance import pdist\r\nfrom copy import deepcopy\r\nfrom collections import OrderedDict\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch.nn import ...
[ [ "torch.nn.Dropout", "torch.nn.Linear", "torch.nn.ModuleList", "torch.nn.Tanh" ] ]
xuyu92327/waveform-analysis
[ "8216cc8d7a75fc38d3fbc236d8b6b6cba963f78c" ]
[ "source/wxh/remove_noise.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport h5py\nimport sys\nimport pandas as pd\nimport numpy as np\nfrom tqdm import tqdm\nimport multiprocessing as mp\n\n# define function to devide waveform list into groups\n\n\ndef divide(ls, unit_len):\n DividedLs = []\n UnitLen = int(unit_len)\n Grou...
[ [ "numpy.std", "numpy.mean" ] ]
WeiChe-Huang/ONNX_Convertor
[ "7ba4fe3fd9f606d39cf61b46080c3dc244dfe207" ]
[ "optimizer_scripts/tools/removing_transpose.py" ]
[ "from . import helper\nfrom . import other\nfrom . import modhelper\nfrom . import fusing\nimport numpy as np\nimport onnx\nimport onnx.utils\n\ndef eliminate_transposes(m):\n g = m.graph\n keep_eliminating = True\n while keep_eliminating:\n while swap_transpose_with_single_next_node(g):\n pass\n spli...
[ [ "numpy.reshape", "numpy.transpose" ] ]
jirikraus/cuml
[ "1176b338e2dc97737977336d7d67a733c9dd4626" ]
[ "python/cuML/test/test_dbscan.py" ]
[ "# Copyright (c) 2018, NVIDIA CORPORATION.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l...
[ [ "numpy.asarray", "numpy.array", "sklearn.cluster.DBSCAN" ] ]
denix56/fcd
[ "6f71e311acb0e02b6d9e106d8bac754e883f52bf" ]
[ "prepare_landsat8_biome.py" ]
[ "import argparse\nimport random\nfrom collections import namedtuple, defaultdict\nfrom itertools import product\nfrom pathlib import Path\nfrom typing import List\n\nimport cv2\nimport numpy as np\nimport rasterio\nimport tifffile\nfrom PIL import Image\nfrom matplotlib import pyplot as plt\nfrom tqdm import tqdm\n...
[ [ "matplotlib.pyplot.imshow", "numpy.random.seed", "matplotlib.pyplot.subplots", "numpy.concatenate", "numpy.logical_or", "numpy.moveaxis", "matplotlib.pyplot.show", "numpy.sum", "matplotlib.pyplot.figure" ] ]
sguzman/timescaleable
[ "cbaea85ed512ebb8330a20e37b1ee53d227285fc" ]
[ "src/main.py" ]
[ "import numpy\nimport requests\nimport json\nimport psycopg2\nimport os\nimport random\nimport sys\nimport threading\nimport datetime\nimport traceback\nimport queue\nimport asyncio\n\n\nkeys = os.environ['API_KEY'].split('|')\ncores = 1\ntimescale_queue = queue.Queue()\nchunk_size = 50\n\n\ndef connect():\n ret...
[ [ "numpy.random.choice" ] ]
VCL3D/DronePose
[ "c38a45270105ec2fd873540f384e070e5fc9c204" ]
[ "importers/intrinsics.py" ]
[ "import json\r\nimport numpy\r\nimport torch\r\n\r\n\r\ndef load_intrinsics_repository(filename): \r\n #global intrinsics_dict\r\n with open(filename, 'r') as json_file:\r\n intrinsics_repository = json.load(json_file)\r\n intrinsics_dict = dict((intrinsics['Device'], \\\r\n intrin...
[ [ "numpy.array", "torch.from_numpy", "torch.tensor" ] ]
timokau/task-placement
[ "41d02ac6f27eec005da90cfd1fd699a2127d4704" ]
[ "peg_size_experiment.py" ]
[ "\"\"\"Empirically determine PEG size as a function of input size\"\"\"\n\nimport csv\nimport numpy as np\nfrom scipy import stats\n\nimport baseline_agent\nfrom generator import Generator\nfrom hyperparameters import GENERATOR_DEFAULTS\n\n\ndef _play_episode(emb):\n emb = emb.reset()\n enodes = [len(emb.grap...
[ [ "scipy.stats.sem", "numpy.random.RandomState", "numpy.average" ] ]
jfmendozam/ontotoutra
[ "bea4ceafa62500b23495a6de120884ca40f785e9" ]
[ "webscraping/dataFrame.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Apr 6 00:20:39 2018\n\n@author: jf\n\"\"\"\n\nimport glob\nimport os\nfrom pandas import pandas as pd\nimport matplotlib.pyplot as plt\nimport gensim\nfrom gensim import corpora, models, similarities\n#import gensim.models.doc2vec as d2v\n#fr...
[ [ "pandas.pandas.read_csv", "pandas.pandas.DataFrame" ] ]
HaxiSnake/skeleton_frame
[ "37954a01d75c8485bfc93bca749dc5c23747d8f3" ]
[ "processor/recognition.py" ]
[ "#!/usr/bin/env python\n# pylint: disable=W0201\nimport sys\nimport argparse\nimport yaml\nimport numpy as np\n\n# torch\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\n# torchlight\n# import torchlight.torchlight as torchlight\n# from torchlight.torchlight import str2bool\n# from torchlight.t...
[ [ "torch.nn.CrossEntropyLoss", "numpy.concatenate", "torch.no_grad", "numpy.mean", "numpy.array", "numpy.zeros" ] ]
SomanathanSubramaniyan/Applied-Databases
[ "93e278f0624e715a327ea46d81d14c46cc82cf85" ]
[ "G00364742.py" ]
[ "# Applied Database\r\n# Final Project\r\n# Section 4.4 - Python program answers\r\n# Author : Somu\r\n\r\n#mySQL modules import\r\nimport mysql.connector\r\nfrom mysql.connector import Error\r\nfrom mysql.connector import errorcode\r\nimport pandas as pd\r\n#Mongo modules import\r\nimport pymongo\r\nfrom pymongo i...
[ [ "pandas.read_sql_query", "pandas.DataFrame" ] ]
nickwinters1/wintersdata
[ "b85f9c1dc2d2852746d01f386748e99abac0f727" ]
[ "functions.py" ]
[ "\n#!/usr/bin/env python\n\"\"\"\nThis file contains helper classes for working with DataFrames\n\"\"\"\nimport numpy as np\nimport pandas as pd\n\nclass Cleaner:\n \"\"\"\n The Cleaner Class is meant to provide a quick self cleaning of\n Python DataFrames\n \"\"\"\n df = pd.DataFrame()\n\n def __...
[ [ "pandas.DataFrame" ] ]
foamliu/Image-Captioning
[ "972a3cfb56d0b43dde4ed3752992eb99489be53d" ]
[ "model.py" ]
[ "import keras.backend as K\nimport tensorflow as tf\nfrom keras.layers import Input, Dense, CuDNNLSTM, Concatenate, Embedding, RepeatVector, TimeDistributed, Dropout\nfrom keras.models import Model\nfrom keras.utils import plot_model\n\nfrom config import max_token_length\nfrom config import vocab_size, embedding_s...
[ [ "tensorflow.device" ] ]
ValIlya/gopro-webcam
[ "3591cf918e535485d14bed96d147d36268289fde" ]
[ "src/motion_detection.py" ]
[ "from typing import Iterable, Dict\n\nimport cv2\nimport imutils\nimport numpy as np\n\n\nclass MotionDetector:\n MAX_FRAMES = 5 # averaging n last frames to get stable reference\n GAUSS_KERNEL_SIZE = 21 # blurring\n DELTA_THRESHOLD = 20 # seeking pixels with changed brightness more than DELTA_THRESHOLD...
[ [ "numpy.mean" ] ]
OPHoperHPO/dcgan-lentach-logo-generator
[ "9ce626866fa28f1f4dc368f4a90909d0981c8f67" ]
[ "generate_single_image.py" ]
[ "# Lentach logo generator - DCGAN Keras.\n# Modified by Anodev Development.\n\n# Imports\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom keras.models import load_model\n\n\ndef generate_single_image(model_path, image_save_path):\n # Save 1 generated image for demonstration purposes using matplotlib.py...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.savefig", "numpy.random.normal", "matplotlib.pyplot.close", "matplotlib.pyplot.axis" ] ]
multiparty/datathon
[ "dcb014b7de84e1ff559acd045492762dd1b73ff6" ]
[ "parsing_scripts/parse.py" ]
[ "import pandas as pd\nimport glob\n\ndef combine(path_to_files, primary_key, output_path):\n li = []\n\n for filename in glob.glob(path_to_files):\n print(filename)\n df = pd.read_csv(filename, index_col=False)\n if filename == \"../synthetic_data/trial_2\\syn_adef.csv\":\n pri...
[ [ "pandas.concat", "pandas.read_csv" ] ]
tinkuy-adm/tinkuy-clustering
[ "4232f0e19963645127f74aee0e90f8f965590a9d" ]
[ "src/outlier_detection.py" ]
[ "from sklearn.cluster import DBSCAN\nimport numpy as np\n\n#CONSTANTES\n#METERS = 80\n#MIN_SAMPLES = 10\n\n#Se recibe una lista de listas ([longitud,latitud])\n#Se devuelven los labels de los puntos (los que tengan -1 son outliers)\ndef eliminate_outliers(points,meters,minsam):\n array = np.array(points)\n la...
[ [ "numpy.array", "sklearn.cluster.DBSCAN" ] ]
Mellechowicz/PoVaB
[ "5311f668a71d75217dfc8e95ab7575fd0df49ad6" ]
[ "PoVaB/__main__.py" ]
[ "#!/usr/bin/python3\n\nimport numpy as np\nimport defusedxml.ElementTree as ET\nfrom sys import argv\nfrom PoVaB.argv import Options\nfrom PoVaB.tags import Tags\n\nif __name__ == '__main__':\n opt = Options(*argv)\n root = ET.parse(opt('vasprun')).getroot()\n\n tags = Tags(opt('vasprun'))\n\n filename ...
[ [ "numpy.power", "matplotlib.pyplot.subplots", "numpy.linalg.norm", "numpy.all", "numpy.max", "numpy.fromstring", "matplotlib.rcParams.update", "numpy.array", "numpy.sum", "numpy.float" ] ]
rahul-art/Faulti_waffer
[ "3dc1f2a7a990c1f7d4c15c0bf33273b7a38e79e1" ]
[ "Prediction_Raw_Data_Validation/predictionDataValidation.py" ]
[ "import sqlite3\r\nfrom datetime import datetime\r\nfrom os import listdir\r\nimport os\r\nimport re\r\nimport json\r\nimport shutil\r\nimport pandas as pd\r\nfrom application_logging.logger import App_Logger\r\n\r\n\r\n\r\n\r\n\r\nclass Prediction_Data_validation:\r\n \"\"\"\r\n This class shall b...
[ [ "pandas.read_csv" ] ]
datesann0109/D_2117
[ "07a94c65c622cf2aa9f2a852f1f28e647a5823bd" ]
[ "ai/utils/model.py" ]
[ "import torch.nn as nn\nimport torch\nfrom torchvision import models\nimport numpy as np\nimport cv2\n\n\nclass CustomModel(nn.Module):\n def __init__(self):\n super().__init__()\n\n self.segment_model = models.segmentation.fcn_resnet50(pretrained=True)\n sem_classes = [\n '__back...
[ [ "torch.nn.functional.softmax", "numpy.array", "numpy.sum", "numpy.nonzero" ] ]
atulkum/sequence_prediction
[ "3fd4abe7dfcc6d3929edbe60058bd05dc67d0fe3" ]
[ "neural_ner/model.py" ]
[ "from __future__ import unicode_literals, print_function, division\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\nfrom data_utils.constant import Constants\nimport logging\n\nfrom crf import CRF_Loss\nfrom model_util...
[ [ "torch.nn.Dropout", "torch.max", "torch.nn.functional.log_softmax", "torch.nn.LSTM", "torch.cat", "torch.from_numpy", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.Embedding.from_pretra...
inacmor/mobiledets-yolov4-pytorch
[ "db285fa061e997032a77fa1ee8c954f2eba2a84d", "db285fa061e997032a77fa1ee8c954f2eba2a84d" ]
[ "dataset/data_augmentation.py", "model/net/body.py" ]
[ "import cv2\nimport numpy as np\nimport random\n\n\ndef flip(img, box, mode):\n s = img.shape[0]\n\n if mode == 'hori' or 'vert':\n if random.random() > 0.5:\n if mode == 'hori':\n img = cv2.flip(img, 1)\n box[:, 1] = s - box[:, 1]\n box[:, 3] = s...
[ [ "numpy.rot90", "numpy.maximum", "numpy.clip", "numpy.uint8", "numpy.max", "numpy.random.normal", "numpy.array" ], [ "torch.nn.MaxPool2d", "torch.nn.Conv2d", "torch.cat" ] ]
SenHuang19/EnergyPlus-Volttron-Toolkit
[ "f89e68dc143e9ac01c2b07e975d21d64716bf876" ]
[ "volttron/platform/agent/base_market_agent/poly_line.py" ]
[ "# -*- coding: utf-8 -*- {{{\n# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:\n#\n# Copyright 2017, Battelle Memorial Institute.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\...
[ [ "numpy.isnan", "numpy.interp" ] ]
SIGKDDanon/SIGKDD2021DeAnonV2
[ "76f0373ec42ab55feefed3f4ce4bf4d532b51dd2", "76f0373ec42ab55feefed3f4ce4bf4d532b51dd2" ]
[ "PostDiffMixture/simulations_folder/simulation_analysis_scripts/checkpickle_EFFECT_new.py", "PostDiffMixture/simulations_folder/simulation_scripts/run_effect_size_simulations_beta.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\n#matplotlib.use(\"gtk\")\n#matplotlib.use('Qt5Agg')\nfrom table_functions import *\nimport pickle\nimport os\nimport pandas as pd \nimport matplotlib.pyplot as plt \nimport sys\n#sys.path.insert()\n# print(data)\nimport numpy as np\nimport os\nfrom scipy import stats\nfrom...
[ [ "numpy.sqrt", "matplotlib.use", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "pandas.DataFrame", "scipy.stats.t.ppf", "numpy.mean", "matplotlib.pyplot.close", "numpy.var", "numpy.random.uniform", "numpy.array", "numpy.sum" ], [ "pandas.concat", ...
DemoAuguste/ZAQ-code
[ "9986a2d217ab5cb284e08c062f8726cabacb311e" ]
[ "network/resnet.py" ]
[ "''' ResNet in PyTorch. '''\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, in_planes, planes, stride=1):\n super(BasicBlock, self).__init__()\n self.conv1 = nn.Conv2d(in_planes, planes, kernel_size=3,...
[ [ "torch.nn.Sequential", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
timtroendle/geographic-scale
[ "81ec940e10b8e692429797e6a066a177e1508a89" ]
[ "src/analyse/composition_uncertainty.py" ]
[ "from dataclasses import dataclass\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nfrom seaborn import utils\nfrom seaborn.palettes import blend_palette\n\nGREEN = \"#679436\"\nRED = \"#A01914\"\nBLUE = \"#4F6DB8\"\nYELLOW = \"#FABC3C\"\nGREY = \"#C0C0C0\"\nCOL...
[ [ "pandas.read_csv", "numpy.linspace", "matplotlib.colors.colorConverter.to_rgb", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.figure" ] ]
lukasz-migas/pySPM
[ "3b5e050d776af03b451a1064e47ecd732861e0fe" ]
[ "pySPM/PCA.py" ]
[ "# -- coding: utf-8 --\n\n# Copyright 2018 Olivier Scholder <o.scholder@gmail.com>\n\n\"\"\"\nThis module performs the PCS with the help of the scikit library and gives the user various function for quick plotting.\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import scale\nfrom skl...
[ [ "matplotlib.pyplot.Rectangle", "matplotlib.pyplot.gca", "numpy.log", "matplotlib.pyplot.tight_layout", "numpy.sum", "numpy.abs", "matplotlib.pyplot.scatter", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "pandas.tools.plotting.scatter_matrix", "numpy.ndenumerate"...
likui01/miliamp
[ "cdf1b53efaa2fcbd0635cbf839fd7f3eb1eb2946" ]
[ "src/code/33pro testing.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Aug 25 13:07:56 2016\r\n\r\n@author: likui\r\n\"\"\"\r\nimport numpy as np\r\nfrom sklearn.metrics import roc_curve, auc\r\nfrom sklearn.metrics import precision_recall_curve\r\nfrom sklearn.metrics import average_precision_score\r\nfrom roc import*\r\ndef seg(fi...
[ [ "sklearn.metrics.auc", "sklearn.metrics.roc_curve" ] ]
satw1knandala/Cirq
[ "ca307cd7ffdd2e8659c84c484788c8b5d15cc09d" ]
[ "cirq/ops/common_channels.py" ]
[ "# Copyright 2018 The Cirq Developers\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 o...
[ [ "numpy.sqrt", "numpy.eye", "numpy.identity", "numpy.array", "numpy.zeros" ] ]
neuronit/pfa
[ "6483f23de3ac43ae1121760ab44a2cae1f2cc901" ]
[ "parameters_research/save_and_load.py" ]
[ "# -*- coding: utf-8 -*-\n\n#############################################\n# dependencies #\n#############################################\n\nimport sys\nimport os.path\nimport numpy as np\n# others\nimport global_vars as g \n\n\n#############################################\n# ...
[ [ "numpy.load", "numpy.savez" ] ]
yogendrapal/askaquestion-rpi
[ "5b53cfca5ab2622349e48772758cd5793219834d" ]
[ "facerec.py" ]
[ "import face_recognition\nimport cv2\nfrom config import *\nimport json\nimport numpy as np\nimport time\nimport logging\n\n\n'''\nThis function will generate 2 face encodings for the person in\nfront of the camera and will return it. If no face is found for\n100 frames, then None is returned.\n'''\ndef generate_fa...
[ [ "numpy.load", "numpy.savez" ] ]
etseidler/sagemaker-deployment
[ "84eb84d0793f7c14515ef55aadd4954912e3b0bf" ]
[ "Project/train/train.py" ]
[ "import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport torch\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\ndef model_fn(model_dir):\n \"\"\"Load the PyTorch model from the `model_dir` directory.\...
[ [ "torch.load", "torch.manual_seed", "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader", "torch.from_numpy", "torch.nn.BCELoss", "torch.cuda.is_available", "torch.save" ] ]
SizheWei/OpenCompoundDomainAdaptation-OCDA
[ "ee9b2186256b5dc231133283559c6c221e53549d" ]
[ "source/algorithms/train_scheduled_mann_net.py" ]
[ "import os\nfrom os.path import join\nfrom copy import deepcopy\n\n# Import from torch\nimport torch\nimport torch.optim as optim\n\n# Import from within Package \nfrom ..models.utils import get_model\nfrom ..data.utils import load_data_multi, get_dataset_multi\nfrom ..data.sampler import DomainScheduledSampler\n\n...
[ [ "torch.cat", "torch.utils.data.DataLoader", "torch.matmul", "torch.no_grad", "torch.cuda.is_available" ] ]
nimish15shah/GRAPHOPT
[ "a4e70925bf59d0c802715b1c8696199d96d820ae" ]
[ "src/sparse_linear_algebra/main.py" ]
[ "\nfrom . import file_io\nfrom . import matrix_names_list\nimport networkx as nx\nfrom ..reporting_tools import reporting_tools\nfrom .. import common_classes\nfrom .. import ac_eval\nfrom .. import useful_methods\nfrom ..super_layer_generation.partition import status_node, layer_wise_partition_ASAP, CompileConfig\...
[ [ "numpy.allclose", "scipy.sparse.linalg.splu", "scipy.sparse.linalg.spsolve", "numpy.arange", "scipy.sparse.csr_matrix", "numpy.ones", "scipy.sparse.linalg.spsolve_triangular", "numpy.array" ] ]
harshgeek4coder/Smart-Rural-Ecosystem
[ "a7d5036d8ef7dde91cd3d04492c98d0b29fc28b0" ]
[ "app/routes.py" ]
[ "from flask import render_template , flash , redirect , url_for , request\nimport csv\nimport pandas as pd\nfrom app import app\nfrom app.forms import RegForm , LoginForm\nfrom app.models import User\nfrom app import app, db, pwd\nfrom flask_login import login_user , current_user , logout_user , login_required\n\nf...
[ [ "pandas.read_csv" ] ]
sparkzsolutions/The-Dark-Onion-Crawler
[ "56f52127acc7ff4151d455dd1f007638ad0e795d" ]
[ "NudeNet/nudenet/detector.py" ]
[ "import os\r\nimport cv2\r\nimport pydload\r\nimport logging\r\nimport numpy as np\r\nimport onnxruntime\r\nfrom progressbar import progressbar\r\n\r\nfrom .detector_utils import preprocess_image\r\nfrom .video_utils import get_interest_frames_from_video\r\n\r\n\r\ndef dummy(x):\r\n return x\r\n\r\n\r\nFILE_URLS...
[ [ "numpy.asarray", "numpy.expand_dims" ] ]
akanametov/dcgan-pytorch
[ "20f85607db04f62f0b18beb8ea42fc757069350c" ]
[ "utils.py" ]
[ "import os\nimport urllib\nimport zipfile\nfrom tqdm import tqdm\n\nimport torch\nfrom torch import nn\n\n\ndef download(url: str, filename: str, chunk_size: int = 4096) -> None:\n print(f'Downloading {url} ...')\n with open(filename, \"wb\") as fh:\n with urllib.request.urlopen(urllib.request.Request(...
[ [ "torch.nn.init.constant_", "torch.nn.init.normal_" ] ]
TomDLT/himalaya-1
[ "58eab7fc17e7471462a9ba7917e7034a5f6bfacc" ]
[ "himalaya/backend/torch.py" ]
[ "from functools import partial\n\ntry:\n import torch\nexcept ImportError as error:\n import sys\n if \"pytest\" in sys.modules: # if run through pytest\n import pytest\n pytest.skip(\"PyTorch not installed.\")\n raise ImportError(\"PyTorch not installed.\") from error\n\nfrom ._utils imp...
[ [ "torch.diagonal", "torch.norm", "torch.ones", "torch.max", "torch.full", "torch.zeros", "torch.svd", "torch.min", "torch.sort", "torch.flatten", "torch.gather", "torch.flip", "torch.squeeze", "torch.as_tensor" ] ]
ZoeYou/hypernym-path-generation
[ "da6b717e06ed9cd90625bbf352fa372958f808cc" ]
[ "seq2seq/print_output_beam.py" ]
[ "from nltk.corpus import wordnet as wn\nimport re\nimport sys\nimport pandas as pd\nfrom tqdm import tqdm\n\nin_fname = sys.argv[1] #$RESULTS.txt\nout_fname = sys.argv[2] #$RESULTS.out.txt\nis_WN = False\n\n# ------------------------------- #\n# NB. Output column order:\n# ------------------------------- #\n# re...
[ [ "pandas.read_csv" ] ]
klasocki/flair
[ "8d0ec268cf0d7f2b08c617f60296d9c7853b633f" ]
[ "flair/models/sequence_tagger_model.py" ]
[ "import logging\nfrom pathlib import Path\n\nimport logging\nfrom pathlib import Path\nfrom typing import List, Union, Optional, Callable, Dict\n\nimport numpy as np\nimport torch\nimport torch.nn\nimport torch.nn.functional as F\nfrom tabulate import tabulate\nfrom torch.nn.parameter import Parameter\nfrom torch.u...
[ [ "torch.nn.functional.softmax", "torch.max", "torch.cat", "torch.zeros", "torch.utils.data.DataLoader", "torch.sum", "numpy.max", "torch.nn.utils.rnn.pad_packed_sequence", "torch.no_grad", "torch.FloatTensor", "numpy.exp", "torch.nn.Dropout", "torch.randn", "...
chao-tan/FORECAST-CLSTM
[ "79a604717e9c6a87976c7ec274c4ed98461df4ef" ]
[ "tools.py" ]
[ "# -*- coding: utf-8 -*-\r\nimport torch.nn as nn\r\nimport torch\r\n\r\n\r\nclass ConvLSTMCell(nn.Module):\r\n def __init__(self, input_size,input_dim,hidden_dim,kernel_size,bias):\r\n super(ConvLSTMCell, self).__init__()\r\n\r\n self.height, self.width = input_size\r\n self.input_dim = inp...
[ [ "torch.abs", "torch.sigmoid", "torch.mean", "torch.nn.ConvTranspose2d", "torch.cat", "torch.nn.MaxUnpool2d", "torch.zeros", "torch.nn.Conv2d", "torch.tanh", "torch.nn.MaxPool2d", "torch.exp", "torch.cuda.is_available", "torch.split", "torch.stack" ] ]
waveletgap/wgap
[ "564423507747cc31c99e7bb01d46f869574a845d" ]
[ "splitDataset.py" ]
[ "\"\"\"\nScript that splits the dataset by ratio\n\"\"\"\n\nimport shutil\nimport os\nimport numpy as np\nimport argparse\n\ndef get_files_from_folder(path):\n\n files = os.listdir(path)\n return np.asarray(files)\n\ndef main(path_to_data, path_to_test_data, train_ratio):\n # get dirs\n _, dirs, _ = nex...
[ [ "numpy.asarray", "numpy.round" ] ]
BerenLuthien/ReAgent
[ "52f666670a7fa03206812ef48949f6b934d400f7" ]
[ "reagent/preprocessing/transforms.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport logging\nfrom typing import Callable, List, Optional\n\nimport numpy as np\nimport reagent.core.types as rlt\nimport torch\nimport torch.nn.functional as F\nfrom reagent.core.parameters import NormalizationDat...
[ [ "torch.ones", "torch.isnan", "torch.cat", "torch.einsum", "torch.nn.functional.one_hot", "torch.eye", "torch.broadcast_shapes", "torch.arange", "torch.device", "numpy.array" ] ]
AndreHenkel/dl_visualisation_comparison
[ "6bd1963d671c6d57c7b89ba5b083599725330fa7" ]
[ "lrp_framework/lrp/functional/utils.py" ]
[ "import torch\n\n# # # rhos\nidentity_fn = lambda w, b: (w, b)\n\n\ndef gamma_fn(gamma):\n def _gamma_fn(w, b):\n w = w + w * torch.max(torch.tensor(0., device=w.device), w) * gamma\n if b is not None: b = b + b * torch.max(torch.tensor(0., device=b.device), b) * gamma\n return w, b\n ...
[ [ "torch.max", "torch.tensor" ] ]
jonathanfrawley/PyAutoGalaxy
[ "55fb44f22ce5490318378dc31596c887d0d2e29b" ]
[ "autogalaxy/plane/plane.py" ]
[ "import numpy as np\r\n\r\nfrom autoarray.inversion import inversions as inv\r\nfrom autoarray.inversion import pixelizations as pix\r\nfrom autoarray.structures.arrays import values\r\nfrom autoarray.structures.arrays.two_d import array_2d\r\nfrom autoarray.structures.grids.two_d import grid_2d_irregular\r\nfrom a...
[ [ "numpy.zeros", "numpy.mean" ] ]
ontheskyl/SSD
[ "223dc14b780748ef627201a52cceabfde65e34fc" ]
[ "ssd/engine/inference.py" ]
[ "import logging\nimport os\n\nimport torch\nimport torch.utils.data\nfrom tqdm import tqdm\n\nfrom ssd.data.build import make_data_loader\nfrom ssd.data.datasets.evaluation import evaluate\n\nfrom ssd.utils import dist_util, mkdir\nfrom ssd.utils.dist_util import synchronize, is_main_process\nimport cv2\n\ndef _acc...
[ [ "torch.device", "torch.save", "torch.no_grad", "torch.load" ] ]
MarioBonse/flightmare
[ "4b8f53515914afe268bf89eb93a15fc33547e6b2" ]
[ "flightrl/rpg_baselines/common/distributions.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.ops import math_ops\nfrom gym import spaces\n\nfrom stable_baselines.common.tf_layers import linear\n\nEPS = 1e-6 # Avoid NaN (prevents division by zero or log of zero)\n# CAP the standard deviation of the actor\nLOG_STD_MAX = 2\nLOG_STD_MIN = -2...
[ [ "tensorflow.concat", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.tanh", "tensorflow.python.ops.math_ops.less", "tensorflow.stop_gradient", "tensorflow.square", "tensorflow.argmax", "numpy.log", "tensorflow.u...
KChen-lab/marker-selection
[ "3d6b015655095540ba3a0ab7e8682d4355065ad5" ]
[ "scmer/_umap_l1.py" ]
[ "from typing import List, Union, Optional\n\nimport torch\nfrom typing import Type\nfrom ._interfaces import _ABCSelector, _ABCTorchModel\nfrom ._base_selector import _BaseSelector\nfrom ._owlqn import OWLQN\n\nimport warnings\nimport multiprocessing\nimport numpy as np\n\nfrom sklearn.decomposition import PCA\n\nf...
[ [ "numpy.square", "numpy.dot", "numpy.log", "numpy.log2", "numpy.maximum", "numpy.abs", "numpy.sqrt", "numpy.unique", "numpy.min", "numpy.ones", "numpy.concatenate", "numpy.log10", "numpy.argpartition", "numpy.random.uniform", "torch.is_grad_enabled", ...
d-gol/katib
[ "2c8758b26ffd543e08b70464f8ac7b286f3ca2ea" ]
[ "pkg/suggestion/v1beta1/bayesianoptimization/model/gp.py" ]
[ "# Copyright 2022 The Kubeflow Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "sklearn.gaussian_process.kernels.RBF", "sklearn.gaussian_process.GaussianProcessRegressor", "sklearn.gaussian_process.kernels.Matern" ] ]
jessevp07/lcoc-ldevs
[ "c2dac1b17618fe50c3298aa3d915975a5740812a" ]
[ "lcoc/urdb.py" ]
[ "\"\"\"\nDatabaseRates object created from rates downloaded from the URDB, \nhttps://openei.org.\n\"\"\"\n#public\nimport sys\nimport glob\nimport logging\nimport warnings\nimport numpy as np\nimport pandas as pd\nfrom datetime import datetime\n\nsys.path.append('..\\\\')\nimport config as config\nimport lcoc.readw...
[ [ "numpy.array", "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
kamikaze0923/jtvae
[ "0292265bb97c31a925a03b18a3d3b38c560c89c6" ]
[ "molvae/sample.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lr_scheduler\nfrom torch.autograd import Variable\n\nimport math, random, sys\nfrom optparse import OptionParser\nfrom collections import deque\nimport rdkit\nimport rdkit.Chem as Chem\nfrom rdkit.Chem import Draw\...
[ [ "torch.manual_seed", "torch.load" ] ]
mspectorgoogle/clusterfuzz
[ "44df69cbcb94efc212f27758d45d6ff0f36061e5" ]
[ "src/clusterfuzz/_internal/bot/fuzzers/ml/rnn/train.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.TensorShape", "tensorflow.train.latest_checkpoint", "tensorflow.reduce_mean", "tensorflow.keras.losses.sparse_categorical_crossentropy", "tensorflow.equal", "tensorflow.squeeze", "tensorflow.keras.optimizers.Adam", "tensorflow.argmax", "numpy.array", "tensorflow...
TokisakiKurumi2001/transformer-based
[ "36553721e167406fb98b118750d5fc1f21ea29e9" ]
[ "Process.py" ]
[ "import pandas as pd\nimport torchtext\nfrom torchtext.legacy import data\nfrom Tokenize import tokenize\nfrom Batch import MyIterator, batch_size_fn\nimport os\nimport dill as pickle\n\ndef read_data(opt):\n \n if opt.src_data is not None:\n try:\n opt.src_data = open(opt.src_data).read().s...
[ [ "pandas.DataFrame" ] ]
damien-dumont/Image-Encryption
[ "490a62fc27dfde159962f32e82d174345e088176" ]
[ "Rough code/Encryption code/V0.9.py" ]
[ "import datetime\nimport rsa\nfrom math import sqrt\nimport numpy as np\nfrom PIL import Image\nimport random\nimport tkinter as tk\nimport tkinter as tk\nfrom tkinter.filedialog import askopenfilename, asksaveasfilename\n\nroot = tk.Tk()\nroot.title(\"Encryptor/Decryptor tool V1.0\")\n\nroot.rowconfigure(0, weight...
[ [ "numpy.array", "numpy.zeros" ] ]
Magdyedwar1996/python-level-one-codes
[ "066086672f43488bc8b32c620b5e2f94cedfe3da" ]
[ "Numpy/Anather_Functions.py" ]
[ "import numpy as np \n\n# We create a 2 x 2 ndarray\nX = np.array([[1,2], [3,4]])\n\n# We print x\nprint()\nprint('X = \\n', X)\nprint()\n\nprint('3 * X = \\n', 3 * X)\nprint()\nprint('3 + X = \\n', 3 + X)\nprint()\nprint('X - 3 = \\n', X - 3)\nprint()\nprint('X / 3 = \\n', X / 3)" ]
[ [ "numpy.array" ] ]
telesoho/pylab
[ "327d828ea18b419bad3d4b96b1625c700c56e55f" ]
[ "waveform.py" ]
[ "#coding:utf-8\n\"\"\"\nfilename: mp3-to-waveform.py\n\"\"\"\nfrom pydub import AudioSegment\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef main():\n \"\"\"\n 读取mp3片段,并显示波形\n \"\"\"\n song = AudioSegment.from_mp3('data/song.mp3')\n print(\n '样本宽度:', song.sample_width,\n '声道...
[ [ "numpy.sqrt", "numpy.fft.fft", "matplotlib.pyplot.plot", "numpy.frombuffer", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "numpy.fft.fftfreq", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ktw361/Local-Mid-Propagation
[ "0a99e82cccf8c35bc5f6989af2702203def4c7a4" ]
[ "mmdet/models/roi_extractors/rfcn_single_level.py" ]
[ "from __future__ import division\n\nimport torch.nn as nn\nfrom mmcv.cnn import normal_init\n\nfrom mmdet.ops import PSRoIPool\nfrom mmdet.core import force_fp32\nfrom ..registry import ROI_EXTRACTORS\n\n\n@ROI_EXTRACTORS.register_module\nclass RfcnPSRoIExtractor(nn.Module):\n \"\"\"Extract RoI features from a s...
[ [ "torch.nn.Conv2d" ] ]
deanrp2/revarie
[ "cf9c9e25f11622ec019f0dbf9bfa700f0ae7f10b" ]
[ "build/lib/test/test_fvariogram.py" ]
[ "import unittest\nfrom revarie.fvariogram import *\nimport numpy as np\nfrom revarie.models import *\nimport matplotlib.pyplot as plt\n\nclass TestFVariogram(unittest.TestCase):\n def test_poly(self):\n \"\"\"\n Test accuracy of polyfit\n \"\"\"\n x = np.linspace(0,10,100)\n\n ...
[ [ "numpy.sqrt", "numpy.linspace", "numpy.abs", "numpy.sin", "numpy.diff", "numpy.random.uniform" ] ]
apoorvagnihotri/airpy
[ "9555dca74111b9730bff2cd537f51e77d9702685" ]
[ "vayu/TheilSen.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jul 26 01:59:09 2019\n\n@author: Man Vinayaka\n\"\"\"\n\n\ndef TheilSen(df, pollutant):\n \"\"\" Plots a connected scatter plot of the average value of\n the pollutant every month of every year. Then plots a\n line of best fit through the plot showin...
[ [ "numpy.polyfit", "pandas.notnull", "pandas.to_datetime", "numpy.unique", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
ArseniiGav/Competition2-MLHEP21
[ "b6ae50b915def8f5b9367e073e64a4bb046b7fb0" ]
[ "idao/data_module.py" ]
[ "import pathlib as path\n\nimport pytorch_lightning as pl\nimport torch\nfrom torch.utils.data import DataLoader, random_split\nfrom torchvision import transforms\n\nfrom .dataloader import IDAODataset, img_loader, InferenceDataset\n\n\nclass IDAODataModule(pl.LightningDataModule):\n def __init__(self, data_dir:...
[ [ "torch.Generator", "torch.utils.data.DataLoader", "torch.tensor" ] ]
br5555/reinforcment_learning
[ "38c089d24ad0e904d25e9c6a111255f1fc51f265" ]
[ "Part_1_Deep_Q-Learning/Module_1_Self Driving_Car/map.py" ]
[ "# Self Driving Car\n\n# Importing the libraries\nimport numpy as np\nfrom random import random, randint\nimport matplotlib.pyplot as plt\nimport time\n\n# Importing the Kivy packages\nfrom kivy.app import App\nfrom kivy.uix.widget import Widget\nfrom kivy.uix.button import Button\nfrom kivy.graphics import Color, ...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "numpy.zeros", "numpy.sqrt" ] ]
Benjscho/mdptetris-experiments
[ "743113bfdcb309c7b9904d6bc5cc5cc65dc4d2e4" ]
[ "mdptetris_experiments/experiments/analysis/create_graphs.py" ]
[ "import ast\nimport csv\nimport sys\nfrom argparse import ArgumentParser, Namespace\nfrom typing import List\n\nimport matplotlib\nimport numpy as np\nimport pandas as pd\nfrom matplotlib import pyplot as plt\n\nfrom run_arg_parser import get_parser\n\nmatplotlib.rcParams['mathtext.fontset'] = 'cm'\nmatplotlib.rcPa...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
shayenne/VoiceDetection
[ "5b9ce0950da245fa9488301e3a024b06f363f4db" ]
[ "metrics.py" ]
[ "import matplotlib.pyplot as plt#\nimport numpy as np#\nimport sklearn#\nimport os\nimport glob\nimport librosa\nimport pandas as pd\nfrom IPython.display import Audio\nfrom sklearn.externals import joblib#\n\n\ndef zero_rule(vec_labels):\n # Now lets predict the labels of the test data!\n ones = np.ones(len(...
[ [ "matplotlib.pyplot.subplots", "sklearn.metrics.confusion_matrix", "sklearn.externals.joblib.load", "matplotlib.pyplot.show", "sklearn.metrics.accuracy_score" ] ]