repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
trentontemple/fairseq
[ "18cadab1d0fc6a98988a17e92683f8b83b03a177" ]
[ "fairseq/options.py" ]
[ "# 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\nimport argparse\nfrom typing import Callable, List, Optional\n\nimport torch\nfrom fairseq import utils\nfrom fairseq.data.indexed_d...
[ [ "torch.cuda.device_count" ] ]
INK-USC/ConNet
[ "adb299f160556004561df302c19578200bd3835b" ]
[ "crowdsourcing/model_seq/dataset.py" ]
[ "\"\"\"\n.. module:: dataset\n :synopsis: dataset for sequence labeling\n \n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport sys\nimport pickle\nimport random\nimport functools\nimport itertools\nfrom tqdm import tqdm\n\nclass SeqDataset(object):\n \"\"\" \n Datas...
[ [ "torch.LongTensor", "torch.ByteTensor" ] ]
ccberg/LA
[ "df3929c9ab4b7cbfa38749363c5ccced010f3002" ]
[ "src/data/moment_difference.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nfrom scipy.stats import stats\n\nfrom src.tools.poi import select_poi\nfrom src.data.ascad import TraceCategory\n\n\ndef statistical_moment(traces: np.array, moment=1):\n \"\"\"\n Retrieves a statistical moment in a given order for a...
[ [ "scipy.stats.stats.kurtosis", "numpy.array", "numpy.zeros", "scipy.stats.stats.skew", "matplotlib.pyplot.subplots", "numpy.random.shuffle", "matplotlib.pyplot.show", "numpy.array_split" ] ]
Spico197/cnn_one_nyt10
[ "d97d6df42a3ad93b54b33c142072fd18ac359005" ]
[ "data_loader_opennre.py" ]
[ "from six import iteritems\n\nimport json\nimport os\nimport multiprocessing\nimport numpy as np\nimport random\n\nclass file_data_loader:\n def __next__(self):\n raise NotImplementedError\n \n def next(self):\n return self.__next__()\n\n def next_batch(self, batch_size):\n raise No...
[ [ "numpy.concatenate", "numpy.stack", "numpy.load", "numpy.zeros" ] ]
jdhare/turbulence_tracing
[ "26b980befbcbdbee367e3695a40928841f0cd38a" ]
[ "gaussian_fields/mainGen.py" ]
[ "# Main program - Version 1\n# This is an example of how to use the library turboGen.py\n# and cmpspec.py\n# GENERATING 1D-2D-3D GAUSSIAN STOCHASTIC FIELD WITH A GIVEN POWER SPECTRUM AS INPUT\n\n\"\"\"\nAuthor: Stefano Merlini\nCreated: 14/05/2020\n\"\"\"\n\n\n# ____ _ _ __ _ _ ____ __ ____ \n# ( __)(...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.axvline", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.rc", "numpy.arange", "numpy....
RoboBachelor/vehicle_pose_estimation
[ "53f1ff4a70d69256ba10fd2ecee024cf19801b22" ]
[ "lab3.py" ]
[ "import numpy as np\n\nfor i in range(40):\n print(\n np.floor(i / 4).astype(int))" ]
[ [ "numpy.floor" ] ]
bbeatrix/vissl
[ "484cdecd1a71cb457d8ea74942603b907a23d39d" ]
[ "vissl/trainer/trainer_main.py" ]
[ "# 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\nimport gc\nimport itertools\nimport logging\nimport os\nimport socket\nimport time\nfrom typing import Any, Dict, List, Tuple\n\nimpo...
[ [ "torch.nn.Linear", "torch.zeros", "numpy.array", "torch.cat", "torch.distributed.init_process_group", "torch.no_grad", "torch.cuda.current_device", "torch.distributed.is_initialized", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.LongTensor", "torch.di...
ali-nsua/quickRecommender
[ "8a39c2fb9f4c3f2a550f14750103a7850a3e1661" ]
[ "quickrecommender/recommender.py" ]
[ "import numpy as np\nfrom .utils.diversifier import kmeanspp\nfrom .utils.ops import cosine_similarity, softmax, divsum\nfrom .graphs.nearestneighbors import NearestNeighbors\n\n\nclass QuickRecommender:\n \"\"\"\n QuickRecommender\n Creates a content-based model using a nearest-neighbors graph, updates us...
[ [ "numpy.max", "numpy.array", "numpy.ones", "numpy.zeros" ] ]
Weepingchestnut/IMU_lzk_UGP
[ "75033e19cd5b464807f5f52c96f41ffd39e2c7f4" ]
[ "mmseg/models/decode_heads_3090_mmseg/sep_aspp_head_d32_all-fca-att.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nfrom mmcv.cnn import ConvModule, DepthwiseSeparableConvModule\n\nfrom mmseg.ops import resize\nfrom ..builder import HEADS\nfrom .aspp_head import ASPPHead, ASPPModule\n\n\ndef get_freq_indices(method):\n assert method in ['top1','top2','top4','top8','top16','to...
[ [ "torch.zeros", "torch.nn.Linear", "torch.cat", "torch.nn.Sigmoid", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.ReLU", "torch.sum" ] ]
pearpai/TensorFlow-action
[ "264099d933988532ed59eaf0f2ad495d40ede4d2" ]
[ "deep_learning_with_tensorFlow/Chapter05/p11101.py" ]
[ "import tensorflow as tf\n\n# 声明两个变量并计算他们的和\nv1 = tf.Variable(tf.constant(1.0, shape=[1]), name='v1')\nv2 = tf.Variable(tf.constant(2.0, shape=[1]), name='v2')\nresult = v1 + v2\n\ninit_op = tf.global_variables_initializer()\n# 声明tf.train.Saver类用于保存模型\nsaver = tf.train.Saver()\n\nwith tf.Session() as sess:\n ses...
[ [ "tensorflow.constant", "tensorflow.Session", "tensorflow.global_variables_initializer", "tensorflow.train.Saver" ] ]
JakubBartoszewicz/DeePaC
[ "509f602d5178a4ce776e3a4f5434204654fcbd78" ]
[ "deepac/explain/filter_contribs.py" ]
[ "import os\nimport csv\nimport numpy as np\nimport re\n\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.preprocessing.text import Tokenizer\nfrom tensorflow.keras.utils import to_categorical\nimport tensorflow as tf\nfrom deepac.utils import set_mem_growth\n\nfrom Bio import SeqIO\n\nfrom sha...
[ [ "tensorflow.keras.utils.to_categorical", "numpy.random.choice", "tensorflow.compat.v1.disable_v2_behavior", "numpy.load", "numpy.mean", "numpy.multiply", "tensorflow.executing_eagerly", "numpy.count_nonzero", "numpy.empty", "numpy.nonzero", "numpy.arange", "numpy.pa...
zhiqwang/mmdeploy
[ "997d111a6f4ca9624ab3b36717748e6ce002037d" ]
[ "mmdeploy/codebase/mmdet/models/dense_heads/yolox_head.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\n\nfrom mmdeploy.codebase.mmdet import get_post_processing_params, multiclass_nms\nfrom mmdeploy.core import FUNCTION_REWRITER\n\n\n@FUNCTION_REWRITER.register_rewriter(\n func_name='mmdet.models.YOLOXHead.get_bboxes')\ndef yolox_head__get_bboxes(ctx...
[ [ "torch.cat" ] ]
jveitchmichaelis/gotcha
[ "d219059439169b8d85d1e1b34da452e2a4effa75" ]
[ "examples/evaluate_disparity.py" ]
[ "#!/usr/bin/python3\n\nimport os\nimport numpy as np\nimport argparse\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser(description='Process some integers.')\n parser.add_argument('--disparity', type=str,\n help='Input x-disparity map', required=True)\n parser.add_ar...
[ [ "numpy.median", "numpy.array", "numpy.loadtxt", "numpy.abs" ] ]
jamesETsmith/pyscf_benchmark
[ "0f5d8ee1e669edd05163f8f1ffbd615d9aa908ae" ]
[ "fft/bench_fft.py" ]
[ "import os\nimport time\nimport numpy as np\nimport pandas as pd\nfrom importlib import reload\nimport pyscf\nfrom pyscf import __config__\nfrom pyscf.pbc import tools\n\n\nALLOWED_ENGINES = [\"FFTW\", \"NUMPY\", \"NUMPY+BLAS\", \"BLAS\"]\n\n\ndef bench_fft_engine(method: str, mesh_size: int):\n\n # Check inputs...
[ [ "numpy.random.random", "pandas.read_csv", "pandas.DataFrame" ] ]
zhangsiyu1103/darts
[ "8cdc52086c0ae970799eb274114c6d073dd450a5", "8cdc52086c0ae970799eb274114c6d073dd450a5" ]
[ "cnn/architect.py", "rnn/train_search.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn as nn\nimport time\nimport logging\nfrom torch.autograd import Variable\nfrom utils import mask_softmax\n\ndef _concat(xs, idx = None):\n if idx == None:\n return torch.cat([x.view(-1) for x in xs])\n else:\n return torch.cat([x.view(-1) for i, x in enumera...
[ [ "torch.zeros_like" ], [ "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.save", "torch.no_grad", "torch.manual_seed", "torch.cuda.set_device", "torch.cuda.is_available", "torch.nn.functional.softmax", "numpy.random.random", "torch.nn.DataParallel" ] ]
Rockyzsu/akshare
[ "74a954ff5e7096af73d83cf8d85f370e983ab1d1" ]
[ "akshare/stock_fundamental/stock_profit_forecast.py" ]
[ "# -*- coding:utf-8 -*-\n# /usr/bin/env python\n\"\"\"\nDate: 2021/5/4 15:12\nDesc: 东方财富网-数据中心-研究报告-盈利预测\nhttp://data.eastmoney.com/report/profitforecast.jshtml\n\"\"\"\nfrom datetime import datetime\n\nimport pandas as pd\nimport requests\nfrom tqdm import tqdm\n\n\ndef stock_profit_forecast():\n \"\"\"\n 东方...
[ [ "pandas.DataFrame" ] ]
Yobmod/dmlsrim
[ "a2972a5c2f5a7a76f8be31913e04d8a396b4cf02" ]
[ "src/dcf.py" ]
[ "from __future__ import annotations\nimport json\nimport pickle\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom datetime import datetime\nfrom pathlib import Path\nimport os\nfrom srim import Ion, Layer, Target # , output\nfrom srim.srim import TRIM\nfrom srim.output import Results\nfrom concurrent.fu...
[ [ "matplotlib.use", "numpy.array", "numpy.argmin", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.stack" ] ]
pvzteam/pvz_recsys2019
[ "3fd14d3b82033474d2e172402abd0ebc5e7b0afc" ]
[ "src/m3/gen_samples.py" ]
[ "import pandas as pd\nimport numpy as np\nimport sys\nimport utils\nimport config\ndef gen_train_sample(df):\n df['target'] = (df['reference'] == df['impressions']).astype(int)\n df.drop(['current_filters','reference','action_type'],axis=1,inplace=True)\n df_session = df[['session_id','step']].drop_duplica...
[ [ "pandas.isnull", "pandas.notnull", "pandas.concat" ] ]
Lizhu-Chen/bark
[ "fad029f658e462eb1772c28c2c0971faf5176dc1" ]
[ "modules/runtime/viewer/viewer.py" ]
[ "# Copyright (c) 2020 Julian Bernhard, Klemens Esterle, Patrick Hart and\n# Tobias Kessler\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\nimport numpy as np\nimport logging\nfrom bark.viewer import Viewer\nfrom bark.geometry import *\nfro...
[ [ "numpy.array", "numpy.zeros", "numpy.absolute" ] ]
hiramekun/neural-motifs
[ "7babc3b98e2e129a2b15fd0a9d9a864e63f927f8" ]
[ "lib/fpn/generate_anchors.py" ]
[ "# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Sean Bell\n# --------------------------------------------------------\nfrom config import IM_SCALE\n\nimport numpy a...
[ [ "numpy.array", "numpy.stack", "numpy.arange", "numpy.sqrt", "numpy.hstack", "numpy.meshgrid" ] ]
Ace5584/Machine-Learning-Notes
[ "8d721895165833f6ea2ac3c75326ec5ed29111eb" ]
[ "other-libraries/learning-numpy/Part 5/main.py" ]
[ "#------------------------------------------#\n# Maths with numpy: #\n# Simple functions like +, -, /, * #\n# Linear algebra #\n# Statistics #\n#------------------------------------------#\n\nimport numpy as np\n\na = np.array([1...
[ [ "numpy.max", "numpy.array", "numpy.matmul", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.linalg.det", "numpy.min", "numpy.identity", "numpy.cos" ] ]
laurenmarietta/sci_act_scheduler_2019
[ "1b50b16adb7b91b0d69293720a96ba6b5670d313" ]
[ "setup.py" ]
[ "import numpy as np\nfrom setuptools import setup\nfrom setuptools import find_packages\n\n# VERSION = '0.22.0'\n\n# AUTHORS = 'Matthew Bourque, Misty Cracraft, Joe Filippazzo, Bryan Hilbert, '\n# AUTHORS += 'Graham Kanarek, Catherine Martlin, Johannes Sahlmann, Ben Sunnquist'\n\n# DESCRIPTION = 'The James Webb Spa...
[ [ "numpy.get_include" ] ]
minhtannguyen/transformer-mgk
[ "304ebf3781b1eb4aeef93f2757319775d2fcdbc4" ]
[ "language-modeling/fast_transformers/recurrent/attention/cross_attention/.ipynb_checkpoints/linear_attention-checkpoint.py" ]
[ "\"\"\"Implement unmasked linear attention as a recurrent cross attention module to\nspeed up autoregressive decoding.\"\"\"\n\nimport torch\nfrom torch.nn import Module\n\nfrom ....attention_registry import RecurrentCrossAttentionRegistry, Optional, Int, \\\n Callable, EventDispatcherInstance\nfrom ....events i...
[ [ "torch.einsum" ] ]
ajabri/vision
[ "f69847cc761937891be77e1780bc4ddea46dbe68", "f69847cc761937891be77e1780bc4ddea46dbe68" ]
[ "references/video_classification/transforms.py", "references/video_classification/.ipynb_checkpoints/antialias-checkpoint.py" ]
[ "import torch\nimport random\nimport numpy as np\nfrom PIL import Image\nimport math\nimport torch.nn.functional as F\n\ndef crop(vid, i, j, h, w):\n return vid[..., i:(i + h), j:(j + w)]\n\n\ndef center_crop(vid, output_size):\n h, w = vid.shape[-2:]\n th, tw = output_size\n\n i = int(round((h - th) / ...
[ [ "torch.arange", "torch.nn.functional.interpolate", "torch.from_numpy", "torch.squeeze", "torch.as_tensor", "torch.nn.functional.pad", "torch.nn.functional.conv2d", "torch.exp", "torch.sum" ], [ "numpy.array", "numpy.ceil", "torch.nn.functional.pad", "torch.T...
gswyhq/SiameseNet-text-similarity
[ "a00161d6832b09cd211750c08c35f03e42238fb5" ]
[ "train.py" ]
[ "import os\nimport time\nfrom random import random\n\nimport datetime\nimport tensorflow as tf\n\nfrom utils.input_helpers import InputHelper\nfrom siamese_network import SiameseNet\nfrom utils.modules import AdamWeightDecayOptimizer\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\ntf.flags.DEFINE_integer(\"embedding...
[ [ "tensorflow.clip_by_value", "tensorflow.flags.DEFINE_integer", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.flags.DEFINE_string", "tensorflow.get_default_graph", "tensorflow.Variable", "tensorflow.global_variables", "tensorflo...
Shade5/im2recipe-Pytorch
[ "d228487bd6076ce99738cdd4dfdb3e204b8d0a6f" ]
[ "trijoint.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.optim\nimport torch.utils.data\nimport torchvision.models as models\nimport torchwordemb\nfrom args import get_parser\n\n# =============================================================================\nparser = get_parser()\nopts = parser....
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.nn.Sequential", "torch.nn.Tanh", "torch.nn.utils.rnn.pad_packed_sequence" ] ]
yashkhasbage25/HTR
[ "192718f15fafc283d31c22c75fd5e75b31e4db91" ]
[ "LayerHessians/experiments/training_eigenspectrum.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nimport sys\nimport time\nimport torch\nimport logging\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport os.path as osp\nimport torch.nn as nn\nimport torch.utils.data as data\nimport torch.optim as optim\nimport matplotlib.pyplot as plt\ni...
[ [ "torch.device", "numpy.array", "torch.max", "numpy.random.seed", "matplotlib.pyplot.savefig", "torch.no_grad", "torch.enable_grad", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.save", "torch.optim.lr_scheduler.MultiStepLR", "torch.manual_seed", "...
Fuchai/FixMatch-pytorch
[ "105f40678414182d194945b77d24d658b1e84850" ]
[ "train_semi_fix.py" ]
[ "import argparse\nimport math\nimport os\nimport random\nimport shutil\nimport time\nfrom collections import OrderedDict\nfrom copy import deepcopy\n\nimport numpy as np\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nfrom torch.optim.lr_scheduler import LambdaLR\nfrom torch.utils.data import Da...
[ [ "numpy.random.seed", "torch.utils.data.SequentialSampler", "numpy.mean", "torch.optim.lr_scheduler.LambdaLR", "torch.utils.tensorboard.SummaryWriter" ] ]
camilo-cf/Prueba-Tecnica-ML-vision
[ "f4e91e90d2c74156a7b6cca1eeb12f38402de1d7" ]
[ "src/4. Inceptionv3_siamese.py" ]
[ "import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nfrom sklearn.cluster import Birch\n\nfrom iDetection import *\n\n\n## Imagen Original\nPATH = \"../data/JPEG/\" \nimage = cv2.imread(PATH+'IMG_2465.jpg')\nprint('Tamaño original : ', image.shape)\n \nscale_percent = 50 \nwidth = int(image.shape[1] * ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
LeftThink/py-faster-rcnn
[ "39d8fa7886407a8717bcfae2a833320b7a321dea" ]
[ "lib/utils/blob.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"Blob helper functions.\"\"\"\n\nimport numpy as np\ni...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.round", "numpy.min" ] ]
SIAT-SongYuxin/CT2USforKidneySeg
[ "3fed7de100eabc95342c9a457d4f8e9bec0b77a1" ]
[ "FCN.py" ]
[ "from torchvision import models\r\nfrom torch import nn\r\nimport torch\r\nimport torch.nn.functional as F\r\n\r\nclass FCN_ResNet18(nn.Module):\r\n\r\n def __init__(self, n_class):\r\n super().__init__()\r\n\r\n base_model = models.resnet18(pretrained=False)\r\n\r\n self.layers = list(base_...
[ [ "torch.cat", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.MaxPool2d", "torch.nn.Upsample", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.Dropout2d" ] ]
cwza/deep_t2i
[ "22877fdd28ad407984ddc3bc4d57109c54c22fc0", "22877fdd28ad407984ddc3bc4d57109c54c22fc0" ]
[ "deep_t2i/data_anime_heads.py", "deep_t2i/trainer_GAN.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02a_data_anime_heads.ipynb (unless otherwise specified).\n\n__all__ = ['Tokenizer', 'Datasets', 'DataLoaders']\n\n# Cell\nimport pandas as pd\nimport numpy as np\nfrom PIL import Image\nfrom sklearn.model_selection import train_test_split\nimport torch\nfrom torch.ut...
[ [ "numpy.repeat", "pandas.DataFrame", "torch.tensor", "torch.utils.data.DataLoader", "sklearn.model_selection.train_test_split", "pandas.read_csv" ], [ "torch.zeros", "torch.rand", "torch.cat", "torch.device", "torch.sigmoid", "torch.stack", "torch.no_grad", ...
ozym4nd145/SURA
[ "dcbca612e9055b75c9301d3d8af33dddd29ffaa2" ]
[ "code/evaluate.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport time\nimport math\n\nfrom model import Model_S2VT\nfrom data_generator import Data_Generator\nfrom inference_util import Inference\n\nimpo...
[ [ "tensorflow.Summary", "tensorflow.gfile.IsDirectory", "tensorflow.logging.set_verbosity", "tensorflow.train.latest_checkpoint", "tensorflow.flags.DEFINE_boolean", "tensorflow.Graph", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.logging.info", "tensorflow.gfil...
sergioangulo/aves
[ "43a14ec9c82929136a39590b15fe7f92182aae20" ]
[ "src/aves/models/network/layouts.py" ]
[ "from abc import ABC, abstractmethod\n\nimport geopandas as gpd\nimport graph_tool\nimport graph_tool.draw\nimport graph_tool.topology\nimport numpy as np\n\nfrom aves.features.geo import positions_to_array\n\nfrom .base import Network\n\n\nclass LayoutStrategy(ABC):\n def __init__(self, network: Network, name: ...
[ [ "numpy.dot", "numpy.arctan2" ] ]
drreynolds/Math4315-codes
[ "b8be1c1254417a96d3bc23e48444731a75ed0d3b" ]
[ "LUFactorization/LUStability.py" ]
[ "#!/usr/bin/env python3\n#\n# Script to test LUPFactors_simple, LUPFactors and LUPPFactors on a variety\n# of ill-conditioned matrices.\n#\n# Daniel R. Reynolds\n# SMU Mathematics\n# Math 4315\n\n# imports\nimport numpy\nimport time\nfrom LUPFactors_simple import LUPFactors_simple\nfrom LUPFactors import LUPFactors...
[ [ "numpy.linspace", "numpy.linalg.norm", "numpy.random.randint", "numpy.random.rand" ] ]
paulasquin/SLIP
[ "62c8fd3f9a4f4ca91e26b0f1b75f0ee634a6b4f3" ]
[ "beit_finetuning/modeling_finetune.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\n# --------------------------------------------------------\n# BEIT: BERT Pre-Training of Image Transformers (ht...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.cat", "torch.nn.Identity", "torch.arange", "torch.nn.init.constant_", "torch.linspace", "torch.ones", "torch.nn.Conv2d", "torch.meshgrid", "torch.flatten" ] ]
mattkjames7/PyMess
[ "f2c68285a7845a24d98284e20ed4292ed5e58138" ]
[ "PyMess/Magnetopause/WithinMP.py" ]
[ "import numpy as np\n\ndef WithinMP(x,rho,Rss=1.42,Alpha=0.5):\n\t'''\n\tDetermines if a set of x and rho (sqrt(y**2 + z**2)) coordinates are\n\twithin the magnetopause boundary or not.\n\t\n\tInputs:\n\t\tx: Position(s) in x MSM direction.\n\t\trho: Position(s) in rho MSM direction.\n\t\tRss: Distance of the subso...
[ [ "numpy.arctan2", "numpy.sqrt", "numpy.cos" ] ]
hjweide/adversarial-autoencoder
[ "181c59a063a1e5db96b14a04cdded54e4e12ef26" ]
[ "plot.py" ]
[ "import model\nimport theano_funcs\nimport utils\n\nfrom iter_funcs import get_batch_idx\n\n# credit to @fulhack: https://twitter.com/fulhack/status/721842480140967936\nimport seaborn # NOQA - never used, but improves matplotlib's style\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom mpl_toolkits.axes...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.axes", "matplotlib.pyplot.scatter", "sklearn.decomposition.PCA", "numpy.vstack" ] ]
zb12138/sph3dR
[ "8d7cec5fe97ec0e5134c8a0dd2bddddd2a57a1aa" ]
[ "tf_ops/nnquery/tf_nnquery.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.framework import ops\nimport sys, os\n\nbase_dir = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(base_dir)\nnnquery_module = tf.load_op_library(os.path.join(base_dir, 'tf_nnquery_so.so'))\n\ndef build_sphere_neighbor(database,\n ...
[ [ "tensorflow.python.framework.ops.NoGradient" ] ]
ndangtt/LeadingOnesDAC
[ "953747d8702f179851d7973c65779a1f830e03a1" ]
[ "dacbench/plotting.py" ]
[ "from typing import List, Tuple\n\nimport numpy as np\nimport seaborn as sns\nimport pandas as pd\n\nsns.set_style(\"darkgrid\")\n\n\ndef space_sep_upper(column_name: str) -> str:\n \"\"\"\n Separates strings at underscores into headings.\n Used to generate labels from logging names.\n\n Parameters\n ...
[ [ "pandas.wide_to_long" ] ]
aliasgherman/AnomalyDetection
[ "3845f9aa7dc64d71cafc8521762d038613512f51" ]
[ "tad/anomaly_detect_ts.py" ]
[ "\"\"\"\nDescription:\n\n A technique for detecting anomalies in seasonal univariate time\n series where the input is a series of <timestamp, count> pairs.\n\n\nUsage:\n\n anomaly_detect_ts(x, max_anoms=0.1, direction=\"pos\", alpha=0.05, only_last=None,\n threshold=\"None\", e_valu...
[ [ "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.trunc", "scipy.stats.t.ppf", "pandas.Series", "numpy.sqrt", "numpy.dtype" ] ]
QQMr/Logic_analysis_Project_GUI
[ "83d5a35e2238cfbc49758bbdead6af7ce3617e46" ]
[ "ToolDemo/TestMutiLine.py" ]
[ "from pylab import figure, show, setp\n#from matplotlib.numerix import sin, cos, exp, pi, arange\nimport numpy as np\n\nt = np.arange(0.0, 2.0, 0.01)\ns1 = np.sin(2*np.pi*t)\ns2 = np.exp(-t)\ns3 = np.sin(2*np.pi*t)*np.exp(-t)\ns4 = np.sin(2*np.pi*t)*np.cos(4*np.pi*t)\n\nfig = figure()\nt = np.arange(0.0, 2.0, 0.01)...
[ [ "numpy.sin", "numpy.arange", "numpy.exp", "numpy.cos" ] ]
chacreton190/covid-data-model
[ "10e86dee0aa17e9a4261787203d30c4631b5afb1" ]
[ "pyseir/load_data.py" ]
[ "import os\nimport logging\nimport urllib.request\nimport requests\nimport re\nimport io\nimport us\nimport zipfile\nimport json\nfrom datetime import datetime\nfrom functools import lru_cache\nfrom enum import Enum\n\nimport pandas as pd\nimport numpy as np\n\nfrom covidactnow.datapublic.common_fields import Commo...
[ [ "pandas.to_datetime", "pandas.notnull", "numpy.array", "pandas.Timedelta", "pandas.DataFrame", "numpy.diff", "pandas.Timestamp.utcnow", "pandas.read_json", "numpy.isscalar", "pandas.concat", "pandas.read_csv" ] ]
ahmedmazari-dhatim/image_augmentation
[ "083d6d8dee04cd147f6b5097719c3050db70ebb4" ]
[ "tests/check_visually.py" ]
[ "\"\"\"\nTests to visually inspect the results of the library's functionality.\nRun checks via\n python check_visually.py\n\"\"\"\nfrom __future__ import print_function, division\n\nimport imgaug as ia\nfrom imgaug import augmenters as iaa\nfrom imgaug import parameters as iap\nimport numpy as np\nfrom scipy imp...
[ [ "scipy.ndimage.imread", "scipy.misc.imshow" ] ]
wangren09/ASK
[ "f4b0f47341a1f2e3fd2a2c20898779fb589c29c5" ]
[ "pgd.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass PGD:\n def __init__(self, eps=60 / 255., step_size=20 / 255., max_iter=10, random_init=True,\n targeted=False, loss_fn=nn.CrossEntropyLoss(), batch_size=64):\n self.eps = eps\n self.step_size = step_size\n self.max_iter = max_it...
[ [ "torch.device", "torch.cat", "torch.rand_like", "torch.autograd.grad", "torch.clone", "torch.nn.CrossEntropyLoss" ] ]
asiliskender/deep-reinforcement-learning
[ "dbf96d67477aa9242128b78b081474193e1e4538" ]
[ "p1_navigation/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass QNetwork(nn.Module):\n\n def __init__(self, state_size, action_size, seed, hidden_layers):\n \"\"\"\n state_size (int): Dimension of each state\n action_size (int): Dimension of each action\n ...
[ [ "torch.manual_seed", "torch.nn.Linear", "torch.nn.ModuleList" ] ]
RamSaw/deep-reinforcement-learning
[ "06a365dedb26bd40dad7b9803526ddfe46209434" ]
[ "HW03/train.py" ]
[ "import time\nfrom collections import deque\nfrom copy import deepcopy\n\nimport numpy as np\nimport torch\nfrom gym import make\nfrom torch import nn\nfrom torch.distributions import Normal\nfrom torch.optim import Adam\n\nfrom HW03.agent import transform_state, Agent\n\nN_STEP = 1\nGAMMA = 0.9\nDEVICE = torch.dev...
[ [ "torch.zeros", "torch.nn.Linear", "torch.cat", "torch.distributions.Normal", "numpy.mean", "torch.nn.ReLU", "torch.cuda.is_available", "torch.tensor" ] ]
giava90/quantifying-ranking-bias
[ "757252a9595f39a34e67e9998c1f0d5406ff50d0" ]
[ "quantbias.py" ]
[ "import numpy as np\n\ndef Mahalanobis_distance(x, mu, M):\n \"\"\"\n Calculating the Mahalanobis distance between x and mu, MD(x,mu), in a space with metric M.\n\n ------------PARAMETERS------------\n @param simul : Number of simulations\n\n @param x : First vector\n @param mu : Second vector, us...
[ [ "numpy.array", "numpy.dot" ] ]
ysh329/mindspore
[ "bc38590e5300588aa551355836043af0ea092a72", "754e253466a77ba5335c38a3ec7598db8ee4990a" ]
[ "model_zoo/official/cv/faster_rcnn/eval.py", "model_zoo/official/recommend/naml/postprocess.py" ]
[ "# Copyright 2020-2021 Huawei Technologies Co., Ltd\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 applica...
[ [ "numpy.argsort" ], [ "numpy.sum", "numpy.mean", "numpy.take", "numpy.argsort", "numpy.fromfile", "sklearn.metrics.roc_auc_score" ] ]
IBM/GradSigns
[ "a25bdc75b632905b4263b6e1f2bfceb849d43827" ]
[ "Watermark Removal Attacks/Model-Quantization.py" ]
[ "\n##### This code works on Keras version 2.2.4 with Tensorflow nightly version 1.14.1-dev20190402\n\nimport keras\nfrom keras.optimizers import Adam,SGD\nfrom keras import backend as K\nfrom keras.models import Model, load_model\nfrom keras.datasets import cifar10\nimport numpy as np\nimport random\nimport sys\nim...
[ [ "numpy.max", "numpy.round", "numpy.load", "numpy.mean", "numpy.where", "numpy.argmax", "numpy.vstack" ] ]
scalet98/pyemu
[ "c0314c8a705d5523ba7cd66dbf452ab2990c0e4d" ]
[ "pyemu/utils/helpers.py" ]
[ "\"\"\"High-level functions to help perform complex tasks\n\n\"\"\"\n\nfrom __future__ import print_function, division\nimport os\nimport multiprocessing as mp\nimport warnings\nfrom datetime import datetime\nimport platform\nimport struct\nimport shutil\nimport copy\nimport time\nfrom ast import literal_eval\nimpo...
[ [ "numpy.quantile", "numpy.dot", "numpy.cos", "pandas.concat", "numpy.cumsum", "pandas.read_csv", "numpy.dtype", "pandas.notnull", "numpy.sin", "numpy.linalg.norm", "numpy.add.reduce", "pandas.DataFrame", "numpy.arange", "numpy.sqrt", "numpy.log10", "n...
Ahmed-M-Elshal/CarND-Behavioral-Cloning-Project
[ "e09da9c9d6694c88e31dc884378bc5adc2bf14a8" ]
[ "clean.py" ]
[ "import argparse\nimport base64\nimport json\nimport cv2\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom keras.models import model_from_json\nfrom keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array\n\n# Fix error with Keras and TensorFlow\nimport tensorflow as tf\ntf.python...
[ [ "numpy.array" ] ]
RaviPandey33/gym-electric-motor-1
[ "999e18dceed709decf43d646fb29dc7602b9a89c", "999e18dceed709decf43d646fb29dc7602b9a89c" ]
[ "gym_electric_motor/physical_systems/electric_motors/dc_series_motor.py", "gym_electric_motor/physical_systems/mechanical_loads/constant_speed_load.py" ]
[ "import numpy as np\n\nfrom .dc_motor import DcMotor\n\n\nclass DcSeriesMotor(DcMotor):\n \"\"\"The DcSeriesMotor is a DcMotor with an armature and exciting circuit connected in series to one input voltage.\n\n ===================== ========== ============= ===========================================\n ...
[ [ "numpy.array" ], [ "numpy.array" ] ]
thedrow/ray
[ "d8eeb9641314740572e81f9836cbce3e5b8f2b73" ]
[ "python/ray/util/sgd/pytorch/pytorch_trainer.py" ]
[ "import numpy as np\nimport os\nimport logging\nimport numbers\nimport tempfile\nimport time\nimport torch\nimport torch.distributed as dist\n\nimport ray\n\nfrom ray.tune import Trainable\nfrom ray.tune.trial import Resources\nfrom ray.util.sgd.pytorch.distributed_pytorch_runner import (\n DistributedPyTorchRun...
[ [ "torch.distributed.is_available", "torch.save", "torch.load" ] ]
sfailsthy/CS224N
[ "c6fa607629f9778ee09c4dd10f3811ea1da4330e" ]
[ "assignment2/q1_softmax.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom utils.general_utils import test_all_close\n\n\ndef softmax(x):\n \"\"\"\n Compute the softmax function in tensorflow.\n\n You might find the tensorflow functions tf.exp, tf.reduce_max,\n tf.reduce_sum, tf.expand_dims useful. (Many solutions are possible...
[ [ "tensorflow.exp", "numpy.array", "numpy.log", "tensorflow.subtract", "tensorflow.Session", "tensorflow.constant", "tensorflow.reduce_max", "tensorflow.log", "tensorflow.div", "tensorflow.reduce_sum", "tensorflow.to_float" ] ]
Ginga1892/bert-x
[ "903970ef0a6967aa20a82bcf56b874602e37a04d" ]
[ "bert.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nimport json\n\n\nclass BertConfig(object):\n def __init__(self,\n vocab_size,\n hidden_size=768,\n num_hidden_layers=12,\n num_attention_heads=12,\n intermediate_size=3072,\n ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.arange", "torch.nn.Tanh", "torch.softmax", "numpy.sqrt", "torch.nn.GELU", "torch.matmul", "torch.nn.Embedding" ] ]
RL-Gym/bellman
[ "210c9ff877b38705d1cf1b3ccd0f9f2644ad8d0d", "210c9ff877b38705d1cf1b3ccd0f9f2644ad8d0d" ]
[ "tests/integration/bellman/agents/mbpo/test_mbpo_agent.py", "tests/tools/bellman/environments/termination_model.py" ]
[ "# Copyright 2021 The Bellman Contributors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l...
[ [ "tensorflow.constant", "tensorflow.keras.callbacks.EarlyStopping" ], [ "tensorflow.zeros" ] ]
sunkwei/CNTK
[ "08691e97707538b110ca71bce4ad06c46d840517" ]
[ "contrib/Python/cntk/ops/__init__.py" ]
[ "# Copyright (c) Microsoft. All rights reserved.\n# Licensed under the MIT license. See LICENSE.md file in the project root\n# for full license information.\n# ==============================================================================\n\nimport numpy as np\nfrom ..utils import wrap_numpy_arrays, get_rank\n\n###...
[ [ "numpy.savetxt", "numpy.reshape", "numpy.asarray", "numpy.isscalar", "numpy.transpose", "numpy.multiply.reduce" ] ]
dreadlord1984/AdvancedEAST
[ "6790f1ea173e72d5f6f4a0ed305523550402a6ab" ]
[ "losses.py" ]
[ "import tensorflow as tf\n\nimport cfg\n\n\ndef quad_loss(y_true, y_pred):\n # loss for inside_score\n logits = y_pred[:, :, :, :1]\n labels = y_true[:, :, :, :1]\n # balance positive and negative samples in an image\n beta = 1 - tf.reduce_mean(labels)\n # first apply sigmoid activation\n predi...
[ [ "tensorflow.abs", "tensorflow.shape", "tensorflow.less", "tensorflow.equal", "tensorflow.reshape", "tensorflow.log", "tensorflow.reduce_sum", "tensorflow.nn.sigmoid", "tensorflow.reduce_mean", "tensorflow.square" ] ]
CPrescher/hexrdgui
[ "76654b958862a77c01fd2a2e2522b013d4ead9bc" ]
[ "hexrd/ui/image_mode_widget.py" ]
[ "import copy\nfrom functools import partial\nimport multiprocessing\nimport numpy as np\n\nfrom PySide2.QtCore import QObject, QSignalBlocker, Signal\n\nfrom hexrd.ui.constants import ViewType\nfrom hexrd.ui.create_hedm_instrument import create_hedm_instrument\nfrom hexrd.ui.create_raw_mask import apply_threshold_m...
[ [ "numpy.max", "numpy.min" ] ]
drvinceknight/copd-paper
[ "387a14f886d3c562228bb4be45abdd7ed996eda1" ]
[ "src/moving_clusters.py" ]
[ "\"\"\" Functions for moving clusters experiment. \"\"\"\n\nimport itertools as it\nimport sys\n\nimport ciw\nimport dask\nimport numpy as np\nimport pandas as pd\nimport tqdm\nfrom ciw.dists import Exponential\nfrom dask.diagnostics import ProgressBar\n\nfrom util import (\n COPD,\n DATA_DIR,\n MAX_TIME,\...
[ [ "numpy.arange", "pandas.concat" ] ]
KaidongLi/ApolloZero
[ "c18ac46e165dc83f2a5c8d2f5ad973434c9e17fa" ]
[ "dataloader.py" ]
[ "from __future__ import print_function, division\nimport sys\nimport os\nimport torch\nimport numpy as np\nimport random\nimport csv\n\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils\nfrom torch.utils.data.sampler import Sampler\n\nfrom pycocotools.coco import COCO\n\nim...
[ [ "torch.zeros", "numpy.array", "numpy.random.rand", "numpy.zeros", "torch.from_numpy", "numpy.append" ] ]
luis-sribeiro/icml18-jtnn
[ "28ed03fcb3f0a79f44f73eefc0bcad613ea39167" ]
[ "jtnn/jtnn_enc.py" ]
[ "import torch\nimport torch.nn as nn\nfrom collections import deque\nfrom mol_tree import Vocab, MolTree\nfrom nnutils import create_var, GRU\n\nMAX_NB = 8\n\nclass JTNNEncoder(nn.Module):\n\n def __init__(self, vocab, hidden_size, embedding=None):\n super(JTNNEncoder, self).__init__()\n self.hidde...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.ReLU", "torch.LongTensor", "torch.nn.Embedding" ] ]
immerkjaer/my_mlops
[ "7ffafe1fb59f5215139b0d5ac5070247c4b5b592" ]
[ "src/models/mnist_data_loader.py" ]
[ "import os\nfrom src.models import _PROCESSED_DATA, _RAW_DATA, _MODEL_DIR\n\nimport torch\nfrom torch import nn\nimport pytorch_lightning as pl\nfrom torch.utils.data import DataLoader, random_split\nfrom torch.nn import functional as F\nfrom torchvision import transforms\nfrom src.libs.utils import load_raw_data\n...
[ [ "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader", "torch.load", "torch.from_numpy" ] ]
reuben/gradio
[ "719d107d87abc472cb601f1374a25fbf25adf061" ]
[ "gradio/outputs.py" ]
[ "\"\"\"\nThis module defines various classes that can serve as the `output` to an interface. Each class must inherit from\n`OutputComponent`, and each class must define a path to its template. All of the subclasses of `OutputComponent` are\nautomatically added to a registry, which allows them to be easily reference...
[ [ "numpy.array" ] ]
rmrafailov/kitchen
[ "74a0d17155e2a3a76027a7becabc884acbc3ce5c" ]
[ "kitchen_shift/randomized.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nmicrowave_positions = ['closer', \n 'closer_angled']\nkettle_positions = ['top_right',\n 'bot_right',\n 'bot_right_angled',\n 'bot_left_angled']\n\ncabinet_textures = ['wood1', \n ...
[ [ "numpy.random.choice", "matplotlib.pyplot.imshow" ] ]
quantumiracle/End-To-End-RL-with-AutoEncoder
[ "14da2210942a917f8e9b3bcc303e4e6a06b57b02" ]
[ "reacher.py" ]
[ "import pygame\nimport numpy as np\nimport math\nimport time\nfrom gym.spaces.box import Box\nimport matplotlib.pyplot as plt\n\nclass Reacher:\n def __init__(self, screen_size=1000, num_joints=2, link_lengths = [200, 140], ini_joint_angles=[0.1, 0.1], target_pos = [669,430], render=False, change_goal=False):\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.random.rand", "numpy.zeros", "numpy.random.uniform", "numpy.sqrt", "numpy.expand_dims" ] ]
eugenechia95/bokeh
[ "a44df94a8a5f118b6174d8cc1562ca339f6b1fb5" ]
[ "run_bokeh.py" ]
[ "from numpy.random import random\nfrom bokeh.io import curdoc\nfrom bokeh.plotting import figure\nfrom bokeh.layouts import column, widgetbox\nfrom bokeh.models import Button, ColumnDataSource\nfrom bokeh.server.server import Server\n\n\"\"\"\ncreate and run a demo bokeh app on a cloud server\n\"\"\"\n\ndef run(doc...
[ [ "numpy.random.random" ] ]
guyko81/ngboost
[ "ade692eac77acdc96379c682428a7ca36da74a93" ]
[ "examples/sklearn_cv.py" ]
[ "from sklearn.datasets import load_breast_cancer\nfrom sklearn.linear_model import Ridge\nfrom sklearn.model_selection import GridSearchCV, train_test_split\nfrom sklearn.tree import DecisionTreeRegressor\n\nfrom ngboost import NGBClassifier\nfrom ngboost.distns import k_categorical\n\nif __name__ == \"__main__\":\...
[ [ "sklearn.datasets.load_breast_cancer", "sklearn.model_selection.GridSearchCV", "sklearn.linear_model.Ridge", "sklearn.tree.DecisionTreeRegressor", "sklearn.model_selection.train_test_split" ] ]
Sxnan/dl-on-flink
[ "5151eed9bde850eb07062a084f72096ff7b07027", "5151eed9bde850eb07062a084f72096ff7b07027" ]
[ "dl-on-flink-tensorflow-2.x/src/test/resources/print_input_iter.py", "dl-on-flink-pytorch/python/dl_on_flink_pytorch/flink_ml/pytorch_train_entry.py" ]
[ "# Copyright 2022 Deep Learning on Flink 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 ...
[ [ "tensorflow.print" ], [ "torch.distributed.get_world_size", "torch.save", "torch.nn.parallel.DistributedDataParallel", "torch.tensor", "torch.distributed.all_reduce" ] ]
lin-cp/aiida-quantumespresso
[ "55f2bc8c137a69be24709a119bc285c700997907" ]
[ "aiida_quantumespresso/utils/bands.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Utilities for `BandsData` nodes.\"\"\"\n\n\ndef get_highest_occupied_band(bands, threshold=0.005):\n \"\"\"Retun the index of the highest-occupied molecular orbital.\n\n The expected structure of the bands node is the following:\n\n * an array called `occupations`\n ...
[ [ "numpy.shape" ] ]
malcolmyanguci/my_deepgcn_428
[ "74c98ffe4222ef8c979ef1fcb6cf7120b76adbb2" ]
[ "utils/ckpt_util.py" ]
[ "import os\nimport torch\nimport shutil\nfrom collections import OrderedDict\nimport logging\nimport numpy as np\n\n\ndef load_pretrained_models(model, pretrained_model, phase, ismax=True): # ismax means max best\n if ismax:\n best_value = -np.inf\n else:\n best_value = np.inf\n epoch = -1\n...
[ [ "torch.is_tensor", "torch.save", "torch.load" ] ]
fhirschmann/amazon-sagemaker-examples
[ "bb4a4ed78cd4f3673bd6894f0b92ab08aa7f8f29" ]
[ "reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/src/markov/agent_ctrl/rollout_agent_ctrl.py" ]
[ "'''This module implements concrete agent controllers for the rollout worker'''\nimport copy\nimport time\nfrom collections import OrderedDict\nimport math\nimport numpy as np\nimport rospy\nimport logging\nimport json\nfrom threading import RLock\nfrom gazebo_msgs.msg import ModelState\nfrom std_msgs.msg import Fl...
[ [ "numpy.array" ] ]
moritzschaefer/moritzsphd_pub
[ "e79c9a89736392cb2a5d421cc687574dc5421548" ]
[ "src/moritzsphd/analysis/__init__.py" ]
[ "import re\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport pyperclip\nimport seaborn as sns\n\n\nclass QPCRAnalysis:\n def __init__(self,\n data,\n genes,\n samples,\n ntc_cols=True,\n columns_per_...
[ [ "pandas.isnull", "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "pandas.Categorical", "numpy.power", "pandas.read_csv", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.xticks" ] ]
NWU-NISL-Sensing/RISE
[ "fd85aa6e475534a74faab5c4644c63dc0c01d236" ]
[ "Jupyter/AllSee_test/S2/test_start.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jun 8 22:09:47 2021\n\n@author: Apple\n\"\"\"\ndef start():\n import numpy as np\n import scipy.io as sio\n import sklearn.ensemble\n from sklearn import svm\n from sklearn.model_selection import StratifiedKFold\n from sklearn.metrics import confus...
[ [ "sklearn.discriminant_analysis.LinearDiscriminantAnalysis", "sklearn.metrics.confusion_matrix", "numpy.empty", "sklearn.ensemble.AdaBoostClassifier", "sklearn.neighbors.KNeighborsClassifier", "scipy.io.loadmat", "sklearn.naive_bayes.GaussianNB", "sklearn.svm.SVC", "sklearn.disc...
jmfilipe/baselines
[ "8c7df56f6b74a7eb4915c0dda4b8ad5b0699fff2" ]
[ "baselines/ppo1/mlp_policy.py" ]
[ "from baselines.common.mpi_running_mean_std import RunningMeanStd\nimport baselines.common.tf_util as U\nimport tensorflow as tf\nimport gym\nfrom baselines.common.distributions import make_pdtype\n\n\nclass MlpPolicy(object):\n recurrent = False\n\n def __init__(self, name, *args, **kwargs):\n with tf...
[ [ "tensorflow.zeros_initializer", "tensorflow.concat", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.clip_by_value", "tensorflow.get_variable_scope", "tensorflow.get_collection" ] ]
satra/NiPypeold
[ "23f3ce25a8bace32f29e912a3903fdc2485c68d3" ]
[ "nipype/externals/pynifti/setup.py" ]
[ "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('pynifti', parent_package, top_path)\n\n\n return config\n\...
[ [ "numpy.distutils.misc_util.Configuration" ] ]
yuansun1990/master-thesis-source-code
[ "e2bc0f078d51751ac5a0d215821e7f277de9d306" ]
[ "MachineLearning/split-data.py" ]
[ "import pandas\nimport re\nimport string\nimport sys\n\n\"\"\"split-data.py: split data into different classes according to labels\"\"\"\n__author__ = \"YuanSun\"\n\ndef main(input_file, output_path):\n df = pandas.read_csv(input_file)\n n = max(df['label'].values)\n\n # split file according to labels\n ...
[ [ "pandas.read_csv" ] ]
cherishhh/Rank1-Solution-For-Alibaba-Cloud-German-AI-Challenge
[ "adac0b12174698fdf943a8b622e923afef5cce98" ]
[ "modules/lcz_res_net.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .common_layers import *\nfrom .cbam import CBAM_Module\n\nfrom torchvision.models.resnet import BasicBlock, Bottleneck\n\n\nclass CbamBlock(nn.Module):\n\texpansion = 1\n\n\tdef __init__(self, inplanes, planes, stride=1, downsa...
[ [ "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
timoblak/sq-recovery
[ "5290612219dbc112891a4ac44655812c1e95d729" ]
[ "torch/visu.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\nimport open3d as o3d\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom time import time, sleep\nfrom quaternion import rotate, mat_from_quaternion_np, conjugate_np, multiply_np, to_magnitude_np, conjugate, multiply, to_magnitude\nfrom helpers import randquat, ...
[ [ "numpy.concatenate", "torch.device", "numpy.sin", "numpy.array", "numpy.zeros", "torch.autograd.set_detect_anomaly", "numpy.eye", "torch.from_numpy", "numpy.sign", "numpy.stack", "numpy.arange", "numpy.random.uniform", "numpy.cos", "sklearn.preprocessing.nor...
AnimeshGurjar/ivy
[ "e598872d96b8f7a1db461f005bec99cd0400ecec" ]
[ "ivy/functional/backends/numpy/core/linalg.py" ]
[ "\"\"\"\nCollection of Numpy linear algebra functions, wrapped to fit Ivy syntax and signature.\n\"\"\"\n\n# global\nimport numpy as _np\nimport ivy as _ivy\nfrom typing import Union, Tuple\nfrom collections import namedtuple\n\n\n\nsvd = _np.linalg.svd\n\n\ndef matrix_norm(x, p=2, axes=None, keepdims=False):\n ...
[ [ "numpy.concatenate", "numpy.linalg.slogdet", "numpy.linalg.norm", "numpy.zeros", "numpy.linalg.det", "numpy.expand_dims" ] ]
polzerdo55862/Bayesian-Hyperparameter-Optimization
[ "1b9b6332e8666d3f673a1595b9202f48e7fd8dce" ]
[ "old.py" ]
[ "import matplotlib.pyplot as plt\nimport matplotlib.tri as tri\nimport numpy as np\n\nngridx = 100\nngridy = 200\n\n# define the hyperparameter space (epsilon = 1-20, C=1-10)\nepsilon_min = 1\nepsilon_max = 10\nC_min = 1\nC_max =10\nepsilon = list(np.arange(epsilon_min,epsilon_max,1))\nC = list(np.arange(C_min,C_ma...
[ [ "matplotlib.pyplot.setp", "sklearn.preprocessing.StandardScaler", "matplotlib.tri.Triangulation", "matplotlib.pyplot.subplots", "matplotlib.pyplot.subplots_adjust", "numpy.arange", "sklearn.svm.SVR", "matplotlib.pyplot.show", "matplotlib.tri.LinearTriInterpolator", "numpy.m...
dacb/assembly_and_binning
[ "c2e7273d654c809906ce29795ec6a24704ab1705" ]
[ "assess_unbinned_reads_across_samples/plot_frac_mapped.py" ]
[ "# modified from /Users/janet/Dropbox/meta4_bins_data_and_files/170118_read_mappings_by_sample/plot_frac_mapped.py \n# coding: utf-8\n\nprint('import packages...')\n\n# In[1]:\n\nimport matplotlib as mpl\nmpl.use('Agg')\nimport matplotlib.pyplot as plt\n\nimport pandas as pd\nimport seaborn as sns\n\nprint('done i...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.gcf", "pandas.read_csv" ] ]
Germandrummer92/nuscenes-devkit
[ "8e37a480a0e41e7d5323ac14488ae1ddf2cfb2bb" ]
[ "python-sdk/nuscenes/map_expansion/map_api.py" ]
[ "# nuScenes dev-kit.\n# Code written by Sergi Adipraja Widjaja, 2019.\n# + Map mask by Kiwoo Shin, 2019.\n# + Methods operating on NuScenesMap and NuScenes by Holger Caesar, 2019.\n\nimport json\nimport os\nimport random\nfrom typing import Dict, List, Tuple, Optional, Union\n\nimport cv2\nimport descartes\nimport ...
[ [ "numpy.minimum", "matplotlib.patches.Rectangle", "matplotlib.pyplot.savefig", "numpy.logical_and", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.axis", "numpy.vstack", "matplotlib.pyplot.subplot", "numpy.array", "numpy.zeros", "numpy.round", "matplotlib.pyplo...
marcuscangussu/chemex_bouvignies
[ "ce9ec20a42604eb5995abb0f8a84094b29747651" ]
[ "chemex/experiments/cpmg/n_trosy/liouvillian.py" ]
[ "\"\"\"\nCreated on Aug 26, 2011\n\n@author: guillaume\n\"\"\"\n\n\n# Imports\nfrom scipy import (zeros,\n asarray,\n pi, cos, sqrt)\nfrom scipy.constants import hbar, mu_0\n\nfrom chemex.constants import gamma\nfrom chemex.bases.two_states.iph_aph import (R_IXY, R_2SZIXY, DR_XY,...
[ [ "scipy.zeros", "scipy.asarray", "scipy.cos", "scipy.sqrt" ] ]
hsuanchuu/maskrcnn-benchmark
[ "39429eca800fb912418c34d104ff6f3f2ea07bbd", "39429eca800fb912418c34d104ff6f3f2ea07bbd" ]
[ "action_prediction/dataloader_sub.py", "action_prediction/train_all.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jul 25 17:16:36 2019\n\n@author: epyir\n\"\"\"\nimport glob\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import Dataset\nfrom torch.autograd import Variable\nimport torchvision.transforms as transforms\nimport os.path as osp\nfrom P...
[ [ "numpy.array", "numpy.load", "torch.Tensor" ], [ "torch.sigmoid", "numpy.array", "torch.FloatTensor", "numpy.mean", "torch.cuda.device_count", "torch.cuda.is_available", "torch.load", "torch.nn.BCEWithLogitsLoss", "torch.nn.DataParallel" ] ]
kkoruy/chanpy
[ "73a515d43d4848381513301d55a6ad897cfd239b" ]
[ "chanpy/chanpy.py" ]
[ "# the main chanpy of the project\nimport getmac\nimport time\nfrom datetime import datetime\nfrom random import randint\nimport json\nimport requests as req\nfrom webapp.user_login_app import mongo\nfrom db.flaskdbreader import int2dt\nimport numpy as np\n\n\nclass Client:\n\n def __init__(self):\n self....
[ [ "numpy.array" ] ]
kaixin-bai/walle
[ "031e48c080fe439418d017c689ea7e6350ebbbb1", "031e48c080fe439418d017c689ea7e6350ebbbb1" ]
[ "walle/core/orientation.py", "walle/core/orthogonal.py" ]
[ "\"\"\"An API for dealing with orientation and rotations in 3-D space.\n\"\"\"\n\nimport numpy as np\n\nfrom walle.core import constants, quaternion, utils\nfrom walle.core.matrix import RotationMatrix\nfrom walle.core.orthogonal import is_proper_rotm\n\n\nclass Orientation(object):\n \"\"\"A convenience class for...
[ [ "numpy.sin", "numpy.array", "numpy.linalg.norm", "numpy.isclose", "numpy.dot", "numpy.asarray", "numpy.linalg.eigh", "numpy.argmax", "numpy.cos", "numpy.sqrt", "numpy.cross" ], [ "numpy.dot", "numpy.asarray", "numpy.sum", "numpy.linalg.det", "num...
lupvasile/video-seg
[ "d0b1f5ec75c49ee42ba08939451575580ce6f798" ]
[ "train/train_seg.py" ]
[ "import os\nimport time\nfrom argparse import ArgumentParser\nfrom os import makedirs\nfrom os.path import basename, exists\nfrom shutil import copyfile\n\nimport torch\nimport torch.backends.cudnn as cudnn\nfrom torch import nn\nfrom torch.optim import Adam, lr_scheduler\nfrom torch.utils.data import DataLoader\n\...
[ [ "torch.device", "torch.save", "torch.no_grad", "torch.utils.data.DataLoader", "torch.load", "torch.optim.lr_scheduler.LambdaLR", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel" ] ]
cy-sohn/junkyard
[ "70d19ae741b57436b00c8892a3ea246a10f02dfa" ]
[ "simple_scripts/highest_not_in_list.py" ]
[ "# Find the highest number not in the list\nimport numpy as np\n\nl = [1, 3, 5, 9, 11]\na = np.array(l)\nans = 1\nfor i in range(a.max(initial=0) - 1, max(0, a.min(initial=0)), -1):\n if i not in a:\n ans = i\n print(i)\n break\n\nA = [1, 3, 5, 9, 11]\nAns = 1\nfor j in range(max(A)-1, max(0...
[ [ "numpy.array" ] ]
mrubio-chavarria/fetchers-python
[ "dfd255f1d0250d06642c8220e22712428d983e16" ]
[ "src/plugins/WRD_ECDC/fetcher.py" ]
[ "from datetime import datetime\nimport logging\nimport pandas as pd\nfrom utils.fetcher_abstract import AbstractFetcher\n\n__all__ = ('WorldECDCFetcher',)\n\nlogger = logging.getLogger(__name__)\n\n\nclass WorldECDCFetcher(AbstractFetcher):\n LOAD_PLUGIN = True\n\n def fetch(self):\n url = 'https://ope...
[ [ "pandas.read_csv" ] ]
fabsig/Comparison_GLMM_Packages
[ "348c85b47c65ad9ce306651e9a6039d81da3363f" ]
[ "GLMM_statsmodels.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nComparison of computational time for generalized linear mixed effects models\nAuthor: Fabio Sigrist, May 2021\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport os\nimport time\nimport statsmodels.genmod.bayes_mixed_glm as glm\n\npath_data = \"C:\\\\GLMM_comparison\\\\\"\n\...
[ [ "numpy.ones", "numpy.exp", "numpy.mean", "numpy.arange", "pandas.Series" ] ]
beckermr/pizza-cutter
[ "04eefd2d4b2a63975fe809c60b5c8e7e3fcf26c6" ]
[ "pizza_cutter/des_pizza_cutter/tests/test_sky_bounds.py" ]
[ "import pytest\n\nimport numpy as np\n\nfrom .._sky_bounds import get_rough_sky_bounds, radec_to_uv\nfrom ...wcs import FastHashingWCS\n\n\n@pytest.fixture\ndef bnds_data():\n wcs = FastHashingWCS(dict(\n naxis1=2048,\n naxis2=4096,\n equinox=2000.00000000,\n radesys='ICRS ',\n ...
[ [ "numpy.linspace", "numpy.ones" ] ]
simbleau/vgpu-bench
[ "ad827f2c9260237bdafc619ef3d603f01f5f3437" ]
[ "tools/plotter/plot_naive_frametimes_primitives.py" ]
[ "import os\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nimport helper_methods\n\n# Get CLI args\nimport sys\nif len(sys.argv) != 4:\n print(\"Usage: <input_file> <output_dir> <output_name>\")\n exit(1)\nINPUT_CSV = sys.argv[1]\nOUTPUT_DIR = sys.argv[2]\nOUTPUT_NAME = sys.argv[3]\...
[ [ "numpy.median", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.std", "numpy.amax", "matplotlib.pyplot.tight_layout", "numpy.amin", "pandas.read_csv", "matplotlib.pyplot.table" ] ]
venusafroid/Bert_ProtoNet_Intent
[ "c8758315d6c3f12d676ea4cde758b025856ae053" ]
[ "train.py" ]
[ "import torch\nfrom data import IntentDset\nfrom model import ProtNet \nfrom torch import nn, optim \nfrom pytorch_pretrained_bert.optimization import BertAdam, WarmupLinearSchedule\nimport math\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--train_data', default='lena', type=str)\npa...
[ [ "torch.tensor", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel", "torch.sum" ] ]
GeoCode-polymtl/Seis_float16
[ "5f9660cbdc37e5ab7f6054f7547df2ffb661a81d" ]
[ "Fig7_inversion/invflow/Forward.py" ]
[ "\n# -*- coding: utf-8 -*-\n\"\"\"\nBase class for the forward model operator\n\"\"\"\nimport numpy as np\nimport copy \nfrom shutil import rmtree\nimport os\nimport subprocess\nimport tensorflow as tf\nimport time\n \nclass FclassError(Exception):\n pass\n\nclass Subprocess_op:\n \"\"\"Class to create ...
[ [ "tensorflow.errors.InvalidArgumentError", "tensorflow.get_default_graph", "tensorflow.py_func", "numpy.random.randint", "tensorflow.name_scope", "tensorflow.RegisterGradient" ] ]
davidzyx/eco-dqn
[ "eb417d06d6e0533cfe8d02ce1860312ac905684c" ]
[ "experiments/ER_200spin/test/test_eco.py" ]
[ "import os\n\nimport matplotlib.pyplot as plt\nimport torch\n\nimport src.envs.core as ising_env\nfrom experiments.utils import test_network, load_graph_set\nfrom src.envs.utils import (SingleGraphGenerator,\n RewardSignal, ExtraAction,\n OptimisationTarget, Spi...
[ [ "torch.device", "torch.cuda.is_available", "matplotlib.pyplot.style.use", "torch.load" ] ]
196693/rlcard
[ "f474d38d10d855a0b68f2996f4520b96dfa08445" ]
[ "rlcard/games/blackjack/game.py" ]
[ "from copy import deepcopy\nimport numpy as np\n\nfrom rlcard.games.blackjack import Dealer\nfrom rlcard.games.blackjack import Player\nfrom rlcard.games.blackjack import Judger\n\nclass BlackjackGame(object):\n\n def __init__(self, allow_step_back=False):\n ''' Initialize the class Blackjack Game\n ...
[ [ "numpy.random.RandomState" ] ]
alexholcombe/ABdualStream
[ "957391e83189314acdc827963b8ef90f4f4a27ca" ]
[ "ABdualStreamEEG.py" ]
[ "#Alex Holcombe alex.holcombe@sydney.edu.au\n#See the README.md for more information: https://github.com/alexholcombe/attentional-blink/blob/master/README.md\n#git remote add origin https://github.com/alexholcombe/attentional-blink.git\nfrom __future__ import print_function\nimport time, sys, os#, pylab\nif os.name...
[ [ "numpy.concatenate", "numpy.array", "numpy.isnan", "numpy.random.rand", "numpy.zeros", "numpy.median", "numpy.round", "numpy.random.shuffle", "numpy.diff", "numpy.where", "numpy.arange", "numpy.atleast_1d", "numpy.alen", "numpy.around", "numpy.floor" ]...
Liset97/autogoal
[ "1232f38af7462b6efb2d2820697c81626abf5c0c" ]
[ "autogoal/experimental/sparseml/main.py" ]
[ "from sparseml.keras.optim import ScheduledModifierManager\nfrom tensorflow.keras.utils import to_categorical\nfrom autogoal.contrib.keras import KerasClassifier\nfrom autogoal.grammar import CategoricalValue\n\n\ndef build_sparseml_keras_classifier(path_to_recipe: str):\n \"\"\"Build custom KerasClassifier algo...
[ [ "tensorflow.keras.utils.to_categorical" ] ]