repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
leepand/IronManFly | [
"ea29bf1415a51b23a0fbc95f2bae82013a0887a4"
] | [
"IronManFly/bandits_server/src/bandits.py"
] | [
"import numpy as np\n\nclass EpsilonGreedy(object):\n def __init__(self,n,decay=100):\n self.counts = [0] * n\n self.values = [0.] * n\n self.decay = decay\n self.n = n\n\n def get_epsilon(self):\n total = np.sum(self.counts)\n return float(self.decay) / (total + floa... | [
[
"numpy.argmax",
"numpy.random.random",
"numpy.sum",
"numpy.random.randint"
]
] |
tgao1337/flexible-pomodoro-tree | [
"745ec155a6d64f0e44ba5998911b6acb69f6a8e5"
] | [
"oled-plot.py"
] | [
"import matplotlib.pyplot as plt\nimport SSD1106\nfrom PIL import Image\nimport numpy as np\n\ndisplay = SSD1106.SSD1106()\ndisplay.setup()\ndisplay.clear()\n\n# Creatinng a plot figure of size 1.3x0.9 inches (OLED display size)\nfig = plt.figure(figsize=(1.28, 0.64), dpi=100)\nax = fig.add_axes((0.15, 0.35, 0.8, 0... | [
[
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure"
]
] |
OscarDPan/elephas | [
"4f3b16e16319aba54d7f67364d228c96d23fa460"
] | [
"examples/basic_import.py"
] | [
"from elephas.java import java_classes, adapter\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense\n\n\nmodel = Sequential()\nmodel.add(Dense(units=64, activation='relu', input_dim=100))\nmodel.add(Dense(units=10, activation='softmax'))\nmodel.compile(loss='categorical_crosse... | [
[
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.Sequential"
]
] |
jim-meyer/tensorflow-onnx | [
"2b3c23da102c875737362f858b78fa50ae48809f"
] | [
"tf2onnx/rewriter/gru_rewriter.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\n\"\"\"\ntf2onnx.rewriter.gru_rewriter\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport logging\nimport numpy as np\nfrom tf2onnx impo... | [
[
"numpy.concatenate",
"numpy.split",
"numpy.expand_dims",
"numpy.zeros_like"
]
] |
denguir/drl-rpn-video | [
"8e52ad0529da2cf5982f00bf836536819e0951ba"
] | [
"lib/test_script/save_test.py"
] | [
"import tensorflow as tf \nimport numpy as np \n\nweights3d_dir = '/home/vador/Documents/project/AI/drl-rpn-tf-video/pretrained-data/data3D/'\nmodel3d = weights3d_dir + 'model_test'\n\nvn1 = np.array(np.random.randint(0, 10, (4,5,5)))\nvt1 = tf.Variable(vn1, name='v1')\n\nvn2 = np.array(np.random.randint(0, 10, (4,... | [
[
"tensorflow.multiply",
"tensorflow.Variable",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.random.randint"
]
] |
CANGA/MIRA | [
"2f1214d34b884790fa8660b5208cd12495800f92"
] | [
"src/computeAreaIntegralSE.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Dec 17 11:29:22 2018\n\nComputes array of Jacobian weights for a given SE element of order 4\n\ncoords: double node data from .g file\nconnect: int connectivity data\n\n@author: jeguerra\n\"\"\"\nimport math as mt\nimport numpy as np\nfrom sci... | [
[
"numpy.matrix",
"numpy.dot",
"numpy.subtract",
"numpy.linalg.norm",
"numpy.add",
"numpy.size",
"scipy.linalg.norm",
"numpy.ravel",
"numpy.array",
"numpy.zeros"
]
] |
KATOKanji-0131/gloss-format-docxtable | [
"9896f4fe2643760febe67d5e8bb015db5aa22880"
] | [
"main.py"
] | [
"import docx\nfrom docx.shared import Pt\nfrom docx.shared import Mm\nimport math\nimport os.path\nimport pandas as pd\nimport re\nimport varibles\n\nwith open(\"example.txt\") as f:\n text_lines = f.readlines()\n\n# グロスと略語のリストを作り、略語の文字数でソート。文字数の長い順に処理しないと、NONPASTのPASTに\"PAST\"がヒットしてしまうため。\nabbreviations = pd.re... | [
[
"pandas.read_table"
]
] |
StevenJokess/autogluon | [
"bdbaac2d13d14d075b7aa751561f0bbd39927789"
] | [
"tabular/src/autogluon/tabular/trainer/abstract_trainer.py"
] | [
"import copy, time, traceback, logging\nimport os\nfrom typing import List, Union, Tuple\n\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\nimport psutil\nfrom collections import defaultdict\n\nfrom autogluon.core.constants import AG_ARGS, AG_ARGS_FIT, BINARY, MULTICLASS, REGRESSION, QUANTILE, REFIT... | [
[
"pandas.concat",
"pandas.Series",
"numpy.isnan",
"pandas.option_context",
"pandas.DataFrame"
]
] |
Reinaesaya/CIL-CARLA-CSC2621 | [
"f6a983616c6e789a8a7f295e112dae89719c46d3"
] | [
"PythonClient_planning/agents/imitation/imitation_learning.py"
] | [
"from __future__ import print_function\n\nimport os\n\nimport scipy\n\nimport tensorflow as tf\nimport numpy as np\n\nslim = tf.contrib.slim\n\nfrom carla.agent import Agent\nfrom carla.carla_server_pb2 import Control\nfrom agents.imitation.imitation_learning_network import load_imitation_learning_network\n\n\nclas... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.device",
"numpy.multiply",
"tensorflow.global_variables",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.GPUOptions",
"tensorflow.name_scope",
"tensorflow.Session",
"tensorflow.train.Save... |
weleen/MGH.pytorch | [
"69f2830f6bd60fe3b33c80c04540c0c800d26de1"
] | [
"fastreid/modeling/backbones/regnet/regnet.py"
] | [
"import logging\nimport math\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom fastreid.layers import get_norm\nfrom fastreid.utils import comm\nfrom fvcore.common.checkpoint import get_missing_parameters_message, get_unexpected_parameters_message\nfrom .config import cfg as regnet_cfg\nfrom ..buil... | [
[
"numpy.log",
"torch.empty",
"numpy.power",
"numpy.unique",
"numpy.arange",
"torch.nn.Conv2d",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.device",
"torch.nn.ReLU",
"numpy.divide"
]
] |
alivcor/aes | [
"f6bb9a6da771db6e786fe00e25d1217786e2b21b"
] | [
"DeepScore/testing.py"
] | [
"import EventIssuer\nimport progressbar\nimport numpy\nimport re\nfrom scipy import spatial\n\nbar = progressbar.ProgressBar()\n\ndef loadCompleteGloveModel(logfilename):\n global bar\n model = {}\n EventIssuer.issueMessage(\"Loading GLoVE Word Vectors. This will take a while.\", logfilename)\n EventIss... | [
[
"numpy.array"
]
] |
shagunsodhani/consistent-dynamics | [
"cc1527f2468cdcebea9a57387254278eb5547fe3",
"cc1527f2468cdcebea9a57387254278eb5547fe3",
"cc1527f2468cdcebea9a57387254278eb5547fe3"
] | [
"codes/model/expert_policy/deterministic_mlp.py",
"codes/model/imagination_model/learning_to_query_with_imitation_learning.py",
"codes/envs/wrappers/general.py"
] | [
"import numpy as np\nimport os\nimport torch\nimport torch.nn as nn\nfrom torch.distributions import Distribution\n\nfrom codes.model.expert_policy.utils import RunningMeanStd\n\nclass Dirac(Distribution):\n def __init__(self, value):\n super(Dirac, self).__init__()\n self.value = value\n\n @pro... | [
[
"torch.nn.Sequential",
"torch.load",
"torch.cat",
"torch.randn",
"torch.nn.Linear",
"numpy.prod",
"torch.clamp"
],
[
"torch.tensor",
"torch.mean",
"torch.cat"
],
[
"numpy.rollaxis",
"numpy.expand_dims",
"numpy.zeros"
]
] |
HandsomeBrotherShuaiLi/FaceTask | [
"19bd202e92f0a394b4c8f2860ba7e088f2f5b573"
] | [
"libs/EfficientDet/augmentor/color.py"
] | [
"import numpy as np\nfrom PIL import Image, ImageEnhance, ImageOps\n\n\ndef autocontrast(image, prob=0.5):\n random_prob = np.random.uniform()\n if random_prob > prob:\n return image\n image = Image.fromarray(image)\n image = ImageOps.autocontrast(image)\n image = np.array(image)\n return i... | [
[
"numpy.random.uniform",
"numpy.array",
"numpy.random.randint"
]
] |
IceCrew-Source/BachelorDIM-Lectures-Algorithms-2020 | [
"95d2761883feebada25f62c20bdfe405a1353f61"
] | [
"sessions/session_2/test_S2.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 16 14:02:38 2020\n\n@author: viardcrl\n\"\"\"\n\nimport pytest as pt\nimport S1_algotools as s1\nimport numpy as np\n\n#------------------------------------------------------------------------#\n#------------------------------ EXERCISE 1 -------------------------... | [
[
"numpy.zeros",
"numpy.ones"
]
] |
The0nix/QuartzNet | [
"55613fde1c7d0fca2e81854d5c5c80a771126873"
] | [
"src/core/model.py"
] | [
"from typing import Union, Collection\n\nimport torch.nn as nn\n\n\nclass QuartzBlock(nn.Module):\n \"\"\"\n Basic block of QuartzNet consisting of Separable Convolution, BatchNorm and ReLU repeating R times\n :\n :param C_in: number of input channels\n :param C: C from paper (Channels) -- number of ... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.ReLU",
"torch.nn.Conv1d"
]
] |
jackonelli/dnn-mode-connectivity | [
"922a6a81af45e06cee4aec7e2031a55e8c660c34"
] | [
"plane.py"
] | [
"\"\"\"Plane\"\"\"\nimport os\nimport argparse\nimport numpy as np\nimport tabulate\nimport torch\nimport torch.nn.functional as F\n\nimport data\nimport models\nimport curves\nimport utils\n\nparser = argparse.ArgumentParser(\n description=\"Computes values for plane visualization\")\nparser.add_argument(\"--di... | [
[
"numpy.dot",
"numpy.linspace",
"torch.load",
"torch.Tensor",
"numpy.linalg.norm",
"numpy.stack",
"torch.from_numpy",
"numpy.zeros"
]
] |
makrinekaralas/time-series-analysis | [
"aea78d240710ff7949b49380e42fc1ebba2b99f5"
] | [
"tsa/.ipynb_checkpoints/auto_arima-checkpoint.py"
] | [
"__author__ = \"Maka Karalashvili\"\n__copyright__ = \"BMW Group\"\n__version__ = \"0.0.1\"\n__maintainer__ = \"Maka Karalashvili\"\n__email__ = \"maka.karalashvili@bmw.de\"\n__status__ = \"Development\"\n\nfrom tsa import Logger\n\nfrom tsa import UVariateTimeSeriesClass\nfrom tsa import print_attributes\n\nimport... | [
[
"pandas.Series",
"numpy.asarray",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.show"
]
] |
yukihiko/human-pose-estimation.pytorch | [
"187f60ac2088f91b9a48d9e5f4c2b1053a9f32bf"
] | [
"lib/core/loss.py"
] | [
"# ------------------------------------------------------------------------------\r\n# Copyright (c) Microsoft\r\n# Licensed under the MIT License.\r\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\r\n# ------------------------------------------------------------------------------\r\n\r\nfrom __future__ import abso... | [
[
"scipy.ndimage.filters.gaussian_filter",
"torch.nn.MSELoss",
"torch.Tensor",
"torch.zeros"
]
] |
jercas/TextBoxes_plusplus_tf | [
"035a5d202202662e2b1230e05a41d20a044b9145",
"035a5d202202662e2b1230e05a41d20a044b9145"
] | [
"datasets/synthtext2TFrecords_self.py",
"datasets/TFrecords2Dataset.py"
] | [
"import time\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport tensorflow.contrib.slim as slim\r\nimport util\r\n\r\n\r\ndef int64_feature(value):\r\n \"\"\"Wrapper for inserting int64 features into Example proto.\r\n \"\"\"\r\n if not isinstance(value, list):\r\n value = [value]\r\n ret... | [
[
"tensorflow.contrib.slim.tfexample_decoder.TFExampleDecoder",
"tensorflow.FixedLenFeature",
"numpy.asarray",
"numpy.reshape",
"tensorflow.contrib.slim.dataset.Dataset",
"numpy.transpose",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.contrib.slim.tfexample_decoder.BoundingBox"... |
rddunphy/MusicClassification | [
"efa58e474d2ff68cc24a07dd19b61e4dbac93765"
] | [
"results/lstm/hpcp_lstm COMP 15s bs=10 ts=2000/12bin_lstm_classifier_comp.py"
] | [
"#!/usr/bin/env python3\n\nimport csv\nimport os\nimport pickle\nfrom datetime import datetime\n\nimport numpy as np\nimport tensorflow as tf\n\nHPCP_PATH = \"corpus/bcrm_hpcp_12bin\" # Source directory\nCHKPT_INTERVAL = 50 # How often to create checkpoints\nINPUT_DIMENSION = 12 # Number of HPCP bins\nSEQUENCE_L... | [
[
"tensorflow.clip_by_value",
"tensorflow.nn.dynamic_rnn",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.summary.FileWriter",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.cast",
"tensorflow.placeholder",
"numpy.random.shuffle",
"tensorflow.subtract",
"tensorf... |
kirilkoroves/torchvision-0.3.0 | [
"39f46d141f6a7ac2b094545c33936ad4500d3c7d",
"34d640e5180cc5ab378f84af6ed596cb0c810e6c"
] | [
"torchvision/models/googlenet.py",
"torchvision/datasets/celeba.py"
] | [
"import warnings\nfrom collections import namedtuple\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .utils import load_state_dict_from_url\n\n__all__ = ['GoogLeNet', 'googlenet']\n\nmodel_urls = {\n # GoogLeNet ported from TensorFlow\n 'googlenet': 'https://download.pytorch.org/mo... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.nn.functional.dropout",
"torch.nn.init.constant_",
"scipy.stats.truncnorm",
"torch.nn.Conv2d",
"torch.unsqueeze",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.functional.relu",
... |
generalui/Qcodes-Package | [
"f167b33f9ab562f68783e582561ba915a81efd2b",
"f167b33f9ab562f68783e582561ba915a81efd2b"
] | [
"qcodes/instrument_drivers/tektronix/AWG520.py",
"qcodes/data/hdf5_format.py"
] | [
"# Tektronix_AWG520.py class, to perform the communication between the Wrapper and the device\n# Pieter de Groot <pieterdegroot@gmail.com>, 2008\n# Martijn Schaafsma <qtlab@mcschaafsma.nl>, 2008\n# Vishal Ranjan, 2012\n# Ron schutjens, 2012\n# Adriaan Rol, 2016 Ported to QCodes\n# This program is free software; you... | [
[
"numpy.shape",
"numpy.multiply"
],
[
"numpy.isnan",
"numpy.array"
]
] |
SwetaSengupta/lambdata-SwetaSengupta | [
"a3f679f2cabb706b0c770f0cf9aebe57df7dcc59"
] | [
"my_lambdata/my_script.py"
] | [
"#my script.py\r\n\r\nfrom pandas import DataFrame\r\n#from my_mod import enlarge #this works\r\nfrom my_lambdata.my_mod import enlarge\r\n\r\nprint(\"Hello\")\r\n\r\ndf = DataFrame({\"a\":[1,2,3],\"b\":[4,5,6]})\r\nprint(df.head())\r\nx = 11\r\nprint(enlarge(x))\r\n"
] | [
[
"pandas.DataFrame"
]
] |
grace-mengke-hu/TRIANGULUM | [
"2c4c7c0e67f5fcbbd2cb0934839bb2784b80d47b"
] | [
"Training/CRFannot_6concepts.py"
] | [
"#!../../anaconda2/bin/python\n\nimport re\nimport pickle\nimport reader\nimport RegExp\nimport spacy\nimport CRFfeature\n\nfrom itertools import chain\nimport nltk\nfrom sklearn.metrics import classification_report, confusion_matrix\nfrom sklearn.preprocessing import LabelBinarizer\nimport sklearn\nimport pycrfsui... | [
[
"sklearn.metrics.classification_report",
"sklearn.preprocessing.LabelBinarizer"
]
] |
ljjyxz123/Non-local_pytorch | [
"b7bfd2501083b49f70100588eab8d17d1069aa75"
] | [
"Non-Local_pytorch_0.3.1/lib/non_local_gaussian.py"
] | [
"import torch\r\nfrom torch import nn\r\nfrom torch.nn import functional as F\r\n\r\n\r\nclass _NonLocalBlockND(nn.Module):\r\n def __init__(self, in_channels, inter_channels=None, dimension=3, sub_sample=True, bn_layer=True):\r\n super(_NonLocalBlockND, self).__init__()\r\n\r\n assert dimension in... | [
[
"torch.nn.Sequential",
"torch.nn.functional.softmax",
"torch.zeros",
"torch.randn",
"torch.matmul",
"torch.nn.MaxPool3d",
"torch.nn.MaxPool2d",
"torch.nn.MaxPool1d",
"torch.nn.init.constant"
]
] |
turowicz/triton-inference-server | [
"79fda8ee30343faaca05788b75d4568c954a6b2e",
"79fda8ee30343faaca05788b75d4568c954a6b2e"
] | [
"qa/L0_custom_param/param_test.py",
"qa/L0_unknown_rank/unknown_rank_test.py"
] | [
"#!/usr/bin/python\n\n# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n#... | [
[
"numpy.zeros"
],
[
"numpy.random.random_sample"
]
] |
KroniaPytorch/KroniaModels | [
"8ac6e66771ff24c64a6e4a63d4799b2aba1c95e4"
] | [
"CottonDisease/CottonModel.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass CottonTypeModel(nn.Module):\n def __init__(self):\n super().__init__()\n self.conv1 = nn.Conv2d(3,16,3,1)\n self.conv2 = nn.Conv2d(16,32,3,1)\n self.conv3 = nn.Conv2d(32,64,3,1)\n self.conv4 = nn.Con... | [
[
"torch.nn.Linear",
"torch.nn.Conv2d",
"torch.nn.functional.max_pool2d",
"torch.nn.functional.log_softmax"
]
] |
Hummer12007/pytorch-metric-learning | [
"93e6421addc822d7565c64d7ff166d46be757acd"
] | [
"src/pytorch_metric_learning/losses/angular_loss.py"
] | [
"#! /usr/bin/env python3\n\nfrom .base_metric_loss_function import BaseMetricLossFunction\nimport numpy as np\nimport torch\nfrom ..utils import loss_and_miner_utils as lmu\n\nclass AngularLoss(BaseMetricLossFunction):\n \"\"\"\n Implementation of https://arxiv.org/abs/1708.01682\n Args:\n alpha: Th... | [
[
"torch.nn.functional.pairwise_distance",
"numpy.radians",
"torch.sum",
"torch.tan"
]
] |
nosratullah/econophysics | [
"d084abfd0b2a15469a1da6d4f20629ec789e5059"
] | [
"data_reading.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import style\nimport datetime as dt\nimport pandas_datareader.data as web\n\nstyle.use('ggplot')\n\n'''\nstart = dt.datetime(2015,1,1)\nend = dt.datetime(2019,12,31)\ndf = web.DataReader('TSLA', 'yahoo', start, end)\ndf.to_cs... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot2grid",
"matplotlib.style.use"
]
] |
flowmatters/openwater | [
"8c48fc1694f54c2735a7ac451fcce56df498e520"
] | [
"openwater/array_params.py"
] | [
"\nimport numpy as np\n\ndef get_parameter_locations(desc,current):\n result = []\n\n dim_sizes = {}\n current_parameter_idx = 0\n\n for p in desc['Parameters']:\n p_start = current_parameter_idx\n size = 1\n if ('Dimensions' in p) and len(p['Dimensions']):\n for d in p['... | [
[
"numpy.array"
]
] |
mancunian1792/FewSum | [
"c2f9ef0ae7445bdb188b6ceb28e998b3fd12b78e"
] | [
"fewsum/modelling/generators/beamer.py"
] | [
"import torch as T\nfrom torch import Tensor\nfrom mltoolkit.mlmo.utils.helpers.pytorch.data import adjust_tensor_to_beam_size\nfrom mltoolkit.mlutils.helpers.general import merge_dicts\nfrom mltoolkit.mlmo.utils.tools import DecState\nfrom mltoolkit.mlmo.utils.helpers.general import collect_arts\nfrom fewsum.utils... | [
[
"torch.stack",
"torch.arange"
]
] |
ewanlee/ICLR2020-OpenReviewData | [
"81560dad234e9485f35e473607c4101d0012f05a"
] | [
"crawl_data.py"
] | [
"import numpy as np\nimport h5py\nimport string\n\nAFTER_DECISION = False\n\n# Meta data of papers\nclass PaperMeta(object):\n def __init__(self, title, abstract, keyword, rating, url, withdrawn, desk_reject, decision):\n self.title = title # str\n self.abstract = abstract # str\n self.key... | [
[
"numpy.concatenate",
"numpy.mean"
]
] |
Yuri-x/vkit | [
"c583149b860064549694517b67f3b71c50044332"
] | [
"vkit/augmentation/geometric_distortion/mls.py"
] | [
"from typing import Sequence, Tuple\n\nimport numpy as np\nimport attr\n\nfrom vkit.image.type import VImage\nfrom vkit.label.type import VPoint\nfrom .grid_rendering.interface import PointProjector\nfrom .grid_rendering.grid_creator import create_src_image_grid\nfrom .interface import GeometricDistortionImageGridB... | [
[
"numpy.square",
"numpy.expand_dims",
"numpy.asarray",
"numpy.matmul",
"numpy.stack",
"numpy.errstate",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
francismontalbo/attention-is-all-you-need-paper | [
"21ba3e48917da0c6808126d183bece6a9969cfd2"
] | [
"src/train.py"
] | [
"import os\nfrom logging import log\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nimport wandb\nfrom config import configs\nfrom learner import Learner\nfrom scheduler import CustomScheduler\nfrom dataset import get_translation_dataloaders\nfrom callbacks import CheckpointSaver, MoveToDevic... | [
[
"torch.nn.CrossEntropyLoss",
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.cuda.get_device_name"
]
] |
VoVAllen/dgl-lifesci | [
"96895f2bddf255ad326f0bc4e8064bc3ed5c3044"
] | [
"python/dgllife/data/lipophilicity.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n#\n# Lipophilicity from MoleculeNet for the prediction of octanol/water\n# distribution coefficient (logD at pH 7.4) of 4200 compounds\n\nimport pandas as pd\n\nfrom dgl.data.uti... | [
[
"pandas.read_csv"
]
] |
eEcoLiDAR/eEcoLiDAR | [
"f5c4e772e4893f7242ed0b10aa17ac7e693a55a0"
] | [
"laserchicken/io/test_read_ply.py"
] | [
"import os\nimport shutil\nimport unittest\n\nimport numpy as np\nfrom dateutil.parser import parse\nfrom pytest import raises\n\nfrom laserchicken import keys\nfrom laserchicken.io.load import load\n\n\nclass TestReadPly(unittest.TestCase):\n _test_dir = 'TestLoad_dir'\n _test_file_name = 'example.ply'\n ... | [
[
"numpy.array",
"numpy.testing.assert_allclose"
]
] |
MPCAICDM/MPCA | [
"c996435a0578ea4160f934bc01041c2ef23468f3",
"c996435a0578ea4160f934bc01041c2ef23468f3",
"c996435a0578ea4160f934bc01041c2ef23468f3"
] | [
"models/LSA_cifar10.py",
"helpers/cae_helper.py",
"models/wrn_pytorch.py"
] | [
"from functools import reduce\nfrom operator import mul\nfrom typing import Tuple\n\nimport torch\nimport torch.nn as nn\n\nfrom models.blocks.LSA_blocks import DownsampleBlock, UpsampleBlock, ResidualBlock\nfrom models.blocks.estimator_1D import Estimator1D\n\n\nclass Encoder(nn.Module):\n \"\"\"\n CIFAR10 m... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.Conv2d",
"torch.nn.Tanh",
"torch.nn.Linear",
"torch.nn.LeakyReLU"
],
[
"sklearn.ensemble.IsolationForest",
"torch.nn.MSELoss",
"torch.cat"
],
[
"torch.nn.Sequential",
"torch.nn.Softmax",
"torch.nn.functional.dropout",
"torch... |
johnolafenwa/TorchFusion-Utils | [
"518ea86cc3113bbcfbed5f16467deab398c6bd5c"
] | [
"torchfusion_utils/models/models.py"
] | [
"#TO DO : SUMMARY, ONNX EXPORT, LIBTORCH EXPORT, LOADING, SAVING\n\nfrom torch.nn.parallel.data_parallel import DataParallel\nimport torch\nimport torch.nn as nn\nimport copy\nfrom ..fp16.fp16 import MultiSequential,Convert\nfrom collections import namedtuple\nimport os\n\n\ndef save_model(model,path,save_architect... | [
[
"torch.save",
"torch.load"
]
] |
MartinThoma/PyBioMed | [
"9cac23d0958fd20040b38d5435ef1ff5d5c2cd13"
] | [
"PyBioMed/PyMolecule/basak.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) 2016-2017, Zhijiang Yao, Jie Dong and Dongsheng Cao\n# All rights reserved.\n# This file is part of the PyBioMed.\n# The contents are covered by the terms of the BSD license\n# which is included in the file license.txt, found at the root\n# of the PyBioMed source tree... | [
[
"numpy.array",
"numpy.log2",
"numpy.zeros",
"numpy.unique"
]
] |
shenbai/tradesafe | [
"b6bb843288f535d7d146426fd40750f7484a16e6"
] | [
"org/tradesafe/data/DataFether.py"
] | [
"# coding:utf-8\n\nfrom datetime import datetime, timedelta\n# from urllib import Request, urlopen\nfrom urllib import request\n\nimport demjson\nimport pandas as pd\nimport tushare as ts\nfrom pandas.io import sql\n\nfrom org.tradesafe.bt.log import logging as log\nfrom org.tradesafe.conf import config\nfrom org.t... | [
[
"pandas.read_sql_query",
"pandas.io.sql.to_sql",
"pandas.DataFrame"
]
] |
The-very-most-awesome-team-of-cool-kids/02463_Active_Learning | [
"abc35a31996de1c2e3275cf946b6a44f62abb781"
] | [
"AL_scripts/dataloader.py"
] | [
"import numpy as np\nimport torch\nfrom torchvision import datasets, transforms\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nfrom LOAD_XRAY import concat_, zeropad, Dataload as concat_, zeropad, Dataload\nimport os\n\n\ndef get_dataset(name):\n \"\"\"\n Gets data set:\n -------------------... | [
[
"numpy.reshape",
"torch.from_numpy",
"numpy.concatenate",
"numpy.shape",
"numpy.array"
]
] |
deligentfool/SIDE | [
"561fc6c5312906fd2073af043c2c17ec4ea3758d"
] | [
"src/envs/starcraft2/starcraft2.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom envs.multiagentenv import MultiAgentEnv\nfrom smac.env.starcraft2.maps import get_map_params\n\nimport atexit\nfrom operator import attrgetter\nfrom copy import deepcopy\nimport numpy as np\nimpor... | [
[
"numpy.eye",
"numpy.array",
"numpy.zeros",
"numpy.append"
]
] |
LucaZampieri/pyvista | [
"ae2a7a0559961839c5aa2979228fcdef1f4b188e"
] | [
"examples/00-load/create-structured-surface.py"
] | [
"\"\"\"\n.. _ref_create_structured:\n\nCreating a Structured Surface\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCreate a StructuredGrid surface from NumPy arrays\n\"\"\"\n\n# sphinx_gallery_thumbnail_number = 2\nimport pyvista as pv\nfrom pyvista import examples\nimport numpy as np\n\n\n#####################################... | [
[
"numpy.sqrt",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"numpy.arange",
"numpy.vstack",
"numpy.sin",
"numpy.random.uniform",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axis",
"numpy.exp",
"matplotlib.pyplot.xlabel",
"numpy.meshgrid",
"matplotlib.pyplot.... |
zheedong/Stanford_CS231n_assignment_2017 | [
"4b333d48aabd6192dafd3725fed55546b8871df6"
] | [
"assignment1/cs231n/classifiers/fc_net.py"
] | [
"from builtins import range\nfrom builtins import object\nimport numpy as np\n\nfrom ..layers import *\nfrom ..layer_utils import *\n\n\nclass TwoLayerNet(object):\n \"\"\"\n A two-layer fully-connected neural network with ReLU nonlinearity and\n softmax loss that uses a modular layer design. We assume an ... | [
[
"numpy.random.normal",
"numpy.sum"
]
] |
jeanphilippemercier/microquake | [
"0b9d07be11eddd64619e46939c320487531602a3"
] | [
"microquake/clients/ims/web_client.py"
] | [
"# -*- coding: utf-8 -*-\n# ------------------------------------------------------------------\n# Filename: rest_api.py\n# Purpose: module to interact with the IMS RESTAPI\n# Author: microquake development team\n# Email: devs@microquake.org\n#\n# Copyright (C) 2016 microquake development team\n# -------------... | [
[
"numpy.isnan",
"numpy.arange",
"numpy.vstack",
"numpy.ndarray",
"numpy.linalg.norm",
"numpy.arccos",
"numpy.arctan2",
"numpy.diff",
"numpy.interp",
"numpy.array",
"numpy.where",
"numpy.zeros"
]
] |
TrueNobility303/Raphael-style-transfer-CNN | [
"ebffc635701d9966ab68c261f3fa0ce8f831e395",
"ebffc635701d9966ab68c261f3fa0ce8f831e395"
] | [
"net/gan.py",
"net/swap.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n# for GAN, REF is also my github: https://github.com/TrueNobility303/GAN-face-generator\n\n# implement of cycle GAN\n# 也可视为一种跨域操作,使用GAN从A域跨到B域\n\n#使用instance norm代替BN\ndef Conv(n_input, n_output, k_size=4, stride=2, padding=0, bn=False):\n... | [
[
"torch.nn.Dropout",
"torch.nn.ConvTranspose2d",
"torch.nn.Conv2d",
"torch.nn.Sigmoid",
"torch.nn.InstanceNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.ReLU"
],
[
"torch.nn.functional.conv_transpose2d",
"torch.sigmoid",
"torch.nn.ReflectionPad2d",
"torch.nn.functional.con... |
ShellyDong/AlphaGo | [
"04bac9c9d16c16c3baf16988ac761903a687d4de"
] | [
"tests/test_policy.py"
] | [
"import os\nimport unittest\nimport numpy as np\nfrom AlphaGo import go\nfrom AlphaGo.go import GameState\nfrom AlphaGo.models.policy import CNNPolicy, ResnetPolicy\nfrom AlphaGo.ai import GreedyPolicyPlayer, ProbabilisticPolicyPlayer\n\n\nclass TestCNNPolicy(unittest.TestCase):\n\n def test_default_policy(self)... | [
[
"numpy.all"
]
] |
DiceDn/XgbTest | [
"7e32a5adf9c27608518264caf93bc6b723ce0168"
] | [
"test/venv/Lib/site-packages/sklearn/compose/_column_transformer.py"
] | [
"\"\"\"\nThe :mod:`sklearn.compose._column_transformer` module implements utilities\nto work with heterogeneous data and to apply different transformers to\ndifferent columns.\n\"\"\"\n# Author: Andreas Mueller\n# Joris Van den Bossche\n# License: BSD\nfrom __future__ import division\n\nfrom itertools impor... | [
[
"numpy.hstack",
"scipy.sparse.issparse",
"numpy.arange",
"numpy.issubdtype",
"scipy.sparse.hstack",
"numpy.zeros"
]
] |
charlesastaylor/qiskit-terra | [
"8670669171bae8d619b6eaee6d08f8630e99f012"
] | [
"qiskit/quantum_info/states/_states.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 2017, IBM.\n#\n# This source code is licensed under the Apache License, Version 2.0 found in\n# the LICENSE.txt file in the root directory of this source tree.\n\n# pylint: disable=invalid-name,anomalous-backslash-in-string\n\n\"\"\"\nA collection of useful quantum informatio... | [
[
"numpy.log",
"numpy.random.random",
"numpy.sqrt",
"numpy.exp",
"numpy.zeros"
]
] |
rosdyana/Efflux-ATP-Binding | [
"7ed591e00946301f900574faba6fda8b7ee812fc"
] | [
"resnet18.py"
] | [
"import tensorflow as tf # uncomment this for using GPU\nimport os\nos.environ[\"CUDA_DEVICE_ORDER\"] = \"PCI_BUS_ID\"\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\nconfig = tf.ConfigProto()\nconfig.gpu_options.allow_growth = True\nsess = tf.Session(config=config)\n\n\nimport math\nimport json\nimport sys\n\nimpo... | [
[
"pandas.read_csv",
"numpy.random.seed",
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.roc_curve",
"tensorflow.ConfigProto",
"numpy.append",
"numpy.argmax",
"tensorflow.Session",
"sklearn.metrics.auc",
"sklearn.metrics.classification_report"
]
] |
foamliu/Visual-Question-Answering | [
"f1714f7a2fd5dd66f6c9d5c4e51ece787112b9bc"
] | [
"config.py"
] | [
"import torch\n\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\n# Configure models\nim_size = 448\nhidden_size = 512\n\n# Configure training/optimization\nprint_freq = 100\nbatch_size = 64\nteacher_forcing_ratio = 0.5\nclip = 50.0\n\nPAD_token = 0\nEOS_token = 1\nSOS_token = 2\n\ntra... | [
[
"torch.cuda.is_available"
]
] |
SKFnordquist/permute | [
"e2b13ed7d5508c65af81d59f158929afbc5419bc"
] | [
"permute/tests/test_irr.py"
] | [
"from __future__ import (absolute_import, division,\n print_function, unicode_literals)\n\nfrom nose.plugins.attrib import attr\nfrom nose.tools import raises\n\nimport numpy as np\nfrom numpy.testing import (assert_equal,\n assert_almost_equal)\n\nfrom ..irr import ... | [
[
"numpy.testing.assert_equal",
"numpy.asarray",
"numpy.vstack",
"numpy.testing.assert_almost_equal",
"numpy.array",
"numpy.zeros",
"numpy.random.RandomState"
]
] |
NathanHess6/molecool | [
"b65eeaee1ff085d2b4a0d42f6cbf868a70f10e2f"
] | [
"molecool/measure.py"
] | [
"# have to import because you need it!\nimport numpy as np\n\ndef calculate_distance(pointA, pointB):\n \"\"\"\n This function calculates the distance between two points.\n\n Parameters\n ----------\n pointA, pointB: np.ndarray\n The coordinates of each point.\n\n Returns\n -------\n ... | [
[
"numpy.dot",
"numpy.degrees",
"numpy.linalg.norm"
]
] |
mryab/efficient-dl-systems | [
"847bc8fc73357d45fb653b40c3232a02778a55a2"
] | [
"week09_experiment_tracking/example_project/compute_metrics.py"
] | [
"import json\nfrom argparse import ArgumentParser\n\nimport torch\nimport torchvision.transforms as transforms\nimport wandb\nfrom torchvision.datasets import CIFAR10\nfrom torchvision.models import resnet18\n\nfrom hparams import config\n\n\ndef main(args):\n api = wandb.Api()\n run = api.run(f\"mryab/effdl_... | [
[
"torch.load",
"torch.utils.data.DataLoader",
"torch.inference_mode",
"torch.device",
"torch.argmax"
]
] |
tsvilans/tas | [
"725adfc525d4d896566841328b6b13adf1f28e5e"
] | [
"python/tas/operators/bpy_merge_images_to_scan.py"
] | [
"import bpy\nimport numpy as np\nimport math\nimport os\n\nfrom mathutils import Vector\nfrom .bpy_pcd_convert import pcdInterface\nfrom tas.util import flatten\n\n'''\nsrc_dir: source directory where images are stored\nposition_name: basename (with extension) of position image\ncolor_name: basename (with extension... | [
[
"numpy.delete",
"numpy.array"
]
] |
NLPrinceton/ALaCarte | [
"abe082f049633cc8dd958945e77bcd90fcda2946"
] | [
"compute.py"
] | [
"import sys\nfrom collections import Counter\nfrom collections import defaultdict\nfrom itertools import chain\nimport nltk\nimport numpy as np\nfrom scipy import sparse as sp\nfrom sklearn.linear_model import LinearRegression as LR\n\n\nFLOAT = np.float32\nINT = np.int32\n\n\ndef ngram_context(strdoc, intdoc, voca... | [
[
"scipy.sparse.coo_matrix",
"numpy.array",
"scipy.sparse.csr_matrix"
]
] |
kienduynguyen/BoxeR | [
"a7d9456141e9fb4f6da53c961bda54886024ee75"
] | [
"e2edet/module/box3d_transformer.py"
] | [
"import math\n\nimport torch\nfrom torch import nn\n\nfrom .box_attention import Box3dAttention\nfrom e2edet.utils.general import (\n flatten_with_shape,\n inverse_sigmoid,\n get_clones,\n get_activation_fn,\n get_proposal_pos_embed,\n normalize_period,\n)\n\n\nclass Box3dTransformer(nn.Module):\n... | [
[
"torch.nn.Dropout",
"torch.nn.MultiheadAttention",
"torch.cat",
"torch.gather",
"torch.arange",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.FloatTensor",
"torch.nn.init.xavier_uniform_",
"torch.topk",
"torch.meshgrid",
"torch.ones_like",
"torch.stack"
]
] |
UTHSCSA-NAL/shrinkage | [
"388c35e21fb7dfdccb272533712b97f8e01e4581"
] | [
"OASchart.py"
] | [
"import os\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n################################################################################\r\n\r\n# compute OAS intensity, \"tr\" denoting the squared Frobenius norm of the matrix: Tr(S*S)\r\ndef shrinkage(n,p,tr):\r\n\treturn min(1.0, ( (1.0-2.0/p)*... | [
[
"numpy.diag",
"matplotlib.pyplot.axes",
"numpy.max",
"numpy.mean",
"numpy.exp",
"numpy.eye",
"numpy.log",
"numpy.min",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"numpy.transpose",
"numpy.argsort",
"numpy.sum",
"matplotlib.pyplot.xticks",
"... |
sbenthall/pycid | [
"114e1fdcd4bf97c99ca5718fe5a66bcef41a6baf"
] | [
"pycid/examples/story_macids.py"
] | [
"import numpy as np\nfrom pgmpy.factors.discrete import TabularCPD\n\nfrom pycid.core.cpd import noisy_copy\nfrom pycid.core.macid import MACID\n\n\ndef prisoners_dilemma() -> MACID:\n \"\"\"MACIM representation of the canonical prisoner's dilemma.\n\n The prisoner's dilemma is a simultaneous symmetric two-pl... | [
[
"numpy.array",
"numpy.transpose"
]
] |
lollcat/Aspen-RL | [
"0abefb9e7def7762e829ac4d621519d9d01592c0"
] | [
"hydrocarbon_problem/env/env_test.py"
] | [
"import numpy as np\nimport time\n\nfrom hydrocarbon_problem.api.api_base import BaseAspenDistillationAPI\nfrom hydrocarbon_problem.env.env import AspenDistillation\n\n\ndef make_fake_agent(env: AspenDistillation):\n def fake_agent(obs):\n del(obs)\n discrete_spec, continuous_spec = env.action_spec... | [
[
"numpy.random.uniform",
"numpy.average",
"numpy.random.randint"
]
] |
mykolakozyr/stacviewer | [
"a5d1029aec9c428a7ce7ae615621ea8915162824"
] | [
"app.py"
] | [
"import streamlit as st\n\nimport pandas as pd\nimport itertools\nimport geopandas as gpd\n\nfrom lib.streamlit_keplergl import keplergl_static\nfrom keplergl import KeplerGl\n\nfrom shapely.geometry import shape\nfrom pystac_client import Client, exceptions\nfrom pystac import catalog\n\nMAP_EMOJI_URL = \"https://... | [
[
"pandas.DataFrame"
]
] |
amoodie/rain-table_jeffskwang | [
"a378a24f2c239e5b8076a864e7f924c3c6397185"
] | [
"rain_table/utils.py"
] | [
"\nfrom matplotlib.colors import LinearSegmentedColormap\n\ndef terrain_cmap():\n cdict = {'red': ((0, 0.2, 0.2),\n (0.125, 0.50588, 0.50588),\n (0.25, 1, 1),\n (0.5, 0.95686, 0.95686),\n ... | [
[
"matplotlib.colors.LinearSegmentedColormap"
]
] |
TheMightyDotkey/vibhat | [
"80beaabfefd2059021eb4bb6abfd0a83e1b71e68"
] | [
"_pytorch/ML_Test.py"
] | [
"\nprint('test')\n\nfrom io import StringIO\nfrom os.path import dirname, join as pjoin\nimport numpy as np\nimport scipy.io as sp\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\ndef datasetmaker(offset, matfilename):\n \"\"\"offset is multiple of 256 matfile name is output name\"\"\"\n\n #Computes F... | [
[
"pandas.read_csv",
"numpy.fft.fft",
"numpy.arange",
"matplotlib.pyplot.plot",
"numpy.savetxt",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
kasramvd/Rexy | [
"1e50dd877cf254984c34cb0f7e98fa663143d13b"
] | [
"Rexy/Administration/visualizer.py"
] | [
"\"\"\"Contains the respective visualization tasks.\"\"\"\nimport mpld3\nimport matplotlib.pyplot as plt\n\n\nclass Visualizer:\n def __init__(self, *args, **kwargs):\n pass\n\n def pie_plot(self, **kwargs):\n\n fig1, ax1 = plt.subplots()\n ax1.pie(kwargs['sizes'],\n explod... | [
[
"matplotlib.pyplot.subplots"
]
] |
arunsechergy/AgentVision2 | [
"f954811a19d5b9e4b4c94b4c1f9d7b3a38c6934e"
] | [
"src/agentvision/midas/midas/midas_net.py"
] | [
"\"\"\"MidashNet: Network for monocular depth estimation trained by mixing several datasets.\nThis file contains code that is adapted from\nhttps://github.com/thomasjpfan/pytorch_refinenet/blob/master/pytorch_refinenet/refinenet/refinenet_4cascade.py\n\"\"\"\nimport torch\nimport torch.nn as nn\n\nfrom .base_model ... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.Identity",
"torch.squeeze"
]
] |
Dazz993/AlphaPose | [
"d4b9a3af5f590fa21bd033b4a19e98b5748ae683"
] | [
"alphapose/utils/writer.py"
] | [
"import os\nimport time\nfrom threading import Thread\nfrom queue import Queue\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.multiprocessing as mp\n\nfrom alphapose.utils.transforms import get_func_heatmap_to_coord\nfrom alphapose.utils.pPose_nms import pose_nms\n\nDEFAULT_VIDEO_SAVE_OPT = {\n 's... | [
[
"torch.multiprocessing.Queue",
"torch.cat",
"torch.from_numpy",
"numpy.array",
"torch.multiprocessing.Process"
]
] |
bruinxiong/mesh-1 | [
"a1259b927dc34eb16251b33a62bc9fed112893f9"
] | [
"mesh_tensorflow/simd_mesh_impl.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Mesh TensorFlow Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.compat.v1.logging.warning",
"tensorflow.compat.v1.group",
"tensorflow.python.tpu.ops.tpu_ops.cross_replica_sum",
"tensorflow.compat.v1.to_bfloat16",
"tensorflow.compat.v1.reshape",
"tensorflow.compat.v1.einsum",
"tensorflow.compat.v1.one_hot",
"tensorflow.python.tpu.ops... |
Laetus/autonomous-drive-simulator | [
"4fbb10bfe393914e2d1dcee437f34c20c57ae34b"
] | [
"util.py"
] | [
"#!/usr/bin/env python3.5\n\"\"\"Simple autonomous drive simulator\"\"\"\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\nplt.rcParams['animation.ffmpeg_path'] = '/usr/bin/ffmpeg'\n\n\ndef kmh2ms(v_in_kmph):\n \" convert velocity from km/h... | [
[
"matplotlib.pyplot.title",
"numpy.linspace",
"matplotlib.pyplot.figure",
"matplotlib.animation.FuncAnimation",
"numpy.transpose",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.ylabel"
]
] |
MinhTran0311/imgaug_Minh | [
"0266ef52d61a3a892009ae5718fd5d41d8156d6a",
"0266ef52d61a3a892009ae5718fd5d41d8156d6a"
] | [
"imgaug/augmenters/weather.py",
"test/augmenters/test_geometric.py"
] | [
"\"\"\"\nAugmenters that create weather effects.\n\nList of augmenters:\n\n * :class:`FastSnowyLandscape`\n * :class:`CloudLayer`\n * :class:`Clouds`\n * :class:`Fog`\n * :class:`SnowflakesLayer`\n * :class:`Snowflakes`\n * :class:`RainLayer`\n * :class:`Rain`\n\n\"\"\"\nfrom __future__ impo... | [
[
"numpy.maximum",
"numpy.clip",
"numpy.tile",
"numpy.zeros",
"numpy.sum"
],
[
"numpy.sqrt",
"numpy.linspace",
"numpy.dtype",
"numpy.all",
"numpy.max",
"numpy.round",
"numpy.any",
"numpy.allclose",
"numpy.pad",
"numpy.clip",
"numpy.fliplr",
"nu... |
StevePhan97/depth-estimation | [
"5500ea4b415ee9eef20ccb78a906dea577bde773"
] | [
"dataloaders/dataloader.py"
] | [
"import os\nimport os.path\nimport numpy as np\nimport torch.utils.data as data\nimport h5py\nimport dataloaders.transforms as transforms\n\ndef h5_loader(path, tranpose=False):\n h5f = h5py.File(path, \"r\")\n rgb = np.array(h5f['rgb'])\n rgb = np.transpose(rgb, (1, 2, 0))\n depth = np.array(h5f['depth... | [
[
"numpy.array",
"numpy.transpose"
]
] |
objectiv/objectiv-analytics | [
"86ec1508f71c2d61ea7d67479800e4dc417a46e1",
"86ec1508f71c2d61ea7d67479800e4dc417a46e1"
] | [
"modelhub/tests_modelhub/functional/modelhub/logistic_regression_test_utils.py",
"bach/tests/functional/bach/test_df_scale.py"
] | [
"\"\"\"\nCopyright 2021 Objectiv B.V.\n\"\"\"\n\n# Any import from modelhub initializes all the types, do not remove\n\n\n\nfrom typing import Iterable\nimport bach\nfrom sklearn.linear_model import LogisticRegression\nfrom modelhub import ModelHub\nimport numpy as np\n\n\nclass TestLR:\n \"\"\"\n Tests if mo... | [
[
"numpy.where",
"sklearn.linear_model.LogisticRegression",
"numpy.isclose"
],
[
"numpy.var",
"sklearn.preprocessing.StandardScaler",
"numpy.mean",
"sklearn.preprocessing.MinMaxScaler"
]
] |
mkcor/covid-dashboard | [
"d4b2d6e15400a5f2ad729d0d38ace15f1c01c1bf"
] | [
"make_figures.py"
] | [
"\"\"\"\nUtility functions to generate plotly figures from dataframe. Called in app.py\n\"\"\"\n\nimport plotly.graph_objects as go\nimport plotly.express as px\nimport numpy as np\nimport pandas as pd\nimport plotly.io as pio\nfrom plotly.validators.scatter.marker import SymbolValidator\n\nfrom data_input import n... | [
[
"numpy.log10",
"pandas.DateOffset"
]
] |
enric1994/PseudoLabeling | [
"f3122ae40773e40f4e9ff2e51b7e7daf7c6bb38d"
] | [
"utils_pseudoLab/TwoSampler.py"
] | [
"# Code obtained from:\n# https://github.com/CuriousAI/mean-teacher/blob/bd4313d5691f3ce4c30635e50fa207f49edf16fe/pytorch/mean_teacher/data.py\n\nimport itertools\nimport logging\nimport os.path\n\nfrom PIL import Image\nimport numpy as np\nfrom torch.utils.data.sampler import Sampler\n\n\n\nclass TwoStreamBatchSam... | [
[
"numpy.random.permutation"
]
] |
Stonen2/MachineLearning | [
"f886c28876b7226d46ce4465c70b88a0f2fffa4e"
] | [
"Project_4/GAParallel.py"
] | [
"# this is the parallelized version of GA.py. Parallelized by Matteo Bjornsson, original code written by Nick Stone\n################################################################################\n\nimport random\nimport Performance\nfrom NeuralNetwork import NeuralNetwork\nimport DataUtility\nimport numpy as np\... | [
[
"numpy.concatenate",
"numpy.random.uniform",
"numpy.array"
]
] |
BUVANEASH/AdaConv | [
"2e714b47f1e4051e3f7b58bbee00052404e51f6a"
] | [
"styletransfer/conv.py"
] | [
"import tensorflow as tf\n\nclass Conv2D(tf.keras.layers.Layer):\n \"\"\" Conv2D\n \"\"\"\n def __init__(self, **kwargs):\n super(Conv2D, self).__init__(name = kwargs.get('name','Conv2D'))\n self.filters = kwargs.get('filters')\n self.kernels = kwargs.get('kernels',3)\n self.str... | [
[
"tensorflow.keras.layers.Conv2D",
"tensorflow.constant",
"tensorflow.pad",
"tensorflow.nn.depth_to_space"
]
] |
johncoltrane1/saferGPMLE | [
"b86fbd329eaad0b6374a1b28cae43b2a7f81eb61"
] | [
"safergpy/code/report/nll_boxplot.py"
] | [
"import matplotlib.pyplot as plt\nimport os\nimport pandas as pd\nimport numpy as np\nimport sys\n\n\n# --- README ---\n\n'''\nThis script generates boxplots for NLL differences of default & healed\nas obtained with LOO\n'''\n\n# --- To Run ---\n\n'''\nSyntax :\n\npython nll_boxplot.py bench_num scheme1 scheme2 dat... | [
[
"matplotlib.pyplot.title",
"numpy.isnan",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel"
]
] |
Gustoaxel/Clinic_Image_autoencoder | [
"cb360f80525b22e412bc5e6d6e03d7725cd0d357"
] | [
"src/testMaskClassi.py"
] | [
"import os\nos.environ[\"KMP_DUPLICATE_LIB_OK\"]=\"TRUE\"\n\nimport yaml\nimport argparse\nfrom pathlib import Path\n\nimport numpy as np\nimport torch as T\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\n... | [
[
"torch.abs",
"torch.sign",
"torch.cat",
"sklearn.manifold.TSNE",
"torch.no_grad",
"torch.utils.tensorboard.SummaryWriter",
"torch.cuda.is_available",
"torch.get_default_dtype",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"torch.zeros_like",
"torch.is_tens... |
rashibudati/Text-Classification-using-AGGCN | [
"d64e9c9ffbd9d36f692bb003a910ce4c66d0050c"
] | [
"prepare_vocab.py"
] | [
"\"\"\"\nPrepare vocabulary and initial word vectors.\n\"\"\"\nimport json\nimport pickle\nimport argparse\nimport numpy as np\nfrom collections import Counter\n\nfrom utils import vocab, constant, helper\n\ndef parse_args():\n parser = argparse.ArgumentParser(description='Prepare vocab for relation extraction.'... | [
[
"numpy.save"
]
] |
Menigedegna/Image-processing | [
"38b8b60c2ee7f6386136105c9541c5a905aab55a"
] | [
"XTSegment_nucleus.py"
] | [
"# ==============================================================================\r\n#\r\n# <CustomTools>\r\n# <Menu>\r\n# <Item name=\"XTSegment_nucleus\" icon=\"Python\" tooltip=\"XTSegment_nucleus\">\r\n# <Command>PythonXT::XTSegment_nucleus(%i)</Command>\r\n# </Item>\r\n# </Menu... | [
[
"pandas.read_csv"
]
] |
elybrand/neurodsp | [
"96355f4c75e1eedef2a77a8bfafc718f80b8dae3"
] | [
"neurodsp/plts/time_series.py"
] | [
"\"\"\"Plots for time series.\"\"\"\n\nfrom itertools import repeat, cycle\n\nimport numpy as np\nimport numpy.ma as ma\nimport matplotlib.pyplot as plt\n\nfrom neurodsp.plts.style import style_plot\nfrom neurodsp.plts.utils import check_ax, savefig\n\n###############################################################... | [
[
"matplotlib.pyplot.yticks",
"numpy.invert"
]
] |
Ewpratten/frc_971_mirror | [
"3a8a0c4359f284d29547962c2b4c43d290d8065c",
"3a8a0c4359f284d29547962c2b4c43d290d8065c"
] | [
"frc971/control_loops/python/haptic_wheel.py",
"frc971/analysis/plot_test.py"
] | [
"#!/usr/bin/python\n\nfrom frc971.control_loops.python import control_loop\nfrom frc971.control_loops.python import controls\nimport numpy\nimport sys\nimport copy\nimport scipy.interpolate\nfrom matplotlib import pylab\n\nimport gflags\nimport glog\n\nFLAGS = gflags.FLAGS\n\ngflags.DEFINE_bool('plot', False, 'If t... | [
[
"numpy.matrix",
"matplotlib.pylab.show",
"numpy.log10",
"matplotlib.pylab.subplots",
"numpy.zeros"
],
[
"matplotlib.use"
]
] |
joe733/client | [
"5e6758129a5557fd478d1cf2f46b4b7279ef6d04"
] | [
"tests/test_data_types.py"
] | [
"import wandb\nfrom wandb import data_types\nimport numpy as np\nimport pytest\nimport PIL\nimport os\nimport six\nimport sys\nimport glob\nimport platform\nfrom click.testing import CliRunner\nfrom . import utils\nfrom .utils import dummy_data\nimport matplotlib\nimport rdkit.Chem\nfrom wandb import Api\nimport ti... | [
[
"numpy.random.random",
"numpy.histogram",
"matplotlib.use",
"pandas.DataFrame",
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
tom-doerr/lingvo | [
"2441edc7fee78903502ebd528ab4dc309db0001d"
] | [
"lingvo/core/base_model.py"
] | [
"# Copyright 2018 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.logging.warning",
"tensorflow.control_dependencies",
"tensorflow.colocate_with",
"tensorflow.logging.debug",
"tensorflow.reduce_sum",
"tensorflow.train.ExponentialMovingAverage",
"tensorflow.moving_average_variables",
"tensorflow.nest.flatten",
"tensorflow.to_int32"... |
fitnesswanderer/Disaster_Alerts | [
"5eb8fb9204ad4e47167c2455fe99ae7d1576fb54"
] | [
"app/run.py"
] | [
"import json\nimport plotly\nimport pandas as pd\n\nfrom nltk.stem import WordNetLemmatizer\nfrom nltk.tokenize import word_tokenize\n\nfrom flask import Flask\nfrom flask import render_template, request, jsonify\nfrom plotly.graph_objs import Bar\nfrom sklearn.externals import joblib\nfrom sqlalchemy import create... | [
[
"pandas.read_sql_table",
"sklearn.externals.joblib.load"
]
] |
m13uz/FLAML | [
"99de9204b3d92703f1afc0773e6d4441b5c14348"
] | [
"test/nlp/test_autohf_custom_metric.py"
] | [
"import sys\nimport pytest\n\n\ndef custom_metric(\n X_test,\n y_test,\n estimator,\n labels,\n X_train,\n y_train,\n weight_test=None,\n weight_train=None,\n config=None,\n groups_test=None,\n groups_train=None,\n):\n from datasets import Dataset\n from flaml.model import Tra... | [
[
"pandas.DataFrame"
]
] |
BoevaLab/scCanSig | [
"bbf6de268d0a2eb2ea499253c9e71fecc06f34ea"
] | [
"cansig/filesys.py"
] | [
"\"\"\"This module controls the directory structure used to save the results.\"\"\"\nimport abc\nimport datetime\nimport json\nimport pathlib\nfrom typing import Any, Callable, TypeVar\n\nimport pandas as pd # pytype: disable=import-error\nimport petname # pytype: disable=import-error\nimport pydantic # pytype: ... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
theRealSuperMario/lmdis-rep | [
"2373877eb75b26e5fec5a3a143eff2f7f7c07c41"
] | [
"nets/data/pennaction_128x128.py"
] | [
"import os\nimport cv2\nimport numpy as np\nimport json\nimport time\nimport threading\nimport random\nfrom multiprocessing.dummy import Pool\nfrom multiprocessing import cpu_count\nimport scipy.io as sio\nimport pandas as pd\n\n\nclass Net:\n def __init__(self, subset_name=\"train\", options=None):\n\n s... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
ywen666/code-transformer | [
"66ef3c93a4abf802d12ab9bfd7bdf487202924e9"
] | [
"code_transformer/experiments/mixins/great_transformer.py"
] | [
"from abc import ABC\n\nfrom torch.nn import CrossEntropyLoss\n\nfrom code_transformer.configuration.great_transformer import GreatTransformerConfig, GreatEncoderConfig\nfrom code_transformer.configuration.transformer_lm_decoder import TransformerLMDecoderConfig\nfrom code_transformer.experiments.experiment import ... | [
[
"torch.nn.CrossEntropyLoss"
]
] |
jyjen/helpers | [
"3a4914fcc7d80e13141c0ce15a39148d665d1b2e"
] | [
"df_str_helpers.py"
] | [
"import pandas as pd\nimport re\nimport spacy\nimport str_helpers as strh\nimport nltk\n# nltk.download('punkt')\n\n#? class Process\ndef split_sents_df(df: pd.core.frame.DataFrame,\n sent_col: str,\n segmenter: str):\n\n \"\"\"Splits sentences in a DataFrame and stacks the se... | [
[
"pandas.concat"
]
] |
kjappelbaum/pyepal | [
"006be9440c3fcff223b1b2a3f98222d732c60a48"
] | [
"pyepal/pal/pal_gpy.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2020 PyePAL authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required... | [
[
"numpy.hstack"
]
] |
DavideConficconi/dovado | [
"60abf088d301cbb96660238a4f39ea2fe5cbbb18"
] | [
"graph_generation/ndovadomo_charts.py"
] | [
"from datetime import date\nfrom locale import normalize\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.rcsetup as rcsetup\nimport numpy as np\nimport pandas as pd\nimport sys\nimport getopt\nimport math\nimport itertools\nimport os\nimport re\nimport argparse\nimport traceback\nimport compu... | [
[
"numpy.log2",
"numpy.linspace",
"numpy.arange",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.append",
"matplotlib.pyplot.close",
"numpy.flip"
]
] |
SUTDBrainLab/MGP-VAE | [
"0b7c252f9f7bdcdf3c4177ac40585633a0e98a0f"
] | [
"create_data/create_moving_mnist_data.py"
] | [
"from PIL import Image\nimport sys\nimport os\nimport math\nimport numpy as np\n\n###########################################################################################\n# script to generate moving mnist video dataset (frame by frame) as described in\n# [1] arXiv:1502.04681 - Unsupervised Learning of Video Rep... | [
[
"numpy.product",
"numpy.savez",
"numpy.asarray",
"numpy.random.rand",
"numpy.float32",
"numpy.zeros",
"numpy.empty",
"numpy.random.randint"
]
] |
cuent/pytorch-lightning | [
"fde972ffc2cdca3fccb904d29c2f1c32963fcd72"
] | [
"pl_examples/domain_templates/generative_adversarial_net.py"
] | [
"\"\"\"\nTo run this template just do:\npython generative_adversarial_net.py\n\nAfter a few epochs, launch TensorBoard to see the images being generated at every batch:\n\ntensorboard --logdir default\n\"\"\"\nimport os\nfrom argparse import ArgumentParser, Namespace\n\nimport numpy as np\nimport torch\nimport torc... | [
[
"torch.nn.BatchNorm1d",
"torch.zeros",
"torch.randn",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.utils.data.DataLoader",
"torch.nn.Tanh",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"numpy.prod"
]
] |
XiangwenNing/dgl | [
"5542b7654af326a84edb1d28d050febd06d3dbcd"
] | [
"tests/pytorch/test_dataloader.py"
] | [
"import os\nimport dgl\nimport dgl.ops as OPS\nimport backend as F\nimport unittest\nimport torch\nfrom torch.utils.data import DataLoader\nfrom collections import defaultdict\nfrom collections.abc import Iterator\nfrom itertools import product\nimport pytest\n\n\ndef test_graph_dataloader():\n batch_size = 16\n... | [
[
"torch.FloatTensor",
"torch.equal",
"torch.arange"
]
] |
jeremyephron/forager | [
"6db1590686e0e34b2e42ff5deb70f62fcee73d7d"
] | [
"index_server/containers/clip-text-inference/handler.py"
] | [
"import torch\nimport clip\n\nfrom typing import List\n\nfrom knn import utils\nfrom knn.mappers import Mapper\n\nimport config\n\n\ntorch.set_grad_enabled(False)\ntorch.set_num_threads(1)\n\n\nclass TextEmbeddingMapper(Mapper):\n def initialize_container(self):\n self.model, _ = clip.load(config.CLIP_MOD... | [
[
"torch.no_grad",
"torch.set_grad_enabled",
"torch.set_num_threads"
]
] |
aluscher/torchbeastpopart | [
"1c710dd4c78d24ed73a5732ad7ba14ce578143f2"
] | [
"torchbeast/models/attention_augmented_agent.py"
] | [
"\"\"\"\nAdapted from https://github.com/cjlovering/Towards-Interpretable-Reinforcement-Learning-Using-Attention-Augmented-Agents-Replication\n\"\"\"\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom torchbeast.core.popart import PopArtLayer\n\n\nclass ConvLSTMCell(n... | [
[
"torch.nn.functional.softmax",
"torch.ones",
"torch.chunk",
"torch.nn.LSTM",
"torch.cat",
"torch.zeros",
"torch.nn.Conv2d",
"torch.tanh",
"torch.matmul",
"torch.nn.Linear",
"torch.no_grad",
"torch.arange",
"torch.stack",
"torch.nn.ReLU",
"torch.cos",
... |
15091444119/NJUNMT-pytorch | [
"5d3947578deb5c5c9b0b5967c9010645c0c981d1"
] | [
"src/modules/cgru.py"
] | [
"import torch.nn as nn\n\nfrom src.utils import init as my_init\nfrom .attention import BahdanauAttention\n\nclass CGRUCell(nn.Module):\n\n def __init__(self,\n input_size,\n hidden_size):\n\n super(CGRUCell, self).__init__()\n\n self.hidden_size = hidden_size\n\n ... | [
[
"torch.nn.GRUCell"
]
] |
solvithrastar/Inversionson | [
"a91ffc4cadaf30dc40b6f222e1c3d0bf105d2163"
] | [
"inversionson/components/mesh_comp.py"
] | [
"from __future__ import absolute_import\nfrom typing import NoReturn\nfrom .component import Component\nimport numpy as np\nimport sys\nimport shutil\nfrom pathlib import Path\nimport os\nfrom inversionson import InversionsonError\nfrom salvus.mesh.unstructured_mesh import UnstructuredMesh\nimport h5py\n\n\nclass S... | [
[
"numpy.abs",
"numpy.unique",
"numpy.logical_or",
"numpy.copy",
"numpy.zeros_like",
"numpy.where"
]
] |
Lucieno/gforce-public | [
"cb577ec22f2011d30dbef9dad9545ca1402f875b",
"cb577ec22f2011d30dbef9dad9545ca1402f875b"
] | [
"src/secure_layers.py",
"src/dgk_basic.py"
] | [
"from typing import Callable\n\nimport torch\nimport torch.nn.functional as F\n\nfrom avgpool2x2 import Avgpool2x2Server, Avgpool2x2Client, Avgpool2x2Common\nfrom comm import NamedBase, end_communicate, torch_sync, init_communicate, CommFheBuilder, BlobTorch, CommBase\nfrom config import Config\nfrom conv2d_ntt imp... | [
[
"torch.device",
"torch.nn.MaxPool2d",
"torch.Size",
"torch.zeros"
],
[
"torch.ones",
"torch.zeros",
"torch.clone",
"torch.sum",
"torch.zeros_like",
"torch.tensor",
"torch.rand",
"torch.where"
]
] |
bugchecker/hummingbot | [
"a7544f028b6d8a16a363058ea5f9968dd98dc589"
] | [
"hummingbot/client/command/history_command.py"
] | [
"from decimal import Decimal\n\nimport pandas as pd\nimport threading\nfrom typing import (\n Any,\n Dict,\n Set,\n Tuple,\n TYPE_CHECKING,\n)\nfrom hummingbot.client.performance_analysis import PerformanceAnalysis\nfrom hummingbot.core.utils.exchange_rate_conversion import ExchangeRateConversion\nfr... | [
[
"pandas.DataFrame"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.