repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
AustinSchuh/971-Robot-Code | [
"99abc66fd2d899c0bdab338dc6f57dc5def9be8d"
] | [
"frc971/control_loops/python/linear_system.py"
] | [
"#!/usr/bin/python3\n\nfrom aos.util.trapezoid_profile import TrapezoidProfile\nfrom frc971.control_loops.python import control_loop\nfrom frc971.control_loops.python import controls\nimport numpy\nfrom matplotlib import pylab\nimport glog\n\n\nclass LinearSystemParams(object):\n def __init__(self,\n ... | [
[
"numpy.matrix",
"numpy.linalg.matrix_rank",
"numpy.zeros",
"matplotlib.pylab.legend",
"matplotlib.pylab.show",
"matplotlib.pylab.subplot",
"numpy.linalg.eig",
"numpy.clip",
"matplotlib.pylab.plot"
]
] |
StuartMolnar/Whale-Optimization | [
"05ebebdb3c676768f8fe6a0e7e7d3c18f70162d2"
] | [
"venv/Lib/site-packages/fcmaes/advretry.py"
] | [
"# Copyright (c) Dietmar Wolz.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory.\n\nimport time\nimport os\nimport sys\nimport math\nimport random\nimport _pickle as cPickle\nimport bz2\nimport ctypes as ct\nimport numpy as np\nfrom numpy.linalg import norm... | [
[
"numpy.linalg.norm",
"numpy.asarray",
"scipy.optimize.Bounds",
"numpy.minimum",
"numpy.random.MT19937",
"numpy.abs",
"numpy.random.SeedSequence",
"numpy.maximum"
]
] |
jamesholcombe/pandas | [
"247e8f3831c93dfeb83e3f410ea375d0537ea989"
] | [
"pandas/tests/window/test_rolling.py"
] | [
"from datetime import (\n datetime,\n timedelta,\n)\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat import (\n is_platform_arm,\n is_platform_mac,\n)\nfrom pandas.errors import UnsupportedFunctionCall\n\nfrom pandas import (\n DataFrame,\n DatetimeIndex,\n MultiIndex,\n Series,\n ... | [
[
"numpy.random.rand",
"pandas.DatetimeIndex",
"numpy.random.choice",
"pandas.Timestamp",
"pandas._testing.assert_series_equal",
"pandas.period_range",
"numpy.empty",
"pandas.Timedelta",
"pandas.DataFrame",
"numpy.arange",
"pandas.MultiIndex",
"pandas.compat.is_platfo... |
GoldbergNeuroLab/Kaneko-et-al.-2022 | [
"66480b70beb5f00638c07e966522e53d0c614f79"
] | [
"pv-scn1a/src/data.py"
] | [
"import os\nimport warnings\nfrom collections import namedtuple\nfrom pathlib import Path\nfrom typing import Union\n\nimport pandas as pd\nfrom tables import NaturalNameWarning, PerformanceWarning\n\nfrom src.run import get_trace\nfrom src.constants import (AIS_LABEL, DISTANCE_LABEL, SECTION_LABEL,\n ... | [
[
"pandas.concat",
"pandas.read_hdf",
"numpy.all",
"pandas.Series"
]
] |
KamWithK/PyParquetLoaders | [
"09f8529a8c9b6854f6965346cced1169b83ba96b"
] | [
"PyTorchLoader.py"
] | [
"import pyarrow as pa\nimport pyarrow.parquet as pq\nimport pyarrow.dataset as ds\nimport pandas as pd\n\nfrom torch.utils.data import IterableDataset\nfrom torch.utils.data import get_worker_info\nfrom torch.multiprocessing import Queue\n\nclass IterableManualParquetDataset(IterableDataset):\n def __init__(self... | [
[
"torch.utils.data.get_worker_info",
"torch.multiprocessing.Queue"
]
] |
jamesthatcher/ML-python-pytorch-cnn-gpu-training | [
"0f2feba6094bb934046ea2c2a7c3cac7b1c941f9"
] | [
"model.py"
] | [
"import torch\nfrom torch import nn\n\n\n# Convolutional neural network\nclass CNN(nn.Module):\n\n def __init__(self, n_classes=10):\n super(CNN, self).__init__()\n\n # Convolutional layers\n self.layers = nn.Sequential(nn.Conv2d(in_channels=1, out_channels=32, kernel_size=(3, 3)),\n ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.flatten"
]
] |
hassancpu/Coursera-AI-for-Medicine-Specialization | [
"c9b265ec002bb41fd3a71ac250dfef1c555f9568"
] | [
"Treatment/Week 3/util.py"
] | [
"# UTILS FILE\nimport keras\nfrom keras.applications.densenet import DenseNet121\nfrom keras.models import Model\nfrom keras.layers import Dense, Activation, Flatten, Dropout, BatchNormalization, GlobalAveragePooling2D\nfrom keras.callbacks import ModelCheckpoint, CSVLogger, LearningRateScheduler, ReduceLROnPlateau... | [
[
"matplotlib.pyplot.title",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.nonzero",
"numpy.std",
"matplotlib.pyplot.axis",
"pandas.read_csv",
"numpy.expand_dims",
"matplotlib.pyplot.subplot"
]
] |
Linfeng-Lee/IIM | [
"c63bf8b023ccc6750e178112662972f721dcabe1"
] | [
"model/HR_Net/seg_hrnet.py"
] | [
"# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Ke Sun (sunk@mail.ustc.edu.cn)\n# ------------------------------------------------------------------------------\n\nfrom __future__ import absolute_import\nfr... | [
[
"torch.cat",
"torch.nn.functional.upsample",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"numpy.sum",
"torch.nn.Sigmoid",
"torch.nn.ConvTranspose2d",
"torch.nn.init.constant_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.load"
]
] |
ewang2002/UCSDHistEnrollData | [
"a8cde6168e28285420b4eefe446e6a629296fa2d"
] | [
"plot.py"
] | [
"from datetime import datetime, timedelta\nfrom os import listdir, mkdir\nfrom os.path import exists, join\nimport sys\nfrom typing import List, Tuple, TypeVar\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nfrom math import floor\nfrom multiprocessi... | [
[
"matplotlib.pyplot.axvspan",
"matplotlib.pyplot.xlim",
"matplotlib.ticker.MaxNLocator",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyp... |
w121211/CoordConv | [
"269a8da039f0df08833c5d2324895d37e6e33a0a"
] | [
"experiments/regressor/regressor_rect.py"
] | [
"import os\nimport itertools\n\nimport numpy as np\nfrom PIL import Image, ImageDraw\nimport torch\nimport torch.nn as nn\nimport torch.nn.modules.conv as conv\nimport torch.utils.data as utils\nimport torch.nn.functional as F\nfrom torchsummary import summary\nimport matplotlib.pyplot as plt\nfrom sklearn.model_se... | [
[
"torch.cat",
"numpy.random.rand",
"numpy.load",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss",
"numpy.concatenate",
"torch.nn.MaxPool2d",
"numpy.save",
"torch.manual_seed",
"numpy.random.randint",
"torch.utils.data.DataLoader",
"torch.nn.functional.relu",
... |
brycatch/challenge-prework-ds | [
"28c2c256f7ee359eebcdfbade534399980578217"
] | [
"main.py"
] | [
"import pandas as pd\nimport numpy as np\n\ndef read_csv(name):\n # 1 Read file by name\n data_frame = pd.read_csv(name) \n # 2 Cleaning data frame\n data_frame = data_frame.convert_dtypes() \n data_frame[[\"Estado\",\"Año\",\"Mes\",\"Tipo de visitantes\",\"Nacionalidad\",\"Centro de trabajo\"]] = data_f... | [
[
"pandas.read_csv",
"pandas.to_numeric"
]
] |
benelot/tensorforce | [
"3c3b9c3ac153761016cf9883b76613c9d93952bf"
] | [
"tensorforce/core/distributions/categorical.py"
] | [
"# Copyright 2017 reinforce.io. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap... | [
[
"tensorflow.shape",
"tensorflow.where",
"tensorflow.expand_dims",
"tensorflow.reshape",
"tensorflow.add_n",
"tensorflow.log",
"tensorflow.reduce_sum",
"tensorflow.nn.softmax",
"tensorflow.maximum",
"tensorflow.one_hot",
"tensorflow.reduce_logsumexp"
]
] |
tank671/fastai_dev | [
"aa9ff3f78ac560881f46f7161c0c17a6ca38e87b"
] | [
"dev/local/vision/augment.py"
] | [
"#AUTOGENERATED! DO NOT EDIT! File to edit: dev/09_vision_augment.ipynb (unless otherwise specified).\n\n__all__ = ['RandTransform', 'TensorTypes', 'FlipItem', 'DihedralItem', 'PadMode', 'CropPad', 'RandomCrop',\n 'ResizeMethod', 'Resize', 'RandomResizedCrop', 'AffineCoordTfm', 'RandomResizedCropGPU', 'af... | [
[
"torch.zeros_like",
"torch.stack",
"torch.ones_like"
]
] |
jamesdamillington/Wildfire_Human_Agency_Model | [
"771d5a89a9f26badcf1fa412a1a7a10b2e981aeb"
] | [
"src/Core_functionality/AFTs/agent_class.py"
] | [
"\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Jun 22 10:41:39 2021\r\n\r\n@author: Oli\r\n\"\"\"\r\n\r\nimport agentpy as ap\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom copy import deepcopy\r\n\r\nfrom Core_functionality.Trees.Transfer_tree import define_tree_links, predict_from_tree, update_par... | [
[
"numpy.where",
"numpy.column_stack",
"pandas.Series"
]
] |
ybarancan/STSU | [
"0b9efa88739c517a7ca00e61faefa4b45714d312"
] | [
"src/utils/bezier.py"
] | [
"\r\n\r\n\r\n\r\nimport os\r\nimport glob\r\n\r\nimport numpy as np\r\nimport scipy.interpolate as si \r\nimport torch\r\n# from scipy.interpolate import UnivariateSpline\r\nimport logging\r\n# import pwlf\r\nfrom math import factorial\r\n\r\ndef comb(n, k):\r\n return factorial(n) // (factorial(k) * factorial(n... | [
[
"numpy.dot",
"numpy.zeros",
"torch.square",
"torch.linspace",
"torch.clamp",
"torch.unsqueeze",
"numpy.linalg.lstsq",
"numpy.arange",
"numpy.power",
"torch.transpose",
"torch.Tensor",
"torch.dot"
]
] |
michahashkes/IML.HUJI | [
"e5e58da0ae8d13b540a9894f4df6dd2332a3f6da"
] | [
"IMLearn/utils/utils.py"
] | [
"from typing import Tuple\nimport numpy as np\nimport pandas as pd\n\n\ndef split_train_test(X: pd.DataFrame, y: pd.Series, train_proportion: float = .75) \\\n -> Tuple[pd.DataFrame, pd.Series, pd.DataFrame, pd.Series]:\n \"\"\"\n Randomly split given sample to a training- and testing sample\n\n Par... | [
[
"numpy.ceil",
"numpy.arange"
]
] |
MoraesCaio/ktrain | [
"3ffc3594daf36b5a02f7720d337d25173a29cfcf"
] | [
"ktrain/text/eda.py"
] | [
"from ..imports import *\nfrom .. import utils as U\nfrom . import textutils as TU\nfrom . import preprocessor as pp\nimport time\n\nclass TopicModel():\n\n\n def __init__(self,texts=None, n_topics=None, n_features=10000, \n min_df=5, max_df=0.5, stop_words='english',\n lda_max_i... | [
[
"sklearn.neighbors.NearestNeighbors",
"sklearn.neighbors.LocalOutlierFactor"
]
] |
HienDT27/annotation_utils | [
"1f4e95f4cfa08de5bbab20f90a6a75fba66a69b9"
] | [
"build/lib/annotation_utils/dataset/dataset_prep.py"
] | [
"import sys\nimport math\nimport pandas as pd\nfrom tqdm import tqdm\nfrom typing import cast, List, Dict\nfrom common_utils.path_utils import get_dirnames_in_dir\nfrom common_utils.file_utils import make_dir_if_not_exists, delete_all_files_in_dir, \\\n get_dir_contents_len, dir_exists, file_exists\nfrom ..coco.... | [
[
"pandas.read_excel"
]
] |
guillefix/captionRL-env | [
"7129bf01cfe069a1bd5d38e171b4a5f74a5701ed"
] | [
"src/envs/color_generation.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom gym.spaces import Box\n\nn_colors = 10\ndef plot_colors(color):\n \"\"\"\n Plots a sample of colors from the color x shade color class.\n\n Parameters\n ----------\n color: str\n Color in red, blue, green.\n shade: str\n Shad... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.random.uniform",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
richardsliu/ray | [
"0c27d925886e1fcfa0a22cb50715ac921091ea83"
] | [
"mnist/inference.py"
] | [
"from typing import Sequence\n\nfrom absl import app\nimport numpy as np\nimport requests\n\n\ndef main(argv: Sequence[str]) -> None:\n resp = requests.get(\n \"http://localhost:8000/mnist\",\n json={\"array\": np.random.randn(28 * 28).tolist()})\n print(resp.json())\n\n\nif __name__ == '__main__':\n a... | [
[
"numpy.random.randn"
]
] |
gbernstein6/private_bayesian_expfam | [
"4cd61ab4bd69858b2a233fba76298e269d923e05"
] | [
"Bounded_Suff_Stats/distributions.py"
] | [
"import scipy, scipy.stats\nimport numpy as np\n\n'''\nclass Conjugate_Pair:\n\n def __init__(self):\n\n # let p = number of parameters used by likelihood model\n # let s = number of sufficient statistics used by likelihood model (note multinomial actually uses s-1)\n # let q = number of par... | [
[
"numpy.array",
"numpy.fill_diagonal",
"numpy.ones",
"scipy.stats.beta.rvs",
"numpy.sqrt",
"scipy.stats.truncnorm.rvs",
"numpy.maximum"
]
] |
volkoshkursk/NeMo | [
"2df92ec9ca3204b7d3cd52f1b133c971de8dc00a"
] | [
"nemo/utils/exp_manager.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"torch.load"
]
] |
ebranlard/wtDigiTwin | [
"2c1e965ab5fdca10e67b0db9ef87837f5abebc02"
] | [
"wtDigiTwin/fast/fastlib.py"
] | [
"\n# --- For cmd.py\nfrom __future__ import division, print_function\nimport os\nimport subprocess\nimport multiprocessing\n\nimport collections\nimport glob\nimport pandas as pd\nimport numpy as np\nimport distutils.dir_util\nimport shutil \nimport stat\nimport re\n\n# --- External library for io\ntry:\n import... | [
[
"numpy.sign",
"numpy.where",
"numpy.max",
"numpy.concatenate",
"pandas.DataFrame",
"numpy.arange",
"numpy.trapz",
"numpy.column_stack",
"numpy.array",
"numpy.zeros",
"numpy.argsort",
"numpy.floor",
"numpy.isnan",
"pandas.cut",
"numpy.asarray",
"numpy... |
yamauchi1132/Research_Codes | [
"c9e104f8592277cb4aa5c479b014c78c702a0939"
] | [
"analysis/unbound_mass/unbound_mass_alltimecheck.py"
] | [
"import sys, os\nsys.path.append(os.pardir)\nimport numpy as np\nimport operator\nimport math\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nfrom common import *\n\ndirname = \"data_thesis/snap_unbound_10.0Msun_4.0Rsun_pori1.5_rp1.0R_vinf1.00e+06/sph_t%04d.dat\"\nstart = 100\nend = 1700\nstep = 100\n\n... | [
[
"numpy.array",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show"
]
] |
TrustAI/DEAT | [
"630e59c3f8483a8cda6633157387f64735e2de51"
] | [
"standard training/fat_mart_cifar10.py"
] | [
"import os\nimport argparse\nimport torchvision\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nimport time\nimport numpy as np\nimport logging\nfrom preact_resnet import PreActResNet18\nfrom wideresnet import WideResN... | [
[
"torch.device",
"torch.cuda.manual_seed_all",
"torch.nn.DataParallel",
"numpy.random.seed",
"torch.argsort",
"torch.manual_seed",
"torch.nn.functional.cross_entropy",
"torch.tensor",
"torch.nn.KLDivLoss",
"torch.nn.functional.softmax",
"torch.log",
"torch.where"
]... |
hydoai/velovision | [
"28a0428608bd67a3f14a600eb742642cdc079167"
] | [
"computer_vision/subvision/iou_tracker/iou_tracker.py"
] | [
"import numpy as np\nfrom lapsolver import solve_dense\nfrom time import time\n\ndef iou(bbox1, bbox2):\n \"\"\"\n Calculates the intersection-over-union of two bounding boxes.\n\n Args:\n bbox1 (numpy.array, list of floats): bounding box in format x1,y1,x2,y2.\n bbox2 (numpy.array, list of f... | [
[
"numpy.nan_to_num"
]
] |
gsaha36/B-CellClassification | [
"05a4a22ee432e51e7da5a849ff0b9584ad3228fa"
] | [
"src/SDLayer.py"
] | [
"import torch.nn as nn\nimport torch\nimport numpy as np\nfrom torch.autograd import Variable\n\nclass SDLayer(nn.Module):\n def __init__(self, W):\n super(SDLayer, self).__init__()\n self.W = nn.Parameter(W)\n self.activation = nn.Tanh()\n\n def forward(self, x):\n PHI = self.W\n ... | [
[
"torch.nn.Tanh",
"torch.log",
"torch.tensor",
"torch.nn.Parameter"
]
] |
gautam1858/autograd | [
"8d7acaf79e33139b4ebfedf7da0602a965b47c63"
] | [
"examples/sinusoid.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import print_function\nfrom builtins import range, map\nimport autograd.numpy as np\nimport matplotlib.pyplot as plt\nfrom autograd import grad\n\ndef fun(x):\n return np.sin(x)\n\nd_fun = grad(fun) # First derivative\ndd_fun = grad(d_fun) # Second deri... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.axis"
]
] |
Jaekyumkim/spml_retinanet_fixedsize | [
"1668229dba5c3a713ebaf8ab781f82d913196ad5"
] | [
"datasets.py"
] | [
"\nimport os\nimport pdb\nimport random\n\nimport torch\nfrom torch.utils.data import Dataset\nimport torchvision.transforms as transforms\nimport numpy as np\nfrom PIL import Image, ImageDraw\n\nfrom encoder import DataEncoder\n\n#coco_label = ['person', 'bicycle', 'car', 'motorbike', 'aeroplane', 'bus', 'train', ... | [
[
"torch.zeros",
"torch.stack",
"numpy.reshape",
"torch.from_numpy",
"numpy.loadtxt",
"torch.utils.data.DataLoader"
]
] |
MFSJMenger/pysurf | [
"99c6a94d4cb5046f16a0961b907061d989ffb6dc"
] | [
"pysurf/sampling/nm_sampler.py"
] | [
"import numpy as np\n\nfrom colt import Colt\nfrom ..spp import ModelFactory\nfrom ..molden import MoldenParser\nfrom ..constants import U_TO_AMU, CM_TO_HARTREE\n\nfrom .base_sampler import CrdSamplerBase\nfrom .normalmodes import NormalModes as nm\nfrom ..system import Molecule\nfrom ..system.atominfo import ATOMN... | [
[
"numpy.array",
"numpy.copy"
]
] |
TTKunt/keras-attention-mechanism | [
"0309dbf79da32c0d8d90925660fc4cc7fe53dc8a"
] | [
"examples/imdb.py"
] | [
"import numpy\nimport numpy as np\nfrom tensorflow.keras import Input\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.callbacks import Callback\nfrom tensorflow.keras.datasets import imdb\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.layers import Dropout\nfrom tensorflow.keras.layers... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.keras.datasets.imdb.load_data",
"numpy.max",
"numpy.random.seed",
"numpy.mean",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model"... |
sheha919/new_directory | [
"b2564ceee1fefa948efa63ef5620b0fc537b2bc9"
] | [
"first_module_name/molecule.py"
] | [
"\"\"\"\r\nmolecule.py\r\nA python package for the MolSSI Software Summer School.\r\nContains a molecule class\r\n\"\"\"\r\n\r\nimport numpy as np\r\n\r\nfrom .measure import calculate_angle, calculate_distance\r\n\r\n\r\nclass Molecule:\r\n def __init__(self, name, symbols, coordinates):\r\n if isinstanc... | [
[
"numpy.random.random"
]
] |
guoyi118/KnowledgeEditor | [
"167d75149d77cd5371c9f625a371e0443098ae99"
] | [
"src/models/bart_seq2seq_kilt.py"
] | [
"from argparse import ArgumentParser\n\nimport pytorch_lightning as pl\nimport torch\nfrom pytorch_lightning import LightningModule\nfrom torch.utils.data import DataLoader\nfrom transformers import (\n BartForConditionalGeneration,\n BartTokenizer,\n get_linear_schedule_with_warmup,\n)\nimport jsonlines\n... | [
[
"torch.no_grad",
"torch.optim.AdamW",
"torch.utils.data.DataLoader",
"torch.ones_like"
]
] |
minhtannguyen/RAdam | [
"44f403288df375bae0785cc82dd8c888eaaaa441"
] | [
"cifar_imagenet/models_backup/imagenet_v3_1/horesnet.py"
] | [
"from __future__ import division\n\"\"\" \nCreates a ResNeXt Model as defined in:\nXie, S., Girshick, R., Dollar, P., Tu, Z., & He, K. (2016). \nAggregated residual transformations for deep neural networks. \narXiv preprint arXiv:1611.05431.\nimport from https://github.com/facebookresearch/ResNeXt/blob/master/model... | [
[
"torch.nn.Linear",
"torch.flatten",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
dywsjtu/model_search | [
"116c4f9016d8b89cf06d057dda020dae3371f211"
] | [
"model_search/data/csv_data.py"
] | [
"# Copyright 2021 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.compat.v2.compat.v1.disable_eager_execution",
"tensorflow.compat.v2.data.experimental.CsvDataset",
"tensorflow.compat.v2.compat.v1.placeholder",
"tensorflow.compat.v2.feature_column.numeric_column",
"tensorflow.compat.v2.estimator.export.build_raw_serving_input_receiver_fn"
]
] |
championway/asv_ros | [
"4ded50c48077e1e63586cd32be2354633c163975"
] | [
"catkin_ws/src/localization/src/localization_gps_imu_gps_duplicate.py"
] | [
"#!/usr/bin/env python\n'''\nAuthor: Tony Hsiao \nDate:2019/01/16 \nLast update: 2019/01/16 \nLocailization by gps and imu\n'''\nimport ... | [
[
"numpy.sqrt",
"scipy.stats.norm",
"numpy.zeros"
]
] |
gogobd/PyTorch-GAN | [
"a163b82beff3d01688d8315a3fd39080400e7c01",
"a163b82beff3d01688d8315a3fd39080400e7c01"
] | [
"implementations/ebgan/ebgan.py",
"implementations/srgan/datasets.py"
] | [
"import argparse\nimport os\nimport numpy as np\nimport math\n\nimport torchvision.transforms as transforms\nfrom torchvision.utils import save_image\n\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets\nfrom torch.autograd import Variable\n\nimport torch.nn as nn\nimport torch.nn.functional... | [
[
"torch.nn.Linear",
"numpy.random.normal",
"torch.nn.MSELoss",
"torch.nn.init.constant_",
"torch.nn.Tanh",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.Upsample",
"torch.nn.ReLU",
"torch.nn.init.normal_",
"torch.cuda.is_available",
"torch.nn.Conv2d",
"... |
johnson7788/transformers | [
"005519f2c50851b219d6946ea4d6ef9ec4f87bbc"
] | [
"myexample/msra_run_ner.py"
] | [
"# coding=utf-8\nimport logging\nimport os\nimport sys\nfrom dataclasses import dataclass, field\nfrom typing import Optional\n\nimport numpy as np\nfrom datasets import ClassLabel, load_dataset\nfrom seqeval.metrics import accuracy_score, f1_score, precision_score, recall_score\n\nimport transformers\nfrom transfo... | [
[
"numpy.argmax"
]
] |
Dominykas-Tautkus/corr-app | [
"deb6bb45095ef570b40875985d1c8f931b90f4bc"
] | [
"_notebooks/scripts/.ipynb_checkpoints/read_data-checkpoint.py"
] | [
"import plotly.graph_objects as go\nimport pandas as pd\nimport plotly.express as px\nfrom datetime import datetime, timedelta\nimport requests\nimport json\nimport time\n\ndef read():\n df1 = pd.read_csv(\"CSV/ETH_BTC_USD_2015-08-09_2020-04-04-CoinDesk.csv\")\n df1.columns = ['date', 'ETH', 'BTC']\n df1.d... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.read_json",
"pandas.concat",
"pandas.read_csv"
]
] |
vatj/feature-store-api | [
"5703a2b3292c233ce3652fad058806f373d83967"
] | [
"python/hsfs/engine/spark.py"
] | [
"#\n# Copyright 2020 Logical Clocks AB\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
vprzybylo/ai2es | [
"cd54222ca377e15dfada6436564e7f4ee942527c"
] | [
"day-night-classification/train_model.py"
] | [
"# USAGE\n# python train_model.py --dataset images --model model/day_night.hd5\n\n# set the matplotlib backend so figures can be saved in the background\nimport matplotlib\nmatplotlib.use(\"Agg\")\n\n# import the necessary packages\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.optimizers imp... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.ylabel",
"sklearn.model_selecti... |
sstcam/TargetCalibSB | [
"f327b3e7ed63609c82264962863fc1e686c58858"
] | [
"TargetCalibSB/scripts/plot_cell_pedestal_vs_position.py"
] | [
"import argparse\nfrom argparse import ArgumentDefaultsHelpFormatter as Formatter\nfrom TargetCalibSB.pedestal import PedestalCellPosition\nfrom TargetCalibSB.stats import PixelStats, OnlineStats, OnlineHist\nfrom CHECLabPy.core.io import TIOReader\nfrom CHECLabPy.plotting.setup import Plotter\nfrom CHECLabPy.plott... | [
[
"numpy.where",
"numpy.arange",
"matplotlib.ticker.MultipleLocator"
]
] |
daviskirk/subseqs | [
"8e538b1d1857413721c27eb47b567e9b7fedddf6"
] | [
"example.py"
] | [
"\nimport pyximport; pyximport.install()\n\nimport pandas as pd\nimport numpy as np\nimport numba as nb\nfrom numba import jit, njit\nfrom time import perf_counter, perf_counter_ns\nfrom subseq import is_subseq_py, is_subseq_rs\nfrom cy_subseq import find_loop_cy\n\nimport cython\n\ndef find_loop(seq, subseq):\n ... | [
[
"numpy.array",
"pandas.Series"
]
] |
rosinality/melgan-pytorch | [
"c03662fe0a63c5502ea33d2c17da75b77e278a30"
] | [
"train_melgan.py"
] | [
"import random\n\nimport torch\nfrom torch import optim, nn\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader, Subset\nfrom tqdm import tqdm\nimport librosa.display\n\nfrom dataset import MelInversionDataset\nfrom melgan import Generator, MultiScaleDiscriminator\n\nimport matplotlib as ... | [
[
"matplotlib.use",
"torch.nn.functional.l1_loss",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"torch.utils.data.DataLoader",
"torch.utils.data.Subset",
"matplotlib.pyplot.subplot"
]
] |
pboley/PMOIRED | [
"7018322504f2b9d979889b1f7e95faa6d8b7c0a3"
] | [
"pmoired/__init__.py"
] | [
"try:\n from pmoired import oimodels, oifits, oicandid, oifake\nexcept:\n import oimodels, oifits, oicandid , oifake\n\n\nimport time\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport multiprocessing\ntry:\n # -- see https://stackoverflow.com/questions/64174552\n multiprocessing.set_start... | [
[
"numpy.array",
"matplotlib.pyplot.suptitle",
"numpy.interp",
"numpy.mean",
"matplotlib.pyplot.figure"
]
] |
12rambau/sepal_translator | [
"8b4e924e9e00bcddb111bc6348cfd9b18eaeb571"
] | [
"nlp_sandbox/examples/run_translation.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. team. 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# ... | [
[
"numpy.where",
"numpy.count_nonzero",
"numpy.mean"
]
] |
bartnijssen/neuralhydrology | [
"a710d616ff67e5e321b3df216959ae6456e6e4c0"
] | [
"neuralhydrology/utils/samplingutils.py"
] | [
"from typing import List, Dict, Callable\n\nimport numpy as np\nimport torch\nfrom torch.distributions import Categorical, Uniform\n\nfrom neuralhydrology.utils.config import Config\nfrom neuralhydrology.training.utils import umal_extend_batch\n\n\ndef sample_pointpredictions(model: 'BaseModel', data: Dict[str, tor... | [
[
"torch.zeros",
"torch.distributions.Categorical",
"torch.stack",
"torch.relu",
"torch.isnan",
"torch.FloatTensor",
"numpy.ones",
"torch.repeat_interleave",
"torch.multinomial",
"numpy.random.randint",
"torch.log"
]
] |
bjkomer/hyperopt | [
"ddb32ecf384312ae0fd9f9e17d2d9e17e90e6096"
] | [
"hyperopt/pyll/tests/test_stochastic.py"
] | [
"import numpy as np\nfrom hyperopt.pyll import scope, as_apply, dfs, rec_eval\nfrom hyperopt.pyll.stochastic import *\n\ndef test_recursive_set_rng_kwarg():\n uniform = scope.uniform\n a = as_apply([uniform(0, 1), uniform(2, 3)])\n rng = np.random.RandomState(234)\n recursive_set_rng_kwarg(a, rng)\n ... | [
[
"numpy.sqrt",
"numpy.random.RandomState"
]
] |
PerceptronV/Exnate | [
"900f26d9387828519e468918d0711d3363f96239"
] | [
"data/dataloader.py"
] | [
"import requests\nimport investpy as ivpy\nimport os\nimport json\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime as dt\nfrom tqdm import tqdm\nimport warnings\n\nif not os.path.exists('imfloader.py'):\n r = requests.get('https://raw.githubusercontent.com/PerceptronV/Exnate/master/data/im... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.concat"
]
] |
arunmarria/test_package | [
"cd5cbcf189e56453eda94485c8b9c636dd5fb95e"
] | [
"tests/test_test_package.py"
] | [
"from test_package import test_package\n\nfrom test_package import test_package\nimport pandas as pd\n\n\ndef test_catbind():\n a = pd.Categorical([\"character\", \"hits\", \"your\", \"eyeballs\"])\n b = pd.Categorical([\"but\", \"integer\", \"where it\", \"counts\"])\n assert ((test_package.catbind(a, b))... | [
[
"pandas.Categorical"
]
] |
sonomarina/Stock-sentiment-analysis | [
"2b3ddd88c73916ea06d39ef5d455f9220c69fdf7"
] | [
"Strategy_IV_renko_macd.py"
] | [
"# =============================================================================\r\n# Backtesting strategy - IV : combining renko with other MACD\r\n# Author : Mayank Rasu\r\n\r\n# Please report bug/issues in the Q&A section\r\n# =============================================================================\r\n\r\ni... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.sqrt",
"numpy.where"
]
] |
Kexiii/DeepImageAnalogy | [
"3c4baf577eac4592de9cdde4245ba081ce18cc4a"
] | [
"utils.py"
] | [
"from __future__ import print_function, division\r\n\r\nimport cv2\r\nimport numpy as np\r\nimport torch\r\n\r\ndef ts2np(x):\r\n x = x.squeeze(0)\r\n x = x.cpu().numpy()\r\n x = x.transpose(1,2,0)\r\n return x\r\n\r\ndef np2ts(x):\r\n x = x.transpose(2,0,1)\r\n x = torch.from_numpy(x)\r\n x = ... | [
[
"torch.sqrt",
"torch.min",
"torch.max",
"torch.from_numpy",
"torch.sum"
]
] |
syyxsxx/PaddleDetection | [
"da0e1eed6472d492abc9db1db324569f9be62a5f"
] | [
"dygraph/ppdet/data/transform/operator.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.dot",
"numpy.ones_like",
"numpy.random.rand",
"numpy.minimum",
"numpy.min",
"numpy.where",
"numpy.cos",
"numpy.frombuffer",
"numpy.concatenate",
"numpy.random.normal",
"numpy.sin",
"numpy.max",
"numpy.full",
"numpy.logical_and",
"numpy.take",
... |
tomgtqq/deep-reinforcement-learning-navigation | [
"41a06c0b561f1275c08cb81ae7130417241ac199"
] | [
"(Optional) Challenge Learning from Pixels/model_Pixels.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass QNetwork(nn.Module):\n def __init__(self, in_channels, num_actions, seed):\n super(QNetwork, self).__init__()\n self.conv1 = nn.Conv3d(in_channels=in_channels, out_channels=10, kernel_size=3, padding = 1)\n self... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool3d",
"torch.nn.Conv3d"
]
] |
phamthuy1320/Face-Sketch | [
"fd147386cffa41572140cc165bbb0edb975cfeb5"
] | [
"evaluate.py"
] | [
"\"\"\"\nEvaluate the performance of face sketch synthesis.\nMethod: PCA and SVM face recognition.\nModified from face recognition examples from sklearn: \n http://scikit-learn.org/stable/tutorial/statistical_inference/putting_together.html\n\"\"\"\nfrom __future__ import print_function\n\nfrom time import time\... | [
[
"numpy.array",
"numpy.ceil",
"numpy.argmin",
"numpy.sum",
"numpy.mean",
"sklearn.decomposition.PCA",
"numpy.floor"
]
] |
jisqyv/tensorflow | [
"4c28fbf2c0d20ed714fd0209913b868a7955ac5a"
] | [
"tensorflow/python/estimator/canned/dnn.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.layers.core.dropout",
"tensorflow.python.estimator.warm_starting_util._warm_start",
"tensorflow.python.estimator.canned.head._binary_logistic_head_with_sigmoid_cross_entropy_loss",
"tensorflow.python.ops.partitioned_vari... |
SHIMengjie/Machine-Learning-Andrew-Ng-Matlab | [
"2f54790e33dc538aea1534f40342791fb7c3abb1"
] | [
"python/ex5/ex5.py"
] | [
"import scipy.io as scio\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom linearCostFunction import linear_cost_function\nfrom trainLinearRegression import train_linear_reg\nfrom learningCurve import learning_curve\nfrom polyFeatures import ploy_feature\nfrom featuresNormalize import feature_nomalize\nf... | [
[
"numpy.max",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"scipy.io.loadmat",
"numpy.ones",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"numpy.min",
"matplotlib.pyplot.show",
"numpy.arange",
... |
bharadwaj1098/salina | [
"ac71cadacc54ae48377c67c88d269fc05209341c"
] | [
"salina/agents/dataloader.py"
] | [
"#\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nimport gym\nimport torch\nfrom gym.utils import seeding\nfrom torch.utils.data import DataLoader\n\nfrom salina import Agent\n... | [
[
"torch.cat",
"torch.tensor",
"torch.randn"
]
] |
daiquocnguyen/Graph-Transformer | [
"f9dc818a06ff0490f3d1bcc2e7b9ccd188950dcd"
] | [
"UGformerV1_TF/train_UGformerV1_UnSup.py"
] | [
"#! /usr/bin/env python\n\nimport tensorflow as tf\nimport numpy as np\nnp.random.seed(123456789)\ntf.compat.v1.set_random_seed(123456789)\n\nimport os\nimport time\nimport datetime\nfrom UGformerV1_UnSup import UGformerV1\nimport pickle as cPickle\nfrom argparse import ArgumentParser, ArgumentDefaultsHelpFormatter... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.choice",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.get_default_graph",
"numpy.random.seed",
"tensorflow.compat.v1.ConfigProto",
"numpy.ones",
"numpy.tile",
"tensorflow.Variable",
"tensorflow.Graph",
"te... |
wobushishuiguo/Rotation-ship-detection | [
"e49f2c7fd71d6f05b3d0fa6dd67ad751b306592e"
] | [
"mmdet/datasets/pipelines/formating.py"
] | [
"from collections.abc import Sequence\n\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.parallel import DataContainer as DC\n\nfrom ..builder import PIPELINES\n\n\ndef to_tensor(data):\n \"\"\"Convert objects of various python types to :obj:`torch.Tensor`.\n\n Supported types are: :class:`numpy.ndar... | [
[
"numpy.zeros",
"torch.FloatTensor",
"numpy.ones",
"torch.from_numpy",
"torch.LongTensor",
"torch.tensor",
"numpy.expand_dims"
]
] |
shahakshay11/medical-entity-extraction-nlp | [
"012a52dc76f54c0835d73124ca857426adee049e",
"012a52dc76f54c0835d73124ca857426adee049e"
] | [
"code/dnc_code/tasks/archive/ner_task_bio_orig.py",
"code/data_preprocessing/data_analysis.py"
] | [
"# Named Entity Recognition on Medical Data (BIO Tagging)\n# Bio-Word2Vec Embeddings Source and Reference: https://github.com/ncbi-nlp/BioWordVec\n\nimport os\nimport re\nimport torch\nimport pickle\nfrom torch import nn\nfrom torch import optim\nimport torch.nn.functional as F\n\nimport numpy as np\nimport random\... | [
[
"numpy.full",
"numpy.asarray",
"torch.nn.functional.softmax",
"numpy.sum",
"torch.save",
"numpy.where",
"torch.load",
"numpy.cumsum",
"torch.mean",
"torch.empty",
"torch.nn.CrossEntropyLoss",
"numpy.in1d"
],
[
"matplotlib.ticker.MultipleLocator",
"numpy.... |
kilsenp/person-multi-task-dataset | [
"df98f3f658c39fb3fa4ac0456f1214f7918009f6"
] | [
"models/merging_blocks.py"
] | [
"import torch\nimport torch.nn as nn\n\nclass SingleBlock(nn.Module):\n def calc_output_size(self, dimensions):\n return dimensions[self.endpoint]\n\n def __init__(self, endpoint):\n super().__init__()\n self.endpoint = endpoint\n\n\n def forward(self, outputs):\n # TODO output ... | [
[
"torch.cat"
]
] |
jasonlai777/Faster-R-CNN | [
"b5c0c18a9b5faabd4b6ef23346aff85104df7356"
] | [
"cfmap_v2.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport pickle\nimport numpy as np\nimport argparse\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\n\ndef voc_eval(detpath,\n imagesetfile,\n classname,\n cachefile,\n ovthresh=0.... | [
[
"numpy.max",
"numpy.delete",
"matplotlib.pyplot.colorbar",
"numpy.array",
"numpy.zeros",
"numpy.minimum",
"numpy.sum",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.sort",
"numpy.argsort",
"numpy.maximum",
"numpy.argmax",
... |
bladmorv/lantz | [
"0e600df1a94102715346d0acef0657774e8ddede"
] | [
"lantz/drivers/andor/andor.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\n lantz.drivers.andor.andor\r\n ~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n Low level driver wrapping atcore andor library.\r\n\r\n\r\n Sources::\r\n\r\n - Andor Manual\r\n\r\n :copyright: 2012 by Lantz Authors, see AUTHORS for more details.\r\n :license: BSD, see... | [
[
"matplotlib.pyplot.show",
"numpy.fromstring",
"matplotlib.pyplot.imshow"
]
] |
pimajor/py-simulitis | [
"6e0f2d419c28c47dcb5f9b6ee90c6b466e47204a"
] | [
"step_Report.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport datetime as dt\nfrom matplotlib.dates import DateFormatter\n\n\npath = \"C:\\\\Users\\\\pierre\\\\Downloads\\\\files\\\\Download\\\\samsunghealth_pierre.major_202008021218\\\\com.samsung.shealth.step_daily_trend.2020080... | [
[
"pandas.to_datetime",
"matplotlib.dates.DateFormatter",
"matplotlib.dates.MonthLocator",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
wallfacerlogic/CNN-Style | [
"206389ff5f5f6ad9a702270df0292a1424944efd"
] | [
"eval.py"
] | [
"# coding: utf-8\nfrom __future__ import print_function\nimport tensorflow as tf\nfrom preprocessing import preprocessing_factory\nimport reader\nimport model\nimport time\nimport os\n\ntf.app.flags.DEFINE_string('loss_model', 'vgg_16', 'The name of the architecture to evaluate. '\n 'You c... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.expand_dims",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.logging.info",
"tensorflow.global_variables",
"tensorflow.image.encode_jpeg",
"te... |
JohannesBuchner/nnest | [
"d46e1920e4aa5c0e542c327ecca9cd0629728f0a"
] | [
"examples/nested/mog4.py"
] | [
"import os\nimport sys\nimport argparse\nimport copy\n\nimport numpy as np\nimport scipy.special\n\nsys.path.append(os.getcwd())\n\n\ndef log_gaussian_pdf(theta, sigma=1, mu=0, ndim=None):\n if ndim is None:\n try:\n ndim = len(theta)\n except TypeError:\n assert isinstance(th... | [
[
"numpy.sum",
"numpy.asarray",
"numpy.log"
]
] |
Odiurd/deep-reinforcement-learning-collaboration-and-competition | [
"f9c95c498fa385777ea3b27c58349a0d40824736"
] | [
"train.py"
] | [
"from unityagents import UnityEnvironment\nimport numpy as np\nfrom collections import deque\nfrom ddpg_agent import Agent\nimport torch\nimport matplotlib.pyplot as plt\nfrom time import strftime, gmtime\n\n\nENV_PATH = \"Tennis_Windows_x86_64/Tennis.exe\"\nACTOR_CHECKPOINT_NAME = 'checkpoint_actor.pth'\nCRITIC_CH... | [
[
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.any",
"torch.cuda.is_available",
"matplotlib.pyplot.ylabel"
]
] |
jacubillos10/ProyectoDeGradoFisica | [
"6af56217069d0170b164a7eb4a09ef1262a97aee"
] | [
"MinP_fnpeaks1.py"
] | [
"#!/usr/bin/env/python\n#-*- coding: utf-8 -*-\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport csv\nimport sys\nimport os\n\ntipo_estrella=\"RR_Lyrae\";\nnumero_estrella='01981';\nporc_ini=0.99;\n\n\n#------------------------------------------------------------------------------------------------------... | [
[
"numpy.loadtxt",
"numpy.genfromtxt"
]
] |
binghong-ml/multiobj-rationale | [
"735916854fba1886730ecac306dd509e930d67bd"
] | [
"multiobj_rationale/fuseprop/inc_graph.py"
] | [
"import torch\nimport rdkit.Chem as Chem\nimport networkx as nx\n\nfrom multiobj_rationale.fuseprop.mol_graph import MolGraph\nfrom multiobj_rationale.fuseprop.chemutils import *\nfrom collections import defaultdict\n\nclass IncBase(object):\n\n def __init__(self, batch_size, node_fdim, edge_fdim, max_nodes, max... | [
[
"torch.zeros",
"torch.cat"
]
] |
Bsuniverse/NWPU-CFD | [
"b893575451e5309cd1a81cf43fda88a5935b1ebc"
] | [
"Burgers/burgers.py"
] | [
"#!/usr/bin/python\r\n#-*- coding: <encoding name> -*-\r\nimport numpy as np\r\nimport pandas as pd \r\nimport os\r\nimport matplotlib.pyplot as plt \r\nfrom mpl_toolkits.mplot3d import Axes3D\r\n\r\nclass Burgers:\r\n\t'''\r\n\tA Burgers 1-demension partial differential equation numerical solver with:\r\n\t\t- 3 i... | [
[
"pandas.read_csv",
"numpy.zeros"
]
] |
bernardomig/neural | [
"7e45208de4f0be7b183977df176c8d23428c7cde",
"7e45208de4f0be7b183977df176c8d23428c7cde"
] | [
"scripts/models/segmentation/icnet/train_cityscapes.py",
"neural/models/segmentation/lednet.py"
] | [
"\nfrom itertools import chain\nimport cv2\nimport argparse\nimport os\nfrom logging import info\n\nimport torch\nfrom torch import nn\nfrom torch import distributed as dist\nfrom torch.utils.data import DataLoader, DistributedSampler\n\nfrom apex import amp\nfrom apex.parallel import (\n DistributedDataParallel... | [
[
"torch.device",
"torch.nn.functional.interpolate",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.load",
"torch.log",
"torch.nn.CrossEntropyLoss"
],
[
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm... |
zpao/captum | [
"06009a0c68e56f549964a132ba9c4c4f418af7bd"
] | [
"tests/attr/test_layer_conductance.py"
] | [
"#!/usr/bin/env python3\n\nimport unittest\n\nimport torch\nfrom captum.attr._core.layer_conductance import LayerConductance\n\nfrom .helpers.basic_models import (\n BasicModel_ConvNet,\n BasicModel_MultiLayer,\n BasicModel_MultiLayer_MultiInput,\n)\nfrom .helpers.conductance_reference import ConductanceRe... | [
[
"torch.tensor",
"torch.randn",
"torch.sum"
]
] |
ArchibaldChain/python-workspace | [
"71890f296c376155e374b2096ac3d8f1d286b7d2"
] | [
"Workspace for Python/WebCrawler/Taobao_price_comparesion.py"
] | [
"import re\nimport requests\nfrom bs4 import BeautifulSoup\nimport pandas as pd\nimport numpy as np\n\ndef getHTMLText(url):\n try:\n header = {\"user-agent\": \n \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36\"}\n r = requests.get... | [
[
"pandas.DataFrame"
]
] |
jiangqn/KSTER | [
"fe59dca2d046439bbde4be9f708e4f620f089977"
] | [
"joeynmt/kernel.py"
] | [
"import torch\nfrom typing import Tuple, Union\n\nclass Kernel(object):\n\n def __init__(self) -> None:\n super(Kernel, self).__init__()\n \n def similarity(self, distances: torch.Tensor, bandwidth: Union[float, torch.Tensor]) -> torch.Tensor:\n raise NotImplementedError\n\n def compute_ex... | [
[
"torch.sqrt",
"torch.softmax",
"torch.scatter_add"
]
] |
xiankgx/taming-transformers | [
"8d154c34d88be5d41f32cbc40dd115f55d7589d9"
] | [
"taming/data/base.py"
] | [
"import bisect\nimport numpy as np\nimport albumentations\nfrom PIL import Image, ImageFile\nfrom torch.utils.data import Dataset, ConcatDataset\nImageFile.LOAD_TRUNCATED_IMAGES = True\n\n\nclass ConcatDatasetWithIndex(ConcatDataset):\n \"\"\"Modified from original pytorch code to return dataset idx\"\"\"\n d... | [
[
"numpy.array",
"numpy.transpose",
"numpy.load"
]
] |
Lvigilante/correctionlib | [
"5c426e44faa34e939fd1a7cc2df95f7424498211"
] | [
"tests/test_highlevel.py"
] | [
"import pickle\n\nimport numpy\nimport pytest\n\nimport correctionlib\nfrom correctionlib import schemav2 as model\n\n\ndef test_highlevel():\n cset = correctionlib.CorrectionSet(\n model.CorrectionSet(\n schema_version=model.VERSION,\n corrections=[\n model.Correction... | [
[
"numpy.full",
"numpy.ones"
]
] |
omarjarkas1997/Graduate-Analyst-Programmer-Code-Test | [
"f22711d1239146d57462b66edac0ee18a196b78f"
] | [
"test.py"
] | [
"import unittest\nimport pandas as pd\nimport app\n\n\nclass MoveTests(unittest.TestCase):\n\n def test_five_plus_five(self):\n assert 5 + 5 == 10\n\n def test_ont_plus_one(self):\n assert not 1+ 1 == 3\n \n def test_getUniqOS(self):\n df = pd.read_csv(r'../data.csv')\n l... | [
[
"pandas.read_csv"
]
] |
hadim/pytorch-lightning | [
"89d5772f5549d383cbc4cf4ee602fd5e30db3def"
] | [
"pl_examples/full_examples/semantic_segmentation/models/unet/parts.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass DoubleConv(nn.Module):\n '''\n Double Convolution and BN and ReLU\n (3x3 conv -> BN -> ReLU) ** 2\n '''\n def __init__(self, in_ch, out_ch):\n super().__init__()\n self.net = nn.Sequential(\n nn.... | [
[
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Upsample",
"torch.nn.Conv2d",
"torch.nn.functional.pad"
]
] |
HendrickZhou/Chirp-EE123 | [
"6d34f588d99ee8801f1c9137ad4f05e862593435"
] | [
"src/utils/Helper_functions.py"
] | [
"\"\"\"utilities funcitons for project\"\"\"\nimport sys\nimport os\nscript_path = os.path.abspath('')\nmodule_path = script_path[:script_path.rfind('src')]+ 'src' + '/'\nasset_path = script_path[:script_path.rfind('src')]+ 'asset' + '/'\nsys.path.append(module_path)\nimport numpy as np\n\nfrom PIL import Image\nim... | [
[
"numpy.max",
"numpy.array",
"numpy.ceil",
"numpy.empty",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.ones",
"matplotlib.pyplot.subplots",
"numpy.shape",
"numpy.flipud",
"numpy.append",
"numpy.log10",
"numpy.maximum"
]
] |
yishantao/DailyPractice | [
"ee26859af3faf48e63d6c2850db1d895a8a88fb1"
] | [
"temp_201806/0615test.py"
] | [
"import numpy as np\nimport pandas as pd\n\n# data1 = pd.DataFrame({'a': [np.nan, 1, 2, 3], 'b': [np.nan, np.nan, 5, 6]})\ndata2 = pd.DataFrame({'a': [5, 6, 7, 8], 'b': [10, 11, 12, 13]}, index=['h', 'i', 'j', 'k'])\nprint(data2)\nprint(data2.loc['h', ['a','b']])\n"
] | [
[
"pandas.DataFrame"
]
] |
sjgosai/basenji | [
"0bc02718319db12896d2854bcb2f6bd7ed67fa4a"
] | [
"bin/basenji_map.py"
] | [
"#!/usr/bin/env python\n# Copyright 2017 Calico LLC\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# https://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by appli... | [
[
"numpy.array",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.min",
"numpy.multiply",
"numpy.where",
"scipy.stats.ttest_1samp",
"numpy.power",
"numpy.abs"
]
] |
tlentali/leab | [
"1f2eda95953738c375f389479b160d7ecb494e40"
] | [
"leab/before/leSample.py"
] | [
"\nimport numpy as np\nfrom scipy.stats import norm\n\nfrom .leReport import leReport\n\nclass leSample:\n \"\"\"\n Build leSample object.\n\n Parameters:\n\n conversion_rate (float): baseline conversion rate.\n min_detectable_effect (float): minimum detectable effect.\n significance_l... | [
[
"numpy.round",
"scipy.stats.norm.ppf",
"numpy.sqrt"
]
] |
nasa/GHRC-FieldCampaign-eXplorer-core | [
"60532f5946efcbec047abbed5c8413fc695781cb"
] | [
"flight_track.py"
] | [
"import numpy as np\nfrom copy import deepcopy\nimport json\nimport boto3\nimport os\n\nmodel = {\n \"id\": \"Flight Track\",\n \"name\": \"ER2\",\n \"availability\": \"{}/{}\",\n \"model\": {\n \"gltf\": \"https://s3.amazonaws.com/visage-czml/iphex_HIWRAP/img/er2.gltf\",\n \"scale\": 100.... | [
[
"numpy.datetime64",
"numpy.core.defchararray.decode",
"numpy.isnan",
"numpy.string_",
"numpy.copy",
"numpy.logical_and",
"numpy.loadtxt",
"numpy.unique"
]
] |
lethucuyen/python-stock-price-prediction | [
"54aa2b5a9b24eddece5e09e74c13095c5f535566"
] | [
"build_xgboost_model_RSI_MA.py"
] | [
"import numpy as np\nimport pandas as pd\nimport datetime as dt\nimport pandas_datareader as web\nfrom xgboost import XGBRegressor\nimport pickle\n\n#from sklearn.model_selection import GridSearchCV\n\n#from sklearn.model_selection import train_test_split\n#from sklearn.metrics import accuracy_score\n#from sklearn... | [
[
"pandas.Series"
]
] |
ntalabot/base_dl_project_struct | [
"2a8b52081baf678fec4b74b16f41dd22a3d0eb21"
] | [
"src/utils/image.py"
] | [
"\"\"\"\nUtility module for images.\n\"\"\"\n\nimport numpy as np\n\n\nIMAGENET_MEAN = np.array([0.485, 0.456, 0.406])\nIMAGENET_STD = np.array([0.229, 0.224, 0.225])\n\n\ndef normalize(image):\n \"\"\"Normalize the image with ImageNet statistics.\"\"\"\n out = image / 255\n out = (out - IMAGENET_MEAN) / I... | [
[
"numpy.uint8",
"numpy.array",
"numpy.float32"
]
] |
Golbstein/python-graphslam | [
"cccc022b2f5d797f6511bda9e7dd3a24af403016"
] | [
"tests/test_pose_se3.py"
] | [
"# Copyright (c) 2020 Jeff Irion and contributors\n\n\"\"\"Unit tests for the pose/pose_se3.py module.\n\n\"\"\"\n\n\nimport unittest\n\nimport numpy as np\n\nfrom graphslam.vertex import Vertex\nfrom graphslam.pose.se3 import PoseSE3\nfrom graphslam.edge.base_edge import BaseEdge\nfrom .edge_oplus_ominus import Ed... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.random.seed",
"numpy.eye",
"numpy.random.random_sample"
]
] |
jiyeong-yun/EyeOnYou2021 | [
"f70280de27ce50307f50f68fdee3b485aab64651"
] | [
"tensorflow/python/training/tracking/util.py"
] | [
"\"\"\"Utilities for saving/loading Trackable objects.\"\"\"\n# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
[
"tensorflow.python.training.tracking.graph_view.ObjectGraphView",
"tensorflow.python.ops.array_ops.identity",
"tensorflow.python.ops.gen_io_ops.restore_v2",
"tensorflow.python.training.py_checkpoint_reader.NewCheckpointReader",
"tensorflow.python.framework.ops.inside_function",
"tensorflow... |
akshaydnicator/webscraping | [
"c18713f777da4d4c85998c3ab2a4ed24ce20e04a"
] | [
"Scraper_News Articles/Scraper_StaticWebPage_moneycontrol.py"
] | [
"\n## This is an Autoscaper which would keep on extracting news on a given page on moneycontrol.com news website\n# given a url or a list of urls untill the work is finished\n\n# Import required libraries\nfrom bs4 import BeautifulSoup\nimport requests\nimport pandas as pd\nimport time\nfrom datetime import timedel... | [
[
"pandas.DataFrame.from_dict"
]
] |
NaiveTom/all_model | [
"52910c2920526179f65b27d21a21a066e9d7f3b2"
] | [
"DNA2VEC/train.py"
] | [
"# 使用GPU模式,不然永远也训练不完\nimport os\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\n\nfrom model import get_model\nimport numpy as np\nimport keras\nfrom keras.callbacks import Callback\nfrom datetime import datetime\nfrom sklearn.metrics import roc_auc_score, average_precision_score\nfrom sklearn.model_selection import... | [
[
"matplotlib.pyplot.savefig",
"tensorflow.config.experimental.set_memory_growth",
"numpy.load",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.clf",
"tensorflow.config.experimental.list_physical_devices"
]
] |
adimanzz/ga-learner-dsmp-repo | [
"af1bc4b62867233b091f40fa07d1ff0bb97236c0"
] | [
"Telecom-Churn-Predictioncode.py"
] | [
"# --------------\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n#path - Path of file \n\n# Code starts here\ndf = pd.read_csv(path)\n\nX = df.drop(['customerID','Churn'],1)\ny = df['Churn']\n\nX_train,X_test,y_train,y_test = train_test_split(X,y,test_size = 0.3,random_state = 0)\n\n\n\... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.confusion_matrix",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.model_selection.GridSearchCV",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.classification_report",
"sklearn.model_selection.train_test_split",
"pandas.re... |
widdowquinn/SI_Holmes_etal_2017 | [
"72dc0c3e537b6d940cb9f2ced4d4de19187c14ac"
] | [
"notebooks/tools.py"
] | [
"#!/usr/bin/env python3.5\n#\n# tools.py\n#\n# (C) The James Hutton Institute 2016\n# Author: Leighton Pritchard\n\n\"\"\"\ntools.py\n\nThis module provides helper functions used in the supplementary information\nnotebooks and scripts for the Holmes et al. (2017) paper.\n\"\"\"\n\nfrom matplotlib import pyplot as p... | [
[
"pandas.melt",
"numpy.log",
"pandas.merge",
"numpy.median",
"pandas.DataFrame",
"numpy.percentile",
"scipy.stats.spearmanr",
"matplotlib.pyplot.plot",
"scipy.stats.mstats.rankdata",
"matplotlib.pyplot.subplots",
"numpy.sort",
"pandas.concat",
"matplotlib.pyplot.... |
bcebere/jax_tabular_examples | [
"62413aba8f9c917ada3f6f1f59d7d94ad2738bf3"
] | [
"tests/test_mlp.py"
] | [
"# third party\nimport jax\nimport pytest\nfrom sklearn.datasets import load_diabetes, load_digits\n\nfrom jax_examples.models.mlp import MLP, BasicNetwork, NetworkConfig, _train_init\n\n\ndef test_network_config() -> None:\n config = NetworkConfig(\n task_type=\"regression\",\n model_type=str,\n ... | [
[
"sklearn.datasets.load_digits",
"sklearn.datasets.load_diabetes"
]
] |
abhimat/gatspy | [
"5aba05a839347eef1552cd108b8d3301d3ce63e0"
] | [
"gatspy/datasets/rrlyrae_generated.py"
] | [
"\"\"\"Tools to generate light curves\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\n__all__ = ['RRLyraeGenerated']\n\nimport numpy as np\nfrom scipy.interpolate import interp1d\nfrom . import fetch_rrlyrae_templates, fetch_rrlyrae\n\n\nclass RRLyraeGenerated(object):\n \"\"\"Generate... | [
[
"numpy.concatenate",
"numpy.isinf",
"scipy.interpolate.interp1d",
"numpy.isnan",
"numpy.asarray",
"numpy.random.RandomState"
]
] |
creamcheesesteak/Project_Guardians | [
"bfd499f9422964b35acaada1c2e4872835c06c79"
] | [
"project/Front/Front_s/naver_news.py"
] | [
"import requests\nfrom bs4 import BeautifulSoup\nimport pandas as pd\nfrom apscheduler.schedulers.blocking import BlockingScheduler\n\nurl = 'https://search.naver.com/search.naver?query=%EC%98%A8%EC%8B%A4%EA%B0%80%EC%8A%A4&where=news&ie=utf8&sm=nws_hty'\nreq = requests.get(url)\n\ndef get_now():\n soup = Beautif... | [
[
"pandas.DataFrame"
]
] |
SafonovMikhail/python_000577 | [
"739f764e80f1ca354386f00b8e9db1df8c96531d"
] | [
"000759DataCampPy01/DataCamp000759Py01ch04p01v_NumPy_20200415.py"
] | [
"import numpy as np\n\n# массив, состоящий из роста игроков\nheight = [1.73, 1.68, 1.71, 1.89, 1.79]\n\n# массив весок игроков (в кг.)\nweight = [65.4, 59.2, 63.6, 88.4, 68.7]\n\n# преобразуем массивы в нампи\nnp_height = np.array(height)\nnp_weight = np.array(weight)\n\nprint(np_height)\nprint(np_weight)\n\n# выпо... | [
[
"numpy.array"
]
] |
abulbasar/TensorFlowJavaExamples | [
"91905183657003a5be75bc9336a25c1a0ae7e026"
] | [
"train_tensor_mnist_cnn_saving.py"
] | [
"\r\nimport tensorflow as tf\r\n\r\nfrom tensorflow.python.saved_model import builder as saved_model_builder\r\n\r\ntf.reset_default_graph()\r\n\r\nfrom tensorflow.examples.tutorials.mnist import input_data\r\nmnist = input_data.read_data_sets(\"MNIST_data/\", one_hot=True)\r\n\r\nx = tf.placeholder(tf.float32, sha... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.nn.conv2d",
"tensorflow.saved_model.utils.build_tensor_info",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.argmax",
"tensorflow.Variable",
... |
shifengxu/pytorch-grad-cam | [
"1ae500e8ad10485df5a2eafed9cc0c01012ae6c6"
] | [
"pytorch_grad_cam/base_cam.py"
] | [
"import cv2\nimport numpy as np\nimport torch\nimport ttach as tta\nfrom pytorch_grad_cam.activations_and_gradients import ActivationsAndGradients\nfrom pytorch_grad_cam.utils.svd_on_activations import get_2d_projection\n\n\nclass BaseCAM:\n def __init__(self,\n model,\n target_la... | [
[
"numpy.concatenate",
"numpy.max",
"torch.autograd.Variable",
"numpy.min",
"numpy.mean",
"torch.from_numpy",
"numpy.float32",
"numpy.maximum"
]
] |
kookmin-sw/2019-cap1-2019_8 | [
"36c007f345cad637c1efc0e91b570ec467751f7d"
] | [
"util/compare_model.py"
] | [
"import pandas as pd\nimport lightgbm as lgb\nimport numpy as np\n\nfrom sklearn.svm import SVC\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.ensemble import GradientBoostingClassifier\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklear... | [
[
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.neural_network.MLPClassifier",
"sklearn.naive_bayes.GaussianNB",
"sklearn.svm.SVC",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticR... |
philip30/xnmt | [
"b5e6985d3bedfac102312cab030a60594bc17baf",
"b5e6985d3bedfac102312cab030a60594bc17baf"
] | [
"xnmt/input_readers.py",
"test/test_training.py"
] | [
"import functools\nimport itertools\nimport ast\nimport numbers\nimport warnings\nimport numpy as np\n\nfrom typing import Iterator, Optional, Sequence, Union\n\nfrom xnmt import logger\nfrom xnmt import events, vocabs\nfrom xnmt.graph import HyperEdge, HyperGraph\nfrom xnmt.persistence import serializable_init, Se... | [
[
"numpy.max",
"numpy.random.binomial",
"numpy.random.choice",
"numpy.copyto",
"numpy.zeros",
"numpy.sum",
"numpy.load",
"numpy.where",
"numpy.arange",
"numpy.empty_like"
],
[
"numpy.zeros"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.