repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
frotms/PP-LCNet-Pytorch
[ "30f7e8a634281706848b439ef618d03dcb21292f" ]
[ "pp_lcnet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n__all__ = [\n \"PPLCNet_x0_25\", \"PPLCNet_x0_35\", \"PPLCNet_x0_5\", \"PPLCNet_x0_75\", \"PPLCNet_x1_0\",\n \"PPLCNet_x1_5\", \"PPLCNet_x2_0\", \"PPLCNet_x2_5\"\n]\n\nNET_CONFIG = {\n \"blocks2\":\n #k, in_c, out_c, s, use_se\n ...
[ [ "torch.nn.Dropout", "torch.nn.functional.relu6", "torch.nn.Conv2d", "torch.nn.Flatten", "torch.nn.Linear", "torch.mul", "torch.nn.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
Dreem-Organization/dreem-learning-evaluation
[ "1e4c142d84634b60898845243b01b81d7eb4acec" ]
[ "plots/plot_confusion_matrix.py" ]
[ "import itertools\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom evaluation import ResultsEvaluation\n\n\ndef plot_confusion_matrix(model_confusion_matrix, scorer_confusion_matrix, dir='figures/'):\n data1, data2 = model_confusion_matrix, scorer_confusion_matrix\n for toto in range(2):\n ...
[ [ "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.grid", "matplotlib.pyplot.subplots_adjust", "matplotlib.colors.LinearSegmentedColormap.from_list", "numpy.array", "numpy.sum" ] ]
mdivband/arcade_swarm
[ "bd387495b73da5530c4b934e1155f7fd316f739e" ]
[ "standalone/objects.py" ]
[ "import arcade\r\nimport numpy as np\r\nimport random\r\nimport math\r\nimport time\r\nfrom matplotlib import pyplot as plt\r\nimport sklearn\r\nimport collections\r\n\r\n\r\n'''\r\nClass Object (abstract class)\r\n - A simple class which implements the simplest behaviour of each object in the simulations\r\n ...
[ [ "numpy.dot", "matplotlib.pyplot.imshow", "numpy.sqrt", "numpy.linspace", "numpy.asarray", "numpy.exp", "numpy.trunc", "numpy.clip", "numpy.arange", "scipy.interpolate.Rbf", "matplotlib.pyplot.close", "numpy.column_stack", "numpy.zeros", "matplotlib.pyplot.fi...
stephtdouglas/thejoker
[ "b1f2681cd72b6c04d19b24aadf818639c5f59ad0" ]
[ "thejoker/stats.py" ]
[ "# Third-party\nfrom numpy import log, pi\nfrom scipy.special import loggamma\n\n__all__ = ['beta_logpdf']\n\n\ndef beta_logpdf(x, a, b):\n denom = loggamma(a) + loggamma(b)\n res = loggamma(a+b) + (a-1)*log(x) + (b-1)*log(1-x) - denom\n return res.real\n\n\ndef norm_logpdf(x, mu, sig):\n return -0.5 * ...
[ [ "numpy.log", "scipy.special.loggamma" ] ]
DashaSerdyuk/tacotron2
[ "1a88669670750f8b0e1aff76abc8b1b15300e1dc" ]
[ "tacotron2/loss_function.py" ]
[ "from torch import nn\n\n\nclass MaskedMSELoss(nn.Module):\n def __init__(self):\n super(MaskedMSELoss, self).__init__()\n\n def forward(self, pred, target, output_lengths):\n squared_error = (target - pred) ** 2\n loss = (squared_error.mean(1).sum(1) / output_lengths).mean()\n ret...
[ [ "torch.nn.BCEWithLogitsLoss" ] ]
AustinDoolittle/imgaug
[ "4dbe189227be5306fa0716180d6419a5117d4894" ]
[ "imgaug/augmenters/size.py" ]
[ "\"\"\"\nAugmenters that somehow change the size of the images.\n\nDo not import directly from this file, as the categorization is not final.\nUse instead\n `from imgaug import augmenters as iaa`\nand then e.g. ::\n\n seq = iaa.Sequential([\n iaa.Scale({\"height\": 32, \"width\": 64})\n iaa.Crop...
[ [ "numpy.array", "numpy.pad" ] ]
cgsandford/improver
[ "3cfbf3323d3a693a9c61fec13350295b85d03676" ]
[ "improver/utilities/temporal.py" ]
[ "# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# (C) British Crown Copyright 2017-2021 Met Office.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following c...
[ [ "numpy.int64", "numpy.int" ] ]
schwendp/hoomd-blue
[ "df7970121b19bc4f8674348ab3241055ac87153b", "df7970121b19bc4f8674348ab3241055ac87153b" ]
[ "hoomd/md/test-py/test_dihedral_harmonic.py", "hoomd/hpmc/validation/wca_dumbbell.py" ]
[ "# -*- coding: iso-8859-1 -*-\n# Maintainer: joaander\n\nfrom hoomd import *\nfrom hoomd import md\ncontext.initialize()\nimport unittest\nimport os\nimport numpy\n\n# tests md.dihedral.harmonic\nclass dihedral_harmonic_tests (unittest.TestCase):\n def setUp(self):\n print\n snap = data.make_snapsh...
[ [ "numpy.array", "numpy.random.random" ], [ "numpy.mean" ] ]
MartinKondor/MachineLearning
[ "2deb257796cb63bcc4d13594484e266a93ab7a83" ]
[ "visualizations/gradient_descent.py" ]
[ "import numpy as np\nimport random\nfrom matplotlib import pyplot as plt\n\n\nclass GradientDescentPlot(object):\n\n def __init__(self,\n random_X=True,\n range_X=range(-20, 21),\n learning_rate=0.1,\n function=lambda x: x**2 + 1,\n funct...
[ [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.savefig", "numpy.max", "matplotlib.pyplot.clf", "matplotlib.pyplot.ion", "matplotlib.pyplot.pause" ] ]
k-ishiguro/chainer-chemistry
[ "aec33496def16e76bdfbefa508ba01ab9f79a592" ]
[ "tests/saliency_tests/visualizer_tests/test_mol_visualizer.py" ]
[ "import os\n\nimport numpy\nimport pytest\nfrom rdkit import Chem\n\nfrom chainer_chemistry.saliency.visualizer.mol_visualizer import MolVisualier # NOQA\nfrom chainer_chemistry.saliency.visualizer.mol_visualizer import SmilesVisualizer # NOQA\n\n\ndef test_mol_visualizer(tmpdir):\n # Only test file is saved w...
[ [ "numpy.array" ] ]
tenkeyless/image-keras
[ "09da179d75bb7a17d76e4fd7456b1667c8b4f62b", "09da179d75bb7a17d76e4fd7456b1667c8b4f62b" ]
[ "image_keras/tf/utils/gpu_check.py", "image_keras/utils/image_slice.py" ]
[ "import tensorflow as tf\n\n\ndef check_first_gpu():\n # GPU Setting\n gpus = tf.config.experimental.list_physical_devices(\"GPU\")\n if gpus:\n # 텐서플로가 첫 번째 GPU만 사용하도록 제한\n try:\n tf.config.experimental.set_visible_devices(gpus[0], \"GPU\")\n tf.config.experimental.set_...
[ [ "tensorflow.config.experimental.list_physical_devices", "tensorflow.config.experimental.set_visible_devices", "tensorflow.config.experimental.set_memory_growth" ], [ "numpy.pad" ] ]
SunilSimha/goodman_pipeline
[ "f99ebec0879a0e54aef6e8346bd1ba3cf46fe551" ]
[ "goodman_pipeline/core/core.py" ]
[ "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport calendar\nimport ccdproc\nimport collections\nimport datetime\nimport glob\nimport logging\nimport math\nimport numpy as np\nimport os\nimport pandas\nimport random\nimport re\nimport subprocess\...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.imshow", "scipy.signal.correlate", "numpy.arctan", "numpy.asarray", "numpy.linspace", "numpy.nan_to_num", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.max", "numpy.mean", "numpy.ma.is_masked", "numpy.where",...
knasti/size_constrained_clustering
[ "85e8a862e23cf6b55fd28295ebf7b73ce8419b63" ]
[ "size_constrained_clustering/equal.py" ]
[ "#!usr/bin/python 3.7\n#-*-coding:utf-8-*-\n\n'''\n@file: same_size_kmeans.py, equal size clustering with heuristics\n@Author: Jing Wang (jingw2@foxmail.com)\n@Date: 06/16/2020\n@paper: \n@github reference: https://github.com/joshlk/k-means-constrained\n@Web: https://elki-project.github.io/tutorial/same-size_k_mean...
[ [ "numpy.square", "numpy.min", "sklearn.preprocessing.OneHotEncoder", "numpy.max", "numpy.argmin", "numpy.zeros_like", "numpy.ma.masked_array", "numpy.argsort", "numpy.random.RandomState", "numpy.zeros", "numpy.sum" ] ]
arobert01/ITK
[ "230d319fdeaa3877273fab5d409dd6c11f0a6874" ]
[ "Modules/Core/Common/wrapping/test/itkMatrixTest.py" ]
[ "# ==========================================================================\n#\n# Copyright NumFOCUS\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://...
[ [ "numpy.eye", "numpy.array_equal" ] ]
yjzhang/uncurl_net
[ "ac8e6798f115dec251354edf90d44a6d190f11aa" ]
[ "run_all_experiments.py" ]
[ "import numpy as np\nfrom scipy import sparse\nimport torch\nimport uncurl\nfrom uncurl import experiment_runner\n\nfrom deep_uncurl_pytorch import UncurlNet\nfrom experiments import UncurlNetRunner\n\n\nif __name__ == '__main__':\n ################################################ dataset 1: Tasic\n import os...
[ [ "scipy.sparse.csc_matrix", "pandas.read_csv", "pandas.DataFrame" ] ]
ShunyuYao/HyperSaver
[ "6886c6a0c80e8b5d84c60627e533828b98f4ceb7" ]
[ "HyperSaver.py" ]
[ "import pandas as pd\nimport os\nimport time\nimport json\nimport requests\nimport warnings\nfrom collections import OrderedDict\n\n\nclass HyperSaver(object):\n \"\"\"\n A helper class to save hyperparameters and performance\n after neural network training and testing.\n \"\"\"\n\n def __init__(self...
[ [ "pandas.read_excel", "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
inwise/Pyrgos-RFBR-
[ "e139b56a8d05f668d609e1e48919827ebcfb3bbe" ]
[ "MachineLearningApplications/forest_position_maker.py" ]
[ "import numpy as np\nimport pandas as pd\n\"\"\"\nЭтот скрипт читает файл с данными об индикаторах и ценах закрытия и формирует стратегию, основанную на предсказаниях\nлеса-регрессора.\n\nФормат нужного файла - csv\nНеобходимые колонки внутри:\n<CLOSE>\n<FOREST_CLOSE>\nОн формирует новый файл, который содержит инфо...
[ [ "numpy.array", "pandas.read_csv", "pandas.DataFrame" ] ]
nicolasmetallo/train-custom-segmentation-model-with-icevision-openimages-sagemaker
[ "f1776ef6e3637856c8e9e817ee07494c9bed2e23" ]
[ "0_notebooks/openimages/download.py" ]
[ "import argparse\nimport concurrent.futures\nimport io\nimport logging\nimport os\nfrom typing import Dict, List, Set\nimport urllib3\nimport warnings\n\nimport boto3\nimport botocore\nimport lxml.etree as etree\nimport pandas as pd\nimport requests\nfrom tqdm import tqdm\n\nfrom cvdata.utils import image_dimension...
[ [ "pandas.read_csv" ] ]
anonymous1computervision/REID
[ "125a520a9c0b94440a7757e6f3c3c8bf976906ec" ]
[ "models/IDE.py" ]
[ "# encoding: utf-8\nimport copy\nimport itertools\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\nimport random\nfrom scipy.spatial.distance import cdist\nfrom sklearn.preprocessing import normalize\nfrom torch import nn, optim\nfrom torch.utils.data ...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.AdaptiveAvgPool2d" ] ]
Stanford-ILIAD/Learning-Feasibility-Different-Dynamics
[ "c89bfe0a0be653460fe58c9c138f11ebd8495365" ]
[ "mujoco/setup1/main_feasibility.py" ]
[ "import argparse\nfrom itertools import count\n\nimport gym\nimport scipy.optimize\n\nimport pdb\nimport torch\nfrom torch.autograd import Variable\n\nfrom jax_rl.agents import AWACLearner, SACLearner\nfrom jax_rl.datasets import ReplayBuffer\nfrom jax_rl.evaluation import evaluate\nfrom jax_rl.utils import make_en...
[ [ "torch.set_default_tensor_type", "torch.load", "torch.manual_seed", "numpy.concatenate", "numpy.mean", "numpy.array" ] ]
NingMiao/mfcvae
[ "6c6b83bd05fdc618db3976da5faf54838af7e334" ]
[ "models_fc.py" ]
[ "\nimport torch\nimport torch.nn as nn\nfrom utils import build_fc_network\nfrom typing import List\n\n\nclass FCsharedEncoder(nn.Module):\n def __init__(self, layer_dims: List[int], J_n_mixtures: int, activation: str = \"relu\",\n dropout_prob: float = 0., do_fc_batch_norm: bool = False):\n ...
[ [ "torch.randn", "torch.nn.ModuleList", "torch.nn.Identity", "torch.cat" ] ]
Topographically-Best-Path/TopoTraversal
[ "3a38630c4f50f349192d7255dc0f59eeefb5309f" ]
[ "src/algo.py" ]
[ "from typing import Tuple\nfrom typing import List\nimport numpy as np\nimport constants\nimport heapq\nimport data\nimport math\n\ndef read() -> List[List[Tuple[float, float, float]]]:\n \"\"\"\n Reads points from the file written by the data module into a 2D list.\n The way the data is structured from th...
[ [ "numpy.array", "numpy.argmin", "numpy.full" ] ]
ALavault/tf_timbral_models
[ "302923f48e4bb09d7aaa3197758cd7764ac71d47" ]
[ "stats_sharpness.py" ]
[ "import glob\nimport logging\nimport os\nimport sys\nimport warnings\n\nimport numpy as np\nimport tensorflow as tf\nfrom scipy import signal, stats\n\nfrom timbral_models import (filter_audio_highpass, tf_filter_audio_highpass,\n tf_timbral_sharpness, timbral_sharpness,\n ...
[ [ "tensorflow.convert_to_tensor", "numpy.std", "numpy.mean", "tensorflow.expand_dims" ] ]
GopiKishan14/Self_Balancing_Bot
[ "54412c67f38957a3e74bcb5d6344ed43329f5f03" ]
[ "balancebot-project/balance_bot/envs/__init__.py" ]
[ "from balance_bot.envs.balancebot_env import BalancebotEnv\nimport math\nimport numpy as np\nimport pybullet as p\nimport pybullet_data\nfrom gym import spaces\n\ndef __init__(self):\n self._observation = []\n self.action_space = spaces.Discrete(9)\n # pitch, gyro, commanded speed\n self.observation_spa...
[ [ "numpy.array" ] ]
leonardoedgar/robotsp
[ "5b589e662d40e8985af3497dab78dea93792bd73" ]
[ "scripts/run_benchmarks.py" ]
[ "#!/usr/bin/env python\nimport os\nimport h5py\nimport time\nimport rospy\nimport logging\nimport argparse\nimport numpy as np\nimport networkx as nx\nimport resource_retriever\nimport progressbar as pbar\nimport openravepy as orpy\nfrom collections import defaultdict\n# Utils\nimport criutils as cu\nimport raveuti...
[ [ "numpy.random.seed", "numpy.random.choice", "numpy.set_printoptions", "numpy.deg2rad", "numpy.prod" ] ]
botakab/contextfreesgns
[ "4b5a148ab554a8e401b381fba3c3acbe30a31639" ]
[ "model.py" ]
[ "import torch\nimport numpy as np\n\n\nclass SkipGramModel(torch.nn.Module):\n def __init__(self, vocab_size, emb_dimension):\n super(SkipGramModel, self).__init__()\n self.vocab_size = vocab_size\n self.emb_dimension = emb_dimension\n self.u_embeddings = torch.nn.Embedding(vocab_size...
[ [ "torch.mean", "torch.nn.init.uniform_", "torch.nn.init.constant_", "torch.nn.functional.logsigmoid", "torch.nn.Embedding", "torch.matmul", "torch.mul", "torch.clamp" ] ]
AakashSrinivasan03/GlossBert-GraphEmbeddings
[ "13a6522ecd3cb265368d63dde5781e5fcc59ce79", "13a6522ecd3cb265368d63dde5781e5fcc59ce79" ]
[ "modeling_gloss.py", "run_classifier_WSD_token.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport copy\nimport json\nimport logging\nimport math\nimport os\nimport shutil\nimport tarfile\nimport tempfile\nimport sys\nfrom io import open\n\nimport torch\nfrom torch import nn\nfrom torch.nn import CrossEntropyLoss\n\nlog...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.Linear", "torch.nn.Dropout" ], [ "torch.nn.functional.softmax", "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.device", "torch.distributed.get_rank", "torch.nn.Cr...
ashaltu/crier
[ "44029c006696cf27c37e3860bbf3956cd18a600b" ]
[ "backend/search_engine.py" ]
[ "import os\nimport numpy as np\nimport utils\nfrom itertools import islice\n\n\n# Local\nimport model_defs\n\nclass SearchEngine(object):\n def __init__(self, image_size, num_results):\n self.image_size = image_size\n self.num_results = num_results\n self.search_engine = None\n\n # Create image...
[ [ "numpy.array" ] ]
sowmen/lanedet
[ "367522c3e1aa8beb41c928005faf97388194d02a", "367522c3e1aa8beb41c928005faf97388194d02a" ]
[ "lanedet/models/heads/lane_seg.py", "lanedet/models/backbone/resnet.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom lanedet.core.lane import Lane\nimport cv2\nimport numpy as np\n\nfrom ..registry import HEADS, build_head\n\n@HEADS.register_module\nclass LaneSeg(nn.Module):\n def __init__(self, decoder, exist=None, thr=0.6,\n sample_y=None, ...
[ [ "torch.nn.functional.softmax", "torch.nn.NLLLoss", "torch.ones", "torch.nn.functional.log_softmax", "numpy.max", "torch.nn.BCEWithLogitsLoss", "numpy.argmax", "numpy.array", "numpy.flip" ], [ "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.Conv2d", ...
jiohyoo/gamelanpy
[ "e4af6ddb95fd5a6c24cc648e154d2daf1ce320d4" ]
[ "gamelanpy/imputation_util.py" ]
[ "__author__ = 'jiohyoo'\n\nimport numpy as np\nfrom numpy.linalg import inv\nfrom numpy.random import multivariate_normal\nfrom sklearn.mixture import GMM\nfrom sklearn.mixture.gmm import _log_multivariate_normal_density_full\nfrom sparse_gmm import SparseGMM\n\n\ndef predict_missing_values(model, data):\n if no...
[ [ "sklearn.mixture.gmm._log_multivariate_normal_density_full", "numpy.ix_", "numpy.asarray", "numpy.random.multivariate_normal", "numpy.isnan", "numpy.linalg.inv", "numpy.argmax", "numpy.empty" ] ]
jonpas/FERI-GeomCalc
[ "afa2afe1f0274b1081de70a180ab6b0ee9f9ebbd" ]
[ "common.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy as np\n\n\n# Compares 2 numbers if equal, designed for floats to overcome precision errors\ndef almost_equal(a, b):\n return np.abs(a - b) < 0.000001\n\n\n# Faster implementation of np.cross() for 2 vectors (3 points) returning magnitude directly\ndef area_triangle(a, b, c...
[ [ "numpy.abs" ] ]
code-cullison/pyaspect
[ "ee06a6c33877c5c43c7b8875d4a8b3f307fa6ab1" ]
[ "model/gridmod3d.py" ]
[ "import numpy as np\nimport pyvista as pv\nimport matplotlib.pyplot as plt\nfrom scipy.interpolate import RegularGridInterpolator\nfrom scipy.ndimage import gaussian_filter1d\nimport time\nimport copy\nfrom tqdm import tqdm\n\nclass gridmod3d:\n\n _subprops = None\n _nprops = None\n\n _ncells = None\n ...
[ [ "numpy.abs", "numpy.meshgrid", "numpy.min", "numpy.arange", "scipy.interpolate.RegularGridInterpolator", "scipy.ndimage.gaussian_filter1d", "numpy.cos", "numpy.sin", "numpy.max", "numpy.copy", "numpy.array", "numpy.zeros" ] ]
sugarcrm-developers/sugar-fraud-detector
[ "ea7f79419503191d3dca3066a311241d8dc9e455" ]
[ "src/scripts/filter-by-date.py" ]
[ "import pandas as pd\n \n# Note that \"date\" is a pandas keyword so not wise to use for column names\ndf = pd.read_csv('./fraudTrain.csv', dtype={'cc_num': 'str'}, parse_dates=[1]) # assumes transaction_date column is the 1st column (0-based)\n\n# choose start/end dates as filters (here is 1 year worth of data)\n...
[ [ "pandas.read_csv", "pandas.to_datetime" ] ]
cadurosar/pgdl
[ "d116a175b15b70d09e90fee85bb5a2049f8251fa" ]
[ "ingestion_program/ingestion.py" ]
[ "# Copyright 2020 The PGDL Competition organizers.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless ...
[ [ "tensorflow.keras.backend.clear_session" ] ]
xuannianc/keras-retinanet
[ "d1da39592042927aaf3b3eb905a308c327983bed" ]
[ "keras_retinanet/utils/test_eval.py" ]
[ "import numpy as np\n\n\ndef _compute_ap(recall, precision):\n \"\"\" Compute the average precision, given the recall and precision curves.\n\n Code originally from https://github.com/rbgirshick/py-faster-rcnn.\n\n # Arguments\n recall: The recall curve (list).\n precision: The precision c...
[ [ "numpy.concatenate", "numpy.where", "numpy.maximum", "numpy.sum" ] ]
guyujun/iNNterfaceDesign
[ "cf3bf51124f4a8a6467152c67ba1331486a10cca" ]
[ "iNNterfaceDesign_scripts/3.preprocessing_seq.py" ]
[ "import os, copy, numpy as np, sys, json, random, shutil\nfrom modules import Class_protein as cp, Amino_acid_dictionaries as ad, functions as f, make_data_aas as mk\nfrom pyrosetta import *\nfrom pyrosetta.teaching import *\nfrom pyrosetta.rosetta.protocols.relax import *\nfrom pyrosetta.rosetta.core.pack.task imp...
[ [ "numpy.set_printoptions", "numpy.array", "numpy.argmin" ] ]
jemilc/shap
[ "ed284b6278813c5292d83dc2a22976a0fdedd4ec" ]
[ "shap/explainers/pytree.py" ]
[ "\"\"\"\nThis module is a pure python implementation of Tree SHAP.\nIt is primarily for illustration since it is slower than the 'tree'\nmodule which uses a compiled C++ implmentation.\n\"\"\"\nimport numpy as np\n#import numba\nfrom .explainer import Explainer\n\ntry:\n import xgboost\nexcept ImportError:\n ...
[ [ "numpy.max", "numpy.zeros" ] ]
wingbender/rlpyt
[ "168993d8b4bf5ce44334dd4f0722a1600bb1973a", "168993d8b4bf5ce44334dd4f0722a1600bb1973a" ]
[ "rlpyt/envs/gym.py", "rlpyt/ul/models/ul/pixel_control_models.py" ]
[ "\nimport numpy as np\nimport gym\nfrom gym import Wrapper\nfrom gym.wrappers.time_limit import TimeLimit\nfrom collections import namedtuple\n\nfrom rlpyt.envs.base import EnvSpaces, EnvStep\nfrom rlpyt.spaces.gym_wrapper import GymSpaceWrapper\nfrom rlpyt.utils.collections import is_namedtuple_class\n\n\nclass Gy...
[ [ "numpy.dtype" ], [ "torch.nn.Sequential", "torch.nn.ConvTranspose2d", "numpy.prod", "torch.nn.Sigmoid" ] ]
DongHande/AutoDebias
[ "3e32542a369ba887560cfefb3faaabca9dfa03af" ]
[ "utils/metrics.py" ]
[ "import numpy as np\nfrom scipy.sparse import lil_matrix\nimport torch\nimport pandas as pd\n\nimport utils.data_loader\nimport cppimport.import_hook\nimport utils.ex as ex\n\n# ex = cppimport.imp('ex')\n\ndef calc(n,m,ttuser,ttitem,pre,ttrating,atk=5):\n user=ttuser.cpu().detach().numpy()\n item=ttitem.cpu()...
[ [ "torch.mean", "torch.max", "torch.sum", "numpy.ones", "torch.exp", "torch.where", "numpy.argsort", "torch.argsort", "numpy.where" ] ]
puru2411/Robotic-arm-3-and-6-dof-
[ "6cb3811af29d5ff6afa4766f698871f6c4310453" ]
[ "6dof/invkin_puru.py" ]
[ "\"\"\"\r\n\tcode by purushotam kumar agrawal {git --> PURU2411 }\r\n\tInverse kinematics of 6 dof KUKA arm\r\n\"\"\"\r\n\r\nfrom sympy import symbols, cos, sin, pi, simplify, pprint, tan, expand_trig, sqrt, trigsimp, atan2\r\nfrom sympy.matrices import Matrix\r\n\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nimpo...
[ [ "numpy.dot", "numpy.sqrt", "numpy.arctan", "numpy.reshape", "numpy.arccos", "numpy.cos", "matplotlib.pyplot.draw", "numpy.arctan2", "numpy.sin", "numpy.transpose", "numpy.array", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.pyplot.figure"...
jiwei0921/JSM
[ "2210d5da4540555372c8212429bd2384d170a32a" ]
[ "JSM_weakly/model/Sal_depth.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.parameter import Parameter\nimport numpy as np\nimport scipy.stats as st\nfrom model.CPD_ResNet_models import CPD_ResNet\nimport matplotlib.pyplot as plt\n\n\ndef gkern(kernlen=16, nsig=3):\n interval = (2*nsig+1.)/kernlen\n ...
[ [ "scipy.stats.norm.cdf", "numpy.linspace", "torch.nn.functional.conv2d", "torch.zeros_like", "torch.from_numpy", "torch.mul", "torch.where", "numpy.outer", "torch.ones_like", "torch.nn.init.kaiming_normal_" ] ]
bartbroere/ray
[ "be33bf8ea04575364fb74d51174764713818fd56" ]
[ "python/ray/tune/logger.py" ]
[ "import csv\nimport json\nimport logging\nimport numpy as np\nimport os\nimport yaml\n\nfrom typing import Iterable, TYPE_CHECKING, Dict, List, Optional, TextIO, Type\n\nimport ray.cloudpickle as cloudpickle\n\nfrom ray.tune.callback import Callback\nfrom ray.tune.utils.util import SafeFallbackEncoder\nfrom ray.uti...
[ [ "numpy.isnan" ] ]
jwcalder/AMAAZETools
[ "506a6ea0223621f3c874edc4b457df99f9331e77" ]
[ "build/lib.linux-x86_64-3.8/amaazetools/mesh_segmentation.py" ]
[ "import numpy as np\nimport graphlearning as gl\nimport matplotlib.pyplot as plt\nimport sklearn.datasets as datasets\nimport scipy.sparse as sparse\nimport scipy.spatial as spatial\nfrom sklearn.neighbors import NearestNeighbors\nimport amaazetools.edge_detection as ed\n\n# Version of Poisson learning to compute c...
[ [ "numpy.sqrt", "numpy.squeeze", "numpy.max", "numpy.zeros_like", "numpy.mean", "numpy.cross", "scipy.spatial.cKDTree", "numpy.random.default_rng", "numpy.square", "numpy.unique", "numpy.arange", "numpy.std", "numpy.argmax", "sklearn.neighbors.NearestNeighbors...
icon-lab/provoGAN
[ "e4abee668ca5a5733a04c0e27e379a0434b0270f" ]
[ "test_SC-GAN.py" ]
[ "import os\r\nfrom options.test_options import TestOptions\r\nfrom data import CreateDataLoader\r\nfrom models import create_model\r\nfrom util.visualizer import Visualizer\r\nfrom util import html\r\nfrom data_custom.data_load import load_nifty_volume_as_array\r\nfrom data_custom.data_load import save_array_as_nif...
[ [ "numpy.squeeze", "numpy.array", "numpy.expand_dims", "torch.from_numpy" ] ]
shaurya0/tensorflow
[ "ac8e67399d75edce6a9f94afaa2adb577035966e" ]
[ "tensorflow/contrib/framework/python/ops/script_ops.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.util.nest.assert_shallow_structure", "tensorflow.python.ops.script_ops.py_func", "tensorflow.python.util.nest.map_structure_up_to", "tensorflow.python.util.nest.pack_sequence_as", "tensorflow.python.util.nest.flatten" ] ]
jiansowa/PaddleSlim
[ "a45431c99a775782b7fe5633f313d36ff582e797" ]
[ "demo/auto_prune/train.py" ]
[ "import os\nimport sys\nimport logging\nimport paddle\nimport argparse\nimport functools\nimport math\nimport time\nimport numpy as np\nimport paddle.fluid as fluid\nfrom paddleslim.prune import AutoPruner\nfrom paddleslim.common import get_logger\nfrom paddleslim.analysis import flops\nsys.path.append(sys.path[0] ...
[ [ "numpy.array", "numpy.mean" ] ]
wearepal/landscapes-ml
[ "10b0159201d15358b97716ad6a3f89747eb634e5" ]
[ "landscapes/relay.py" ]
[ "from __future__ import annotations\nimport os\nfrom pathlib import Path\nfrom typing import Any, Dict, List, Optional, cast\n\nimport attr\nfrom fairscale.nn import auto_wrap # type: ignore\nfrom hydra.utils import instantiate\nimport numpy as np\nfrom omegaconf import DictConfig\nimport pandas as pd # type: ign...
[ [ "torch.cat", "numpy.stack", "torch.save" ] ]
ripl-org/predict-medicaid-ed
[ "ba0467eed3579989cde2aaa4710751544c601bdd" ]
[ "source/models/residuals.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\nimport sys\n\nsns.set()\n\nin_file, out_file = sys.argv[1:]\n\ndf = pd.read_csv(in_file)\nplt.figure(figsize=(6, 6))\nsns.jointplot(df.residual, df.fitted, kind=\"hex\")\nplt.tight_layout()\nplt.savefig(out_file)\n\n# vim: expandtab sw=4 ...
[ [ "matplotlib.pyplot.tight_layout", "pandas.read_csv", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure" ] ]
MarsPain/siamese_network
[ "359a568ceb9af4145fc0f5424c3bd993bf70a40b" ]
[ "pytorch/train.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n# @Author: lapis-hong\n# @Date : 2018/5/15\nimport os\nimport sys\n\nimport argparse\n\nimport torch\nimport torch.autograd as autograd\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\n\nf...
[ [ "torch.max", "torch.cuda.manual_seed", "torch.cat", "torch.manual_seed", "torch.nn.functional.binary_cross_entropy_with_logits", "torch.utils.data.DataLoader", "torch.nn.CosineEmbeddingLoss", "torch.save", "torch.cuda.is_available", "torch.squeeze", "torch.autograd.Vari...
EXYNOS-999/deep_reinforcement_racing
[ "c3b084bf7970a5c649ce38ae41e87f16dff75c60" ]
[ "plot_toronto_waypoints.py" ]
[ "# Python 2.7\r\n# Shamir Alavi\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\ntrack_name = \"Canada_Training\"\r\nabsolute_path = \".\"\r\nwaypoints = np.load(\"%s/%s.npy\" % (absolute_path, track_name))\r\n\r\nprint(\"Number of waypoints = \" + str(waypoints.shape[0]))\r\n\r\nnum_waypoints = ...
[ [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.annotate", "numpy.load", "matplotlib.pyplot.show" ] ]
sen-lee/detection_license_plate
[ "940772656d014da20006b077a4264b3f7ace80f9" ]
[ "tests/data/test_detection_utils.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport copy\nimport numpy as np\nimport os\nimport unittest\nimport pycocotools.mask as mask_util\n\nfrom detectron2.data import MetadataCatalog, detection_utils\nfrom detectron2.data import transforms as T\nfrom detectron2.structures import BitMasks, BoxMode\n...
[ [ "numpy.asarray", "numpy.random.rand", "numpy.zeros", "numpy.allclose" ] ]
haesleinhuepf/cupyimg
[ "1fbe5d5ed53a030eb0dfbf618a0b194af1cac2ae" ]
[ "cupyimg/scipy/ndimage/measurements.py" ]
[ "import warnings\n\nimport cupy\nimport numpy\n\nfrom cupyimg import _misc\n\n\n__all__ = [\n \"labeled_comprehension\",\n \"sum\",\n \"mean\",\n \"variance\",\n \"standard_deviation\",\n \"minimum\",\n \"maximum\",\n \"median\",\n \"minimum_position\",\n \"maximum_position\",\n \"e...
[ [ "numpy.asarray", "numpy.add.reduce", "numpy.indices", "numpy.zeros", "numpy.array", "numpy.where", "numpy.empty" ] ]
qpochlabs/feacher
[ "de4b8ef1ced03aaf694a8c7e593f2f5e4d3e9859" ]
[ "feacher/feature_extractor.py" ]
[ "import torch\nfrom feacher import preprocess as ps\nfrom feacher import model as ml\n\n\ndef feature_vector(pretrained_model, image, resize_dim, layer):\n model = ml.Model(pretrained_model=pretrained_model)\n input_image = ps.image_preprocess(image, resize_dim)\n input_batch = input_image.unsqueeze(0)\n\n...
[ [ "torch.no_grad" ] ]
levanpon98/ZaloAiHackathon2019
[ "02b754092395377891522a99ed03d530193f60dd" ]
[ "generators/coco.py" ]
[ "\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable la...
[ [ "numpy.concatenate", "numpy.empty" ] ]
Skyorca/gcn
[ "6ef40db88fc830073fcb86d1bfeb68264cb5b8c7" ]
[ "gcn/utils.py" ]
[ "import numpy as np\nimport pickle as pkl\nimport networkx as nx\nimport scipy.sparse as sp\nfrom scipy.sparse.linalg.eigen.arpack import eigsh\nimport sys\n\n\ndef parse_index_file(filename):\n \"\"\"Parse index file.\"\"\"\n index = []\n for line in open(filename):\n index.append(int(line.strip())...
[ [ "scipy.sparse.coo_matrix", "scipy.sparse.isspmatrix_coo", "numpy.power", "scipy.sparse.eye", "scipy.sparse.diags", "numpy.sort", "scipy.sparse.linalg.eigen.arpack.eigsh", "scipy.sparse.csr_matrix", "scipy.sparse.vstack", "numpy.array", "numpy.zeros", "numpy.isinf", ...
sdchen6/MLHW1-Decision-Trees
[ "a8f7049a561e1c8ecb43fbff80e58499247ae081" ]
[ "src/prior_probability.py" ]
[ "import numpy as np\r\n\r\nclass PriorProbability():\r\n def __init__(self):\r\n \"\"\"\r\n This is a simple classifier that only uses prior probability to classify \r\n points. It just looks at the classes for each data point and always predicts\r\n the most common class.\r\n\r\n ...
[ [ "numpy.full", "numpy.unique" ] ]
likelyzhao/Swin-Transformer-Object-Detection
[ "4003ea497e32be85b657a928e6b7d8f782e578ff" ]
[ "mmdet/models/dense_heads/atss_head.py" ]
[ "import torch\nimport torch.nn as nn\nfrom mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init\nfrom mmcv.runner import force_fp32\n\nfrom mmdet.core import (anchor_inside_flags, build_assigner, build_sampler,\n images_to_levels, multi_apply, multiclass_nms,\n ...
[ [ "torch.isnan", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.zeros_like", "torch.arange", "torch.tensor", "torch._shape_as_tensor", "torch.where", "torch.split", "torch.stack", "torch.nn.ReLU", "torch.onnx.is_in_onnx_export" ] ]
leshkin/textometr
[ "f557ebf79e46a87457cf0e1c7cfa9f6fdad1ad3a" ]
[ "backend/app/analyzer_2000.py" ]
[ "# Объединенный файл из двух аналайзеров, для РКИ и для родного.\n\nimport re\nimport statistics\nfrom collections import defaultdict\n\nimport nltk\nimport numpy as np\nimport pandas as pd\nimport pymystem3\nfrom joblib import load\nfrom nltk.tokenize import sent_tokenize\nfrom sklearn import linear_model\n\n\ncla...
[ [ "numpy.array", "sklearn.linear_model.Ridge", "pandas.read_csv", "numpy.mean" ] ]
OpenToxiMap/OpenToxiMap
[ "c29ee4582845f26f819873f7bd7ddbd3792aec81" ]
[ "ETL/download_all_tri_states.py" ]
[ "from urllib.request import urlretrieve\nfrom pathlib import Path\nfrom tqdm import tqdm\nimport pandas as pd\n\nstates = [\n\"AL\",\n\"AK\",\n\"AZ\",\n\"AR\",\n\"CA\",\n\"CO\",\n\"CT\",\n\"DE\",\n\"FL\",\n\"GA\",\n\"HI\",\n\"ID\",\n\"IL\",\n\"IN\",\n\"IA\",\n\"KS\",\n\"KY\",\n\"LA\",\n\"ME\",\n\"MD\",\n\"MA\",\n\"...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
gsmafra/py-aasp-casa
[ "5ff37c35cd61a2aa2158836b0eba209192b6fba0" ]
[ "examples/example.py" ]
[ "import numpy as np\nfrom librosa import stft\nfrom sklearn.svm import SVC\nfrom aaspcasa import file_feats, train_folds\n\ndef extract_m_lspectre(fs, sig, args):\n\n\t# Extract a descriptor for one file of the database. This function will run\n\t# only one time for each file in a simulation. You don't want to extr...
[ [ "numpy.asarray", "numpy.mean", "numpy.abs", "sklearn.svm.SVC" ] ]
shredstar/learning_tensorflow
[ "3e4da4d3a139a50677538efa6bf47cb1d30f8bc7" ]
[ "mnist_softmax.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.matmul", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.InteractiveSession", "tensorflow.zeros", "tensorflow.cast", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.argmax",...
ZachGlassman/ZachGlassman.github.io
[ "24791a01e6c567b1969b675f0dd6289f1b988853" ]
[ "Graphs/linegraphgenerator.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom bokeh.io import vform\nfrom bokeh.models import Callback, ColumnDataSource, Slider\nfrom bokeh.plotting import figure, output_file, save\nfrom bokeh.embed import components\nfrom bokeh.resources import CDN\nimport numpy as np\n\noutput_file(\"LineGraph.html\", \"Line Graph\")\n\nslo...
[ [ "numpy.arange" ] ]
MKulfan/redbull-analytics-hol
[ "d3e96c195912b49fbe425557ccfbfe4796ab6d0b" ]
[ "beginners/web/testpredictor.py" ]
[ "import predictor\r\nimport pandas as pd\r\n\r\nactive_drivers = [['Daniel Ricciardo','McLaren'], \r\n ['Mick Schumacher','Haas F1 Team'], \r\n ['Carlos Sainz','Ferrari'],\r\n ['Valtteri Bottas','Mercedes'], \r\n ['Lance Stroll','Aston Martin'], \r...
[ [ "pandas.DataFrame" ] ]
jalajthanaki/quick-nlp
[ "861a54c9e30de076a2316cb6712d934de4058cc5", "861a54c9e30de076a2316cb6712d934de4058cc5" ]
[ "src/quicknlp/models/cvae.py", "src/tests/test_datasets.py" ]
[ "from typing import List, Union\n\nimport torch\nimport torch.nn as nn\nfrom fastai.core import V, to_gpu\n\nfrom quicknlp.utils import assert_dims, concat_bidir_state\nfrom .hred import HRED\n\nHParam = Union[List[int], int]\n\n\nclass CVAE(HRED):\n \"\"\"Basic CVAE model see:\n T. Zhao, R. Zhao, and M. Eske...
[ [ "torch.cat", "torch.randn", "torch.nn.Tanh", "torch.exp", "torch.nn.Linear", "torch.set_grad_enabled", "torch.split" ], [ "pandas.read_csv" ] ]
GMLC-1-4-2/battery_interface
[ "07ff5c6505aa6ab0a7c0ee144da20303c60baad4", "07ff5c6505aa6ab0a7c0ee144da20303c60baad4" ]
[ "src/fleets/water_heater_fleet/test.py", "src/fleets/water_heater_fleet/wh_fleet.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nLast updated on Thursday Jul 26 2018\n\nExample Higher Level Controller\n\n@author: Chuck Booten (NREL), Jeff Maguire (NREL)\n \n\"\"\"\nimport random\nimport numpy as np\nimport os\nimport datetime\nimport matplotlib.pyplot as plt\nfrom fleet_request import FleetRequest\nfrom w...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ], [ "numpy.random.seed", "numpy.random.choice", "nu...
minhtuev/mindmeld
[ "bacbf5d0a1216dc69fc3ed4565cd8c81d142816a" ]
[ "mindmeld/models/model.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/lic...
[ [ "sklearn.model_selection.GroupShuffleSplit", "sklearn.model_selection.GridSearchCV", "numpy.sum", "sklearn.model_selection.ShuffleSplit", "sklearn.metrics.confusion_matrix", "sklearn.model_selection.KFold", "sklearn.model_selection.StratifiedKFold", "numpy.ones", "sklearn.metri...
yarikoptic/dipy
[ "0f593a8d2d25e268e3bebc1d3097036785860177" ]
[ "dipy/reconst/tests/test_dandelion.py" ]
[ "import numpy as np\nfrom nose.tools import assert_true, assert_false, assert_equal, assert_raises\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal\n\nimport nibabel as nib\nfrom dipy.data import get_data,get_sphere\nfrom dipy.reconst.dandelion import SphericalDandelion\nfrom dipy.reconst.re...
[ [ "numpy.load", "numpy.squeeze" ] ]
edrebin/NLP-Course
[ "004af059e4a48b9086dc122d32c864799f1f16f1" ]
[ "code/sentencizer.py" ]
[ "from spacy.lang.en import English\nfrom spacy.pipeline.sentencizer import Sentencizer\nimport numpy as np\n\n\nclass Sent(Sentencizer):\n pass\n\n def predict(self, docs): \n \"\"\"Apply the pipe to a batch of docs, without modifying them.\n\n docs (Iterable[Doc]): The documents to predict.\...
[ [ "numpy.array" ] ]
flaviovdf/playlist-analysis
[ "b9f05ab3b9a729aef2105dcd9365e65b0d84f10a" ]
[ "myfsm.py" ]
[ "# -*- coding: utf8\nfrom collections import defaultdict\nfrom graphviz import Graph\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n\ndef mplot(df, labels=None):\n M = df.values.copy()\n if labels is not None:\n M = M[np.argsort(labels)]\n M = M[:, np.argsort(labe...
[ [ "pandas.read_csv", "numpy.nonzero", "pandas.DataFrame", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.close", "numpy.argsort", "matplotlib.pyplot.matshow", "matplotlib.pyplot.show", "numpy.outer" ] ]
chrundle/Diffenderfer2021Winning_robustbench
[ "44ba076438d50c0a4160e4f98e12a02903cb1ca0", "44ba076438d50c0a4160e4f98e12a02903cb1ca0" ]
[ "Diffenderfer2021Winning_benchmarks/C100_Binary_CARD_benchmark.py", "Diffenderfer2021Winning_benchmarks/Binary_CARD_benchmark.py" ]
[ "import torch\n\nfrom robustbench import benchmark\nfrom robustbench.utils import load_model\n#from robustbench.model_zoo.cifar10 import Diffenderfer2021CARD\n\nthreat_model = \"corruptions\"\ndataset = \"cifar100\"\n\n#model = Diffenderfer2021CARD()\nmodel_name = 'Diffenderfer2021Winning_Binary'\nmodel = load_mode...
[ [ "torch.device" ], [ "torch.device" ] ]
CAVED123/drug-combo-generator
[ "7654a38986de6039991c9e0aff347fd86c306e2f" ]
[ "Methods/RL/rl-baselines/baselines/ppo1/pposgd_simple_gcn.py" ]
[ "from baselines.common import Dataset, explained_variance, fmt_row, zipsame\r\nfrom baselines import logger\r\nimport baselines.common.tf_util as U\r\nimport tensorflow as tf, numpy as np\r\nimport time\r\nfrom baselines.common.mpi_adam import MpiAdam\r\nfrom baselines.common.mpi_moments import mpi_moments\r\nfrom ...
[ [ "numpy.logical_xor", "numpy.amax", "tensorflow.minimum", "tensorflow.global_variables", "numpy.zeros_like", "numpy.mean", "numpy.where", "tensorflow.square", "tensorflow.train.Saver", "numpy.amin", "tensorflow.placeholder", "tensorflow.zeros_like", "numpy.append...
j-geuter/CINDy
[ "65144db43d461d70baaeb3252dd650a0be68f060" ]
[ "dynamics.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 23 10:36:47 2020\n\n@author: pccom\n\"\"\"\nimport numpy as np\n\ndef kuramoto_time(frequencies, max_time, number_of_snapshots, number_of_experiments = 10, K = 2.0, forcing_param = 0.2, relative_tolerance = 1.0e-10, absolute_tolerance = 1.0e-13):\n from scipy....
[ [ "numpy.linspace", "numpy.cos", "numpy.sin", "numpy.append", "numpy.random.rand", "numpy.floor", "numpy.random.uniform", "numpy.array", "numpy.meshgrid", "numpy.zeros" ] ]
rahlk/Bellwether
[ "39e0e63504a6dfdeeb5d6e8d733e708d1485ecd9" ]
[ "smells/tests/src/VCBoost/execute.py" ]
[ "from __future__ import print_function, division\n\nimport os\nimport sys\n\nroot = os.path.join(os.getcwd().split('src')[0], 'src')\nif root not in sys.path:\n sys.path.append(root)\n\nfrom utils import *\nfrom metrics.abcd import abcd\nimport numpy as np\nfrom collections import Counter\nimport pandas\nfrom ta...
[ [ "sklearn.metrics.roc_auc_score", "numpy.log", "pandas.read_csv", "numpy.median", "numpy.nan_to_num", "numpy.mean", "sklearn.svm.LinearSVC", "numpy.exp", "numpy.array", "numpy.sum" ] ]
karmatarap/capstone_project
[ "16f2b60be9634efec772c7dffb6efb90c37880ec" ]
[ "src/models/engine.py" ]
[ "import torch\n\n\nclass Engine:\n def __init__(self, model, optimizer, scheduler, loss_fn, device):\n self.model = model\n self.optimizer = optimizer\n self.scheduler = scheduler\n self.loss_fn = loss_fn\n self.device = device\n\n def train_one_step(self, data):\n in...
[ [ "torch.no_grad", "torch.argmax" ] ]
Architecton/ina-final-project
[ "b6b68e939eab2f3b228e9f5e536933668e62935b" ]
[ "results/statistical_tests/bayesian_correlated_t_test.py" ]
[ "import numpy as np\nfrom bayesiantests.bayesiantests import correlated_ttest, correlated_ttest_MC\nimport matplotlib.pyplot as plt\nimport seaborn as snb\nimport argparse\n\n\ndef make_test(data1, data2, name1, name2, xlabel, network_name, rope=0.01):\n \"\"\"\n Perform Bayesian Correlated t-test, save proba...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.axvline", "numpy.load" ] ]
liuaoy/deep-time-series
[ "569ca2173b3c033522c3c3a6333b86270bcfa2e7" ]
[ "models/Trans.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass PositionalEncoding(nn.Module):\n\n def __init__(self, d_model, dropout=0.1, max_len=5000):\n super(PositionalEncoding, self).__init__()\n self.dropout = nn.Dropout(p=dropout)\n\n pe = torch.zeros(ma...
[ [ "torch.nn.functional.pad", "torch.nn.Dropout", "torch.sin", "torch.zeros", "torch.randn", "torch.arange", "torch.nn.TransformerEncoderLayer", "torch.nn.Linear", "torch.nn.TransformerEncoder", "torch.nn.Conv1d", "torch.cos" ] ]
awesome-archive/mirapy
[ "f0cdc2cb024e9d09c1d40325c79bd486dacc50a0" ]
[ "mirapy/visualization/visualize.py" ]
[ "import pandas as pd\nfrom sklearn.decomposition import PCA\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D # do not remove this line\n\n\ndef visualize_2d(x, y):\n \"\"\"\n Function for 2D visualization of data using Principal Component Analysis\n (PCA).\n\n :param x: Array o...
[ [ "pandas.concat", "sklearn.decomposition.PCA", "pandas.DataFrame", "matplotlib.pyplot.figure" ] ]
mquad/DNN_Lab_UPF-
[ "ce8a5ac41e6129b99ac4fd56db14cda99c26b60b" ]
[ "exercise/char_rnn/utils.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: massimo\n# @Date: 2016-03-10 15:33:49\n# @Last Modified by: massimo\n# @Last Modified time: 2016-03-10 23:29:56\nimport theano\nimport theano.tensor as T\nimport numpy as np\n\ndef floatX(arr):\n\treturn np.asarray(arr, dtype=theano.config.floatX)\n\n# ACTIVATION FUNCTIONS #...
[ [ "numpy.linalg.svd", "numpy.sqrt", "numpy.asarray", "numpy.eye", "numpy.concatenate", "numpy.random.RandomState" ] ]
nylocx/adventofcode2021
[ "b02dd570558321f23e90a29332cab75edf1641c4" ]
[ "day_03.py" ]
[ "#%% Initialize\nimport pandas as pd\n\n#%% Read input\ndf = pd.read_fwf(\"day_03_input.txt\", widths=[1]*12, header=None)\n\n#%% Part 1\ngamma = \"\".join(df.mode().astype(str).iloc[0])\nepsilon = \"\".join(\"01\"[x == \"0\"] for x in gamma)\n\nprint(\"Power consumption:\", int(gamma, 2) * int(epsilon, 2))\n\n#%% ...
[ [ "pandas.read_fwf" ] ]
djay/covidthailand
[ "fb8c1a55fb0a6cbfe3353fc7ff3afabeb2df43e2" ]
[ "utils_thai.py" ]
[ "import datetime\nimport difflib\nimport functools\nimport json\nimport os\nimport re\n\nimport numpy as np\nimport pandas as pd\nimport pythainlp.tokenize\nfrom dateutil.parser import parse as d\n\nfrom utils_pandas import fuzzy_join\nfrom utils_pandas import rearrange\nfrom utils_pandas import sensible_precision\...
[ [ "pandas.crosstab", "pandas.read_csv", "pandas.DataFrame", "pandas.read_html", "numpy.floor", "pandas.DataFrame.from_records" ] ]
botoxparty/pytorch-deepdream
[ "0a39866cf234cad0c5a79d19528d798d1dc19446" ]
[ "utils/constants.py" ]
[ "import enum\n\n\nimport numpy as np\nimport torch\n\n\nIMAGENET_MEAN_1 = np.array([0.485, 0.456, 0.406], dtype=np.float32)\nIMAGENET_STD_1 = np.array([0.229, 0.224, 0.225], dtype=np.float32)\n\n\nLOWER_IMAGE_BOUND = torch.tensor((-IMAGENET_MEAN_1 / IMAGENET_STD_1).reshape(1, -1, 1, 1)).to('cuda')\nUPPER_IMAGE_BOUN...
[ [ "numpy.array" ] ]
abhinaukumar/funque
[ "47f030af78e4e64b9d0e5c7632193373eb94afcd" ]
[ "funque/third_party/funque_atoms/partial_dwpt.py" ]
[ "import numpy as np\n\nfrom pywt._c99_config import _have_c99_complex\nfrom pywt._extensions._dwt import dwt_axis\nfrom pywt._utils import _wavelets_per_axis, _modes_per_axis\nfrom pywt._multilevel import _check_level\n\n# Adopted from PyWavelets\n\n\ndef partial_dwptn(data, wavelet, mode='symmetric', axes=None, ap...
[ [ "numpy.asarray", "numpy.unique", "numpy.dtype", "numpy.iscomplexobj" ] ]
sherylm77/SlowFast
[ "e2b3792458c24d1c76d5fedc4904c6a4af2d67fd" ]
[ "slowfast/utils/multiprocessing.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Multiprocessing helpers.\"\"\"\n\nimport torch\n\n\ndef run(\n local_rank,\n num_proc,\n func,\n init_method,\n shard_id,\n num_shards,\n backend,\n cfg,\n output_queue=None,\n):\n ...
[ [ "torch.distributed.init_process_group" ] ]
alexturyev/ml_snippets_2022
[ "172bfa813e601db24e68111f8b0954402cfd0e14" ]
[ "waveTranscribe.py" ]
[ "# works - transcribes large volumes of wav files using wav2vec2 model and inserts results into DB\nimport torch\nimport librosa\nimport numpy as np\nimport soundfile as sf\nimport time\nimport os\nimport re\nimport io\nfrom IPython.display import Audio\nfrom transformers import Wav2Vec2ForCTC, Wav2Vec2Tokenizer\ni...
[ [ "torch.argmax" ] ]
kingspp/covid19_research
[ "f932f56a38b906cd58477be4e0fabf5c4f372c77" ]
[ "dashboard/app/server/main.py" ]
[ "from fastapi import FastAPI\nfrom covid19 import database as db\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom scipy.special import expit\nimport json\nimport operator\nfrom covid19 import COUNTIES, ETHNICITIES, COVID19_DATA_PATH\nimport random\nfrom fastapi import FastAPI\nimport numpy as np\n\nimport ...
[ [ "numpy.sum" ] ]
Naereen/ALGO1-Info1-2019
[ "5732cbbc5a6b9cedd7228ff64ad1f43001d4186b" ]
[ "CoursMagistral_6.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Table of Contents\n# <p><div class=\"lev1 toc-item\"><a href=\"#ALGO1-:-Introduction-à-l'algorithmique\" data-toc-modified-id=\"ALGO1-:-Introduction-à-l'algorithmique-1\"><span class=\"toc-item-num\">1&nbsp;&nbsp;</span><a href=\"https://perso.crans.org/besson/teach/i...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.title", "matplotlib.pyplot.figure" ] ]
AskerNC/projects-2021-concatenaters
[ "f495737c38cf86bbe459f2de6caf1d364419bb8d" ]
[ "modelproject/modelproject.py" ]
[ "from scipy import optimize\nimport sympy as sm\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef graph_lom(A_val, X_val, alpha_val, eta_val, mu_val, ss_func, lom_func,initial_L):\n \"\"\" graphs the law of motion for the malthus model\n\n Args:\n A (float): technology level\n ...
[ [ "matplotlib.pyplot.text", "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.figure" ] ]
lbulygin/machine-learning-ontology-matching
[ "ce22e05d6d0c0c6cdd1f7463cc523585855455b6" ]
[ "calculate_features.py" ]
[ "import pandas as pd\nimport yaml\n\nfrom utils_features import calculate_features\n\nwith open('config.yml') as file:\n config = yaml.load(file, Loader=yaml.FullLoader)\n\nSELECTED_DATASET = config['DATASET']\n\n# Calculate features for training dataset\ndata = pd.read_csv(SELECTED_DATASET + '_train.csv')\n\nda...
[ [ "pandas.read_csv" ] ]
silverfield/pythonsessions
[ "bf5d82dded7616a5d6998da4eb445708c728794f" ]
[ "s09_files_and_random/solutions/random_walking.py" ]
[ "__author__ = 'ferrard'\n\n# ---------------------------------------------------------------\n# Imports\n# ---------------------------------------------------------------\n\nimport scipy as sp\nimport random\nimport time\n\n# ---------------------------------------------------------------\n# Class - Graph\n# ------...
[ [ "scipy.zeros", "scipy.ones", "scipy.dot" ] ]
PacktPublishing/OpenCV-4-for-Secret-Agents-Second-Edition
[ "9c2cae78c9e181f602a441fe795a5dc86441c668" ]
[ "Chapter008/Sunbaker.py" ]
[ "#!/usr/bin/env python\n\n\nimport collections\nimport threading\nimport timeit\n\nimport numpy\nimport cv2\nimport wx\n\nimport pyfftw.interfaces.cache\nfrom pyfftw.interfaces.scipy_fftpack import fft\nfrom pyfftw.interfaces.scipy_fftpack import ifft\nfrom scipy.fftpack import fftfreq\n\nimport WxUtils\n\ntry:\n ...
[ [ "numpy.abs", "numpy.fliplr", "numpy.real", "scipy.fftpack.fftfreq", "numpy.empty" ] ]
MoellerAI/MLAlgorithmComparison
[ "30a02f6e844b0f09103a95db5d52260821dda1e2" ]
[ "algorithms/svm.py" ]
[ "import warnings\nwarnings.simplefilter(\"ignore\", UserWarning)\n\nfrom base_model import BaseModel\nfrom sklearn import svm\nfrom sklearn.model_selection import GridSearchCV\nimport numpy as np\n\nclass SupportVectorMachines(BaseModel):\n def __init__(self, X_train: np.array, y_train: np.array, param_grid: dic...
[ [ "sklearn.model_selection.GridSearchCV", "sklearn.svm.SVC" ] ]
A2Kumar/icml18-jtnn-AK
[ "a8bd0d66d5f3ef534b38d9274f7ed403fb3e3288" ]
[ "fast_jtnn/jtnn_enc.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import deque\nfrom mol_tree import Vocab, MolTree\nfrom nnutils import create_var, index_select_ND\n\nclass JTNNEncoder(nn.Module):\n\n def __init__(self, hidden_size, depth, embedding):\n super(JTNNEncoder, self).__in...
[ [ "torch.LongTensor", "torch.cat", "torch.nn.Linear", "torch.nn.functional.sigmoid", "torch.stack", "torch.nn.ReLU" ] ]
sajjadkarimi91/MultitaskSleepNet
[ "80c45e30467fde0f8303e5deabacd4988ab387b0" ]
[ "SleepEDF/tensorflow_net/dnn-filterbank/test_dnn_filterbank_gpu0.py" ]
[ "# Test to see how good the DNN perform on the test data (just for double check)\r\n# Extract and save the learn filterbank too. This will be used to preprocess the input data for other classification networks\r\nimport os\r\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0,-1\"\r\nimport numpy as np\r\nimport tensorflow a...
[ [ "tensorflow.Graph", "tensorflow.all_variables", "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.Variable", "sklearn.metrics.cohen_kappa_score", "tensorflow.ConfigProto", "tensorflow.app.flags.DEFINE_string", "numpy.zeros_like", "tensorflow.app.flags.DEFINE...
rbavery/animal_detector
[ "d306934e4f4f2d7af0933d38b87a6b3f67072156" ]
[ "app/animal_detector/detection/run_tf_detector_batch.py" ]
[ "\"\"\"\nModule to run a TensorFlow animal detection model on lots of images, writing the results\nto a file in the same format produced by our batch API:\n\nhttps://github.com/microsoft/CameraTraps/tree/master/api/batch_processing\n\nThis enables the results to be used in our post-processing pipeline; see\napi/bat...
[ [ "tensorflow.test.is_gpu_available" ] ]
Flanneryg3/HIVCB_ProjectCode
[ "68ea849f9ee381a56e87aac65fcfb616f130075c" ]
[ "error_awareness_task/EAT_task_data/convert_behav.py" ]
[ "from __future__ import print_function\nfrom glob import glob\nfrom os import remove\nfrom os.path import basename, join, isfile\n\nimport numpy as np\nimport pandas as pd\nimport convert_eprime as ce\nfrom bids.layout import BIDSLayout\n\n\ndef p2f(x):\n \"\"\"Convert percent string to float.\n \"\"\"\n r...
[ [ "numpy.isnan", "numpy.intersect1d" ] ]
Varunvaruns9/einsteinpy
[ "befc0879c65a53b811e7d6a9ec47675ae28a08c5" ]
[ "src/einsteinpy/tests/test_symbolic/test_vector.py" ]
[ "import numpy as np\nfrom sympy import cos, simplify, symbols\n\nfrom einsteinpy.symbolic import GenericVector, MetricTensor\n\n\ndef euclidean_space_metric():\n symbolstr = \"e1 e2\" # let angle between e1 & e2 be theta\n syms = symbols(symbolstr)\n th = symbols(\"theta\")\n list2d = np.zeros((2, 2), ...
[ [ "numpy.zeros" ] ]
jemerysim/ast_model
[ "bae2aeeb4fca171cc3788bfbb8a8cd8de24e9188" ]
[ "venvast/Lib/site-packages/torch/distributions/kumaraswamy.py" ]
[ "import torch\nfrom torch.distributions import constraints\nfrom torch.distributions.uniform import Uniform\nfrom torch.distributions.transformed_distribution import TransformedDistribution\nfrom torch.distributions.transforms import AffineTransform, PowerTransform\nfrom torch.distributions.utils import broadcast_a...
[ [ "torch.finfo", "torch.digamma", "torch.exp", "torch.full_like", "torch.log", "torch.lgamma", "torch.distributions.utils.broadcast_all", "torch.pow", "torch.distributions.transforms.AffineTransform" ] ]
anuroopsriram/ocp
[ "fe1879b786f5b8db16fbdc9978651f6ab7aae95f" ]
[ "ocpmodels/trainers/base_trainer.py" ]
[ "\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n\"\"\"\nimport datetime\nimport errno\nimport json\nimport logging\nimport os\nimport random\nimport subprocess\nfrom abc import ABC,...
[ [ "torch.nn.parallel.distributed.DistributedDataParallel", "torch.nn.MSELoss", "numpy.random.seed", "torch.load", "numpy.unique", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.cuda.amp.autocast", "numpy.savez_compressed", "torch.cuda.amp.GradScaler", "torch.n...
suneric/aircraft_scanning
[ "18c7deb8405eabecab643e7ebbda5f3a61e78393" ]
[ "aircraft_scanning_plan/scripts/cpp_mcts.py" ]
[ "\"\"\"\ndiscrete coverage path planning problem\nwith monte carlo tree search algorithm\n\"\"\"\nimport time\nimport numpy as np\nimport math\nfrom util import *\nfrom map import *\nimport sys\nimport os\nimport time\nimport math\nimport copy\nimport argparse\nimport csv\nimport pandas as pd\n\nnp.random.seed(124)...
[ [ "numpy.argmax", "numpy.random.rand", "numpy.random.seed", "pandas.DataFrame" ] ]
yangdatou/pyscfad
[ "8b90c928928f8244237e5fe415858e074dd5e5fb" ]
[ "pyscfad/lib/numpy_helper.py" ]
[ "from functools import partial\nimport numpy as onp\nfrom jax import jit\nfrom jax import numpy\nfrom jax.config import config as jax_config\nfrom . import ops\njax_config.update(\"jax_enable_x64\", True)\n\njnp = numpy\neinsum = numpy.einsum\ndot = numpy.dot\n\n__all__ = ['numpy', 'einsum', 'dot',\n 'PLA...
[ [ "numpy.tril_indices", "numpy.diag_indices", "numpy.sqrt", "numpy.triu_indices" ] ]