repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
slavslav/tensorflow | [
"e29e704c9c8d68113fc407243b75a09325c86d08"
] | [
"tensorflow/python/distribute/distribute_lib.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.python.framework.ops.colocate_with",
"tensorflow.python.distribute.device_util.current",
"tensorflow.python.util.nest.flatten",
"tensorflow.python.framework.constant_op.constant",
"tensorflow.python.util.tf_export.tf_export",
"tensorflow.python.platform.tf_logging.log_first_n",... |
Naqu6/jax | [
"6411f8a03388ce63eb365188f2e2880815745125"
] | [
"tests/lax_test.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.ones",
"numpy.complex64",
"numpy.take",
"numpy.dtype",
"numpy.issubdtype",
"numpy.ones_like",
"numpy.asarray",
"numpy.uint8",
"numpy.zeros",
"numpy.float32",
"numpy.arange",
"numpy.int32",
"numpy.lexsort",
"numpy.prod",
"numpy.pad",
"numpy.int... |
kellywzhang/OpenNMT-py | [
"2a38fb035fed0597f22694f4580303d1490cbb39"
] | [
"onmt/Optim.py"
] | [
"import torch.optim as optim\nfrom torch.nn.utils import clip_grad_norm\n\n\nclass Optim(object):\n \"\"\"\n Controller class for optimization. Mostly a thin\n wrapper for `optim`, but also useful for implementing\n rate scheduling beyond what is currently available.\n Also implements necessary metho... | [
[
"torch.optim.SGD",
"torch.optim.Adadelta",
"torch.nn.utils.clip_grad_norm",
"torch.optim.Adam",
"torch.optim.Adagrad"
]
] |
fierval/retina | [
"2bc50b3354e5e37f1cfd34f11fbe4b0a4178b7ac"
] | [
"DiabeticRetinopathy/Refactoring/kobra/tr_utils.py"
] | [
"import numpy as np\nfrom time import gmtime, strftime, localtime\nimport csv\nimport os\nfrom os import path\nimport shutil\nimport pandas as pd\nfrom pandas.io.parsers import csv\n\ndef prep_out_path(out_path):\n if path.exists(out_path):\n shutil.rmtree(out_path)\n os.makedirs(out_path)\n\ndef appen... | [
[
"numpy.append",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.nditer",
"pandas.concat",
"numpy.array"
]
] |
Chocomunk/caltech-ee148-spring2020-hw01 | [
"f4a5a1450560018c6098f706fca27138cedf55a0"
] | [
"strategies.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom skimage.exposure import equalize_adapthist\n\nfrom util import hsv2rgb, rgb2hsv, histogram_equalization, CLAHE, correlate, \\\n black_tophat\n\n\ndef threshold_strategy(I, r_b=85, r_t=145, g_b=0, g_t=0, b_b=75, b_t=130):\n img = black_tophat(I, 11)\... | [
[
"numpy.maximum",
"numpy.zeros"
]
] |
dzwallkilled/pytorch-cifar10 | [
"fee201da5a3b516a57104e0b6338e05008079b8b"
] | [
"models/VGG.py"
] | [
"import torch.nn as nn\n\n\ncfg = {\n 'VGG11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],\n 'VGG13': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],\n 'VGG16': [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M'],\n 'V... | [
[
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.ReLU"
]
] |
asnt/moderngl | [
"b39cedd8cf216c34e43371b4aec822f6084f0f79"
] | [
"docs/the_guide/first.3.py"
] | [
"import moderngl\nimport numpy as np\n\nctx = moderngl.create_standalone_context()\n\nprog = ctx.program(\n vertex_shader='''\n #version 330\n\n in vec2 in_vert;\n in vec3 in_color;\n\n out vec3 v_color;\n\n void main() {\n v_color = in_color;\n gl_Positio... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.dstack",
"numpy.random.rand",
"numpy.linspace"
]
] |
CV-IP/interfacegan | [
"5a556b8e693f6e1888f769f653aaafaaccca5dc2"
] | [
"models/pggan_tf_official/dataset_tool.py"
] | [
"# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# This work is licensed under the Creative Commons Attribution-NonCommercial\n# 4.0 International License. To view a copy of this license, visit\n# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to\n# Creative Commons, PO Box 1866,... | [
[
"numpy.asarray",
"tensorflow.train.Int64List",
"numpy.random.RandomState",
"numpy.stack",
"tensorflow.python_io.TFRecordWriter",
"numpy.round",
"numpy.fromstring",
"numpy.load",
"numpy.hypot",
"tensorflow.python_io.TFRecordOptions",
"numpy.float32",
"numpy.median",
... |
BAMresearch/ctsimu-toolbox | [
"2329fe0bba8a89061430649c043c70c58835a435"
] | [
"ctsimu/image.py"
] | [
"# -*- coding: UTF-8 -*-\r\n\"\"\"\r\nThis module provides classes for the virtual processing of images.\r\n\r\n* `Image` reads, stores, writes and handles image data.\r\n* `ImageFile` gathers information about an image file: file name, data type,\r\n byte order. It is used to instruct the `Image.read()` and `Imag... | [
[
"scipy.signal.fftconvolve",
"numpy.sum",
"numpy.ones",
"numpy.vectorize",
"scipy.optimize.curve_fit",
"numpy.diff",
"numpy.dtype",
"numpy.issubdtype",
"numpy.any",
"numpy.amax",
"numpy.meshgrid",
"numpy.fliplr",
"numpy.abs",
"numpy.reshape",
"numpy.where... |
214929177/pyNastran | [
"73032d6ffd445ef085c124dde6b5e90a516a5b6a"
] | [
"pyNastran/op2/op2_interface/op2_scalar.py"
] | [
"#pylint: disable=R0913\n\"\"\"\nDefines the sub-OP2 class. This should never be called outisde of the OP2 class.\n\n - OP2_Scalar(debug=False, log=None, debug_file=None)\n\n **Methods**\n - set_subcases(subcases=None)\n - set_transient_times(times)\n - read_op2(op2_filename=None, combine=False)\n - set_... | [
[
"numpy.array",
"numpy.frombuffer"
]
] |
bsipocz/glue | [
"7b7e4879b4c746b2419a0eca2a17c2d07a3fded3"
] | [
"glue/clients/__init__.py"
] | [
"from matplotlib import rcParams, rcdefaults\n#standardize mpl setup\nrcdefaults()\n\nfrom .histogram_client import HistogramClient\nfrom .image_client import ImageClient\nfrom .scatter_client import ScatterClient\n"
] | [
[
"matplotlib.rcdefaults"
]
] |
lxuechen/swissknife | [
"43dbd36f1e998ebe29c0b85fafd0de765dfb5de8"
] | [
"experiments/explainx/numerical.py"
] | [
"import math\nfrom typing import Union, Sequence\n\nimport torch\n\n\ndef logmeanexp(x: Union[Sequence[torch.Tensor], torch.Tensor], keepdim=False, dim=0):\n if isinstance(x, (tuple, list)):\n elem0 = x[0]\n if elem0.dim() == 0:\n x = torch.stack(x)\n elif elem0.dim() == 1:\n ... | [
[
"torch.logsumexp",
"torch.stack",
"torch.cat"
]
] |
ColinRioux/DeepPseudo | [
"f7b2ec1d5c60ae15b5cdb5dcc8de8b4d2f354340"
] | [
"src/EncoderLayer.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom src.EncoderBlockLayer import EncoderBlockLayer\nfrom src.PositionalEncodingLayer import PositionalEncodingLayer\n\nclass EncoderLayer(nn.Module):\n\n def __init__(self, vocab_size, max_len, d_model, n_heads, hidden_size, kernel_size, dro... | [
[
"torch.nn.Linear",
"torch.nn.Embedding",
"torch.nn.Conv1d",
"torch.nn.functional.glu",
"torch.nn.Dropout"
]
] |
jmcabreira/Dynamic-risk-assessment-system | [
"9ad320b12eb8948345743e403a6a49268de72858"
] | [
"scoring.py"
] | [
"from flask import Flask, session, jsonify, request\nimport pandas as pd\nimport numpy as np\nimport pickle\nimport os\nfrom sklearn import metrics\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\nimport json\n\n#################Load config.json and get pat... | [
[
"pandas.read_csv",
"sklearn.metrics.f1_score"
]
] |
Data-Science-in-Mechanical-Engineering/edge | [
"586eaba2f0957e75940f4f19fa774603f57eae89"
] | [
"edge/gym_wrappers/environment_wrapper.py"
] | [
"import gym.spaces as gspaces\n\nfrom edge.envs.environments import Environment\nfrom edge.space import StateActionSpace\nfrom . import BoxWrapper, DiscreteWrapper\n\n\nclass DummyDynamics:\n def __init__(self, stateaction_space):\n self.stateaction_space = stateaction_space\n\n @property\n def stat... | [
[
"numpy.zeros"
]
] |
Kiwi-PUJ/DataLabelling | [
"1b89041dc371720be6254e1efb3ee8665ce69951"
] | [
"main.py"
] | [
"## @package Labelling_app\n# Labelling app software developed with Grabcut\n# \n# @version 1 \n#\n# Pontificia Universidad Javeriana\n# \n# Electronic Enginnering\n# \n# Developed by:\n# - Andrea Juliana Ruiz Gomez\n# Mail: <andrea_ruiz@javeriana.edu.co>\n# GitHub: andrearuizg\n# - Pedro Eli Ruiz Zara... | [
[
"numpy.savetxt",
"numpy.where",
"numpy.zeros"
]
] |
zhaofang0627/HPBTT | [
"98cec9ff4ef95a01393718b024e9645e77fb70ee"
] | [
"data/background_pose.py"
] | [
"import os\n\nimport cv2\nimport numpy as np\nfrom absl import flags, app\nfrom PIL import Image\nfrom torch.utils.data import Dataset, DataLoader\n\nfrom .data_utils import RandomCrop\nfrom ..external.hmr.src.util import image as img_util\n\nimport tqdm\n\nbgData = './dataset/PRW-v16.04.20/frames'\nflags.DEFINE_st... | [
[
"numpy.array",
"torch.utils.data.DataLoader",
"numpy.transpose",
"numpy.random.rand"
]
] |
adityaRakhecha/Image-Filters | [
"3d36008daf48ce16016e6152bcfb8dd422a095a0"
] | [
"sharpening.py"
] | [
"import cv2\nimport numpy as np\n\nclass sharpening:\n\n\tdef __init__(self):\n\t\tpass\n\t\n\tdef sharp(self,image):\n\t\t# Create sharpening kernel\n\t\tkernel = np.array([[0, -1, 0], [-1, 5, -1], [0, -1, 0]])\n\n\t\t# applying the sharpening kernel to the input image & displaying it.\n\t\tsharpened = cv2.filter2... | [
[
"numpy.array"
]
] |
yyyliu/latent-space-cartography | [
"c731029bfe540ac9ef703e832aac6774c01f075a"
] | [
"model/read.py"
] | [
"#!/usr/bin/env python\n\n'''\nReads an existing model and do something.\n'''\n\nfrom __future__ import print_function\nimport h5py\nfrom PIL import Image\nimport numpy as np\nimport os\n\nfrom keras import backend as K\n\nimport model\n\n# dataset config\nfrom config_emoji import *\n\nbatch_size = 100\n\n# path to... | [
[
"numpy.concatenate",
"numpy.zeros"
]
] |
tianchenji/Multimodal-SVAE | [
"c76b7f8984610e32819510a7a5295124b97460be"
] | [
"models/blocks/Decoder.py"
] | [
"import torch.nn as nn\n\nclass Decoder(nn.Module):\n\n def __init__(self, layer_sizes, latent_size):\n\n super().__init__()\n\n self.MLP = nn.Sequential()\n\n input_size = latent_size\n\n for i, (in_size, out_size) in enumerate(zip([input_size]+layer_sizes[:-1], layer_sizes)):\n ... | [
[
"torch.nn.ReLU",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.nn.Sequential"
]
] |
weapp/numpy | [
"33cc5c6530d48102730b85cdf2835aaf480013ad"
] | [
"numpy/typing/tests/data/reveal/dtype.py"
] | [
"import numpy as np\n\ndtype_obj: np.dtype[np.str_]\n\nreveal_type(np.dtype(np.float64)) # E: numpy.dtype[numpy.floating[numpy.typing._64Bit]]\nreveal_type(np.dtype(np.int64)) # E: numpy.dtype[numpy.signedinteger[numpy.typing._64Bit]]\n\n# String aliases\nreveal_type(np.dtype(\"float64\")) # E: numpy.dtype[numpy... | [
[
"numpy.dtype"
]
] |
irfanumar1994/pytorch-transformers | [
"f257b96a879e38922eaa377be383be69372e78f1"
] | [
"pytorch_transformers/modeling_bert.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"torch.ones_like",
"torch.ones",
"torch.nn.Linear",
"numpy.transpose",
"torch.nn.MSELoss",
"tensorflow.train.list_variables",
"torch.zeros_like",
"torch.nn.Softmax",
"torch.nn.Embedding",
"torch.nn.Tanh",
"torch.nn.CrossEntropyLoss",
"torch.from_numpy",
"torch.a... |
eladyaniv01/sc2-pathlib | [
"ae1737af0dd3d418016941dcb4ac30bcfb36726f"
] | [
"sc2pathlibp/path_finder.py"
] | [
"from .sc2pathlib import PathFind\n\n# from . import _sc2pathlib\n# import sc2pathlib\nimport numpy as np\nfrom typing import Union, List, Tuple\nfrom math import floor\n\n\ndef to_float2(original: Tuple[int, int]) -> Tuple[float, float]:\n return (original[0] + 0.5, original[1] + 0.5)\n\n\nclass PathFinder:\n ... | [
[
"numpy.array",
"numpy.rot90"
]
] |
videetparekh/model-zoo-models | [
"431d6e8f04c343a2e6dbc140e1b060cc5f0a089d"
] | [
"ssd_mobilenetv2/Evaluator.py"
] | [
"import sys\nfrom collections import Counter\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom eval_utils import *\n\n\nclass Evaluator:\n def GetPascalVOCMetrics(self,\n boundingboxes,\n IOUThreshold=0.5,\n method=Meth... | [
[
"numpy.sum",
"matplotlib.pyplot.legend",
"numpy.cumsum",
"numpy.divide",
"numpy.argwhere",
"numpy.zeros",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot"... |
carsault/chord_sequence_prediction | [
"6eb539a963ca6350bcf0c88b8d8756775ad7c488"
] | [
"utilities/modelsGen.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jan 9 18:00:12 2019\n\n@author: carsault\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom utilities import utils\nfrom utilities.utils import *\n#%%\nclass ModelFamily(nn.Module):\n def __init__(self):\n ... | [
[
"torch.stack",
"torch.nn.GRU",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d",
"torch.nn.functional.dropout",
"torch.nn.BatchNorm1d",
"torch.nn.Softmax",
"torch.nn.LSTM",
"torch.tenso... |
kuo1220/verbose-barnacle | [
"7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae"
] | [
"tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.contrib.boosted_trees.proto.learner_pb2.LearnerConfig",
"tensorflow.python.feature_column.feature_column_lib.categorical_column_with_hash_bucket",
"tensorflow.contrib.boosted_trees.python.ops.model_ops.tree_ensemble_stamp_token",
"tensorflow.contrib.layers.real_valued_column",
"ten... |
kevin1kevin1k/bokeh | [
"9f34b5b710e2748ec803c12918ec1706098a3477"
] | [
"examples/plotting/file/custom_datetime_axis.py"
] | [
"import pandas as pd\n\nfrom bokeh.io import show, output_file\nfrom bokeh.plotting import figure\nfrom bokeh.sampledata.stocks import MSFT\n\ndf = pd.DataFrame(MSFT)[:51]\ninc = df.close > df.open\ndec = df.open > df.close\n\np = figure(plot_width=1000, title=\"MSFT Candlestick with Custom X-Axis\")\n\n# map dataf... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
korolm/kaggle-mlcourse | [
"94df0346cfcf9412cd150e1b3ca5239cbe6c9521"
] | [
"assignment2/alice/features/sites.py"
] | [
"from scipy.sparse import csr_matrix\nfrom sklearn.feature_extraction.text import CountVectorizer\nimport numpy as np\nimport pickle\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nimport re\n\nfrom joblib import Memory\n\ncachedir = 'cache/'\nmemory = Memory(cachedir, verbose=0)\n\npath_to_site_dict ... | [
[
"numpy.timedelta64",
"numpy.unique",
"sklearn.feature_extraction.text.CountVectorizer",
"numpy.isnan"
]
] |
jalexvig/imitating_optimizer | [
"c0a62869ae678a62df9d13d1007efa0e531c6c3c"
] | [
"src/models/mnist.py"
] | [
"import os\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torchvision import datasets, transforms\n\nfrom src.models.base import BaseModel\n\n\nclass MNIST(BaseModel):\n\n def _setup(self):\n\n self.conv1 = nn.Conv2d(1, 10, kernel_size=5)\n self.conv2 = nn.Conv2d(10... | [
[
"torch.nn.Linear",
"torch.nn.Dropout2d",
"torch.nn.functional.dropout",
"torch.nn.CrossEntropyLoss",
"torch.nn.Conv2d"
]
] |
anzhao920/MicrosoftProject15_Invictus | [
"15f44eebb09561acbbe7b6730dfadf141e4c166d"
] | [
"COMP0016_2020_21_Team12-datasetsExperimentsAna/pwa/FADapp/pythonScripts/venv/Lib/site-packages/numpy/core/tests/test_dtype.py"
] | [
"import sys\r\nimport operator\r\nimport pytest\r\nimport ctypes\r\nimport gc\r\n\r\nimport numpy as np\r\nfrom numpy.core._rational_tests import rational\r\nfrom numpy.core._multiarray_tests import create_custom_field_dtype\r\nfrom numpy.testing import (\r\n assert_, assert_equal, assert_array_equal, assert_rai... | [
[
"numpy.ones",
"numpy.testing.assert_equal",
"numpy.dtype",
"numpy.float64",
"numpy.testing.assert_array_equal",
"numpy.uint32",
"numpy.core._rational_tests.rational",
"numpy.can_cast",
"numpy.int8",
"numpy.zeros",
"numpy.compat.pickle.dumps",
"numpy.finfo",
"num... |
kudo1026/packnet-sfm | [
"b7c6230e1a093b1f096a9577616d40ada5e376e6"
] | [
"packnet_sfm/networks/layers/resnet/ds_decoder.py"
] | [
"# Copyright 2020 Toyota Research Institute. All rights reserved.\n\n# Adapted from monodepth2\n# https://github.com/nianticlabs/monodepth2/blob/master/networks/depth_decoder.py\n\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom co... | [
[
"torch.ones",
"torch.zeros",
"torch.nn.Tanh",
"numpy.array",
"torch.nn.Sigmoid"
]
] |
lcl1026504480/mfpython | [
"c1b1689a42488129299e31152764c535eb8e66e0"
] | [
"evolution/6.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Oct 9 21:25:15 2020\n\n@author: lenovouser\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nN_MOVES = 150\nDNA_SIZE = N_MOVES*2 # 40 x moves, 40 y moves\nDIRECTION_BOUND = [0, 1]\nCROSS_RATE = 0.8\nMUTATE_RATE = 0.0001\nPOP_SIZE = 100\nN_GEN... | [
[
"numpy.sqrt",
"numpy.zeros_like",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.pause",
"numpy.cumsum",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.ioff",
"numpy.exp",
"matplotlib.pyplot.xlim",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.random.rand",
"matpl... |
BroadDong/Caffe_2 | [
"c1a636983dc84a960d6abe150c996234d6f6278c"
] | [
"caffe2/python/rnn_cell.py"
] | [
"# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"numpy.array",
"numpy.append"
]
] |
Holmes-Alan/See360 | [
"24853246c126f883544bd618d622033f7a82c214"
] | [
"test_demo.py"
] | [
"from __future__ import print_function\r\nimport argparse\r\nfrom math import log10\r\n\r\nimport os\r\nimport torch\r\nimport torch.nn as nn\r\nfrom PIL import Image, ImageEnhance\r\nimport torch.backends.cudnn as cudnn\r\nimport torch.nn.functional as F\r\nfrom torch.utils.data import DataLoader\r\nfrom modules i... | [
[
"torch.load",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.no_grad",
"numpy.abs",
"torch.tensor",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"numpy.uint8"
]
] |
jminsk-cc/xarray | [
"48c680f8e631b0786989356e8360968bef551195"
] | [
"xarray/tests/test_combine.py"
] | [
"from collections import OrderedDict\nfrom datetime import datetime\nfrom itertools import product\n\nimport numpy as np\nimport pytest\n\nfrom xarray import (\n DataArray,\n Dataset,\n auto_combine,\n combine_by_coords,\n combine_nested,\n concat,\n)\nfrom xarray.core import dtypes\nfrom xarray.c... | [
[
"numpy.random.rand"
]
] |
miltondp/clustermatch-gene-expr | [
"664bcf9032f53e22165ce7aa586dbf11365a5827"
] | [
"nbs/others/05_clustermatch_profiling/10_cm_optimized/py/02-cdist_parts_v01.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# cell_metadata_filter: all,-execution,-papermill,-trusted\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.11.5\n# kernelspec:\n# display_name: Python 3 (ipykernel)\n# langu... | [
[
"numpy.random.seed",
"numpy.random.rand"
]
] |
bjwheltor/improver | [
"21b21106f2a7376ee32cd01f47ea81bb770f56a9"
] | [
"improver/ensemble_copula_coupling/ensemble_copula_coupling.py"
] | [
"# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# (C) British Crown Copyright 2017-2021 Met Office.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following c... | [
[
"numpy.logical_or",
"numpy.ma.is_masked",
"numpy.transpose",
"numpy.ma.masked_where",
"numpy.diff",
"numpy.ma.getmask",
"numpy.any",
"numpy.argsort",
"numpy.ma.filled",
"numpy.empty_like",
"numpy.random.RandomState",
"numpy.lexsort",
"numpy.ma.MaskedArray",
... |
dossett/incubator-airflow | [
"60583a3c6d1c4b5bbecaad6cd195301107530de9"
] | [
"airflow/www/views.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version... | [
[
"pandas.to_datetime",
"pandas.set_option"
]
] |
gkaramanolakis/ISWD | [
"41452f447284491cf8ade8e09f3bc4e314ec64f7"
] | [
"iswd/cotrain_experiments.py"
] | [
"#!/usr/bin/env python\nimport os\nfrom os.path import expanduser\nhome = expanduser(\"~\")\nimport sys\nimport h5py\nimport argparse\nfrom datetime import datetime\nfrom time import time\n\nimport numpy as np\nfrom numpy.random import permutation, seed\nfrom scipy.cluster.vq import kmeans\nimport glob\nimport torc... | [
[
"torch.nn.NLLLoss",
"numpy.sum",
"torch.Tensor",
"numpy.zeros",
"torch.cuda.manual_seed",
"torch.nn.functional.softmax",
"numpy.random.seed",
"numpy.argmax",
"torch.cuda.device_count",
"torch.nn.CrossEntropyLoss",
"torch.nn.KLDivLoss",
"torch.cuda.is_available",
... |
1Stohk1/tami | [
"e0aa902bb767631dd2435ed0eac05209b9bd64ed"
] | [
"models_code/nedo.py"
] | [
"from tensorflow.keras import layers\nfrom tensorflow.keras import models\nfrom tensorflow.keras.metrics import Precision, Recall, AUC\n\n\nclass NEDO:\n\n def __init__(self, num_classes, img_size, channels, name=\"nedo\"):\n self.name = name\n self.num_classes = num_classes\n self.input_wid... | [
[
"tensorflow.keras.metrics.Recall",
"tensorflow.keras.models.Sequential",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.metrics.Precision",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Con... |
ArgonneCPAC/bnlhack19 | [
"d399b2e200ec7dbd733c754b06c4bd368eb00e67"
] | [
"scripts/demo_cupy_rawkernel.py"
] | [
"import os, sys\n\nimport cupy as cp\nimport numpy as np\nfrom numba import cuda\n\nfrom chopperhack19.mock_obs.tests import random_weighted_points\nfrom chopperhack19.mock_obs.tests.generate_test_data import (\n DEFAULT_RBINS_SQUARED)\nfrom chopperhack19.mock_obs import chaining_mesh as cm\nfrom chopperhack19.m... | [
[
"numpy.sqrt",
"numpy.zeros_like"
]
] |
fdlm/ignite | [
"a22a0f5e909ac70d2a1f76a60b6e84b2134f196c"
] | [
"tests/ignite/contrib/engines/test_common.py"
] | [
"import os\n\nimport torch\nimport torch.nn as nn\n\nfrom ignite.engine import Events, Engine\nfrom ignite.contrib.engines.common import (\n setup_common_training_handlers,\n save_best_model_by_val_score,\n add_early_stopping_by_val_score,\n setup_tb_logging,\n setup_visdom_logging,\n)\n\nfrom ignite... | [
[
"torch.nn.Linear",
"torch.optim.SGD",
"torch.tensor",
"torch.cuda.device_count",
"torch.nn.parallel.DistributedDataParallel",
"torch.optim.lr_scheduler.StepLR"
]
] |
stjordanis/catalyst-1 | [
"84bc7576c981278f389279d87dda85dd66a758b6"
] | [
"catalyst/contrib/datasets/mnist.py"
] | [
"from typing import Any, Callable, Dict, List, Optional\nimport os\n\nimport torch\nfrom torch.utils.data import Dataset\n\nfrom catalyst.contrib.datasets.functional import (\n download_and_extract_archive,\n read_sn3_pascalvincent_tensor,\n)\nfrom catalyst.data.dataset.metric_learning import MetricLearningTr... | [
[
"torch.save"
]
] |
BalderOdinson/Deep-Learning-Lab | [
"70786ff1be40fc829d64a644585c1d5683c76538"
] | [
"deep-learning-lab-01/tf_logreg.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 28 22:39:01 2019\n\n@author: Oshikuru\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nimport data\n\nclass TFLogreg:\n def __init__(self, D, C, param_delta=0.5, param_lambda=1e-3):\n \"\"\"Arguments:\n - D: dimen... | [
[
"tensorflow.placeholder",
"tensorflow.zeros",
"tensorflow.initializers.global_variables",
"numpy.random.seed",
"numpy.argmax",
"tensorflow.matmul",
"matplotlib.pyplot.show",
"tensorflow.set_random_seed",
"numpy.max",
"tensorflow.Session",
"numpy.min",
"tensorflow.tr... |
gdsa-upc/K-LERA | [
"3f4b5fb1a6c4b3df4fde05eb55fbf3dc3815cce4"
] | [
"Scripts21-12-17/get_params.py"
] | [
"import os,sys\nimport pandas as pd\nimport numpy as np\n\ndef get_params():\n\n '''\n Define dictionary with parameters\n '''\n params = {} \n\n params['src'] = '/home/dani/Escritorio/K-LERA-master/Semana4_ok'\n \n # Source data\n params['root'] = '/home/dani/Escritorio/K-LERA-master/Seman... | [
[
"numpy.unique"
]
] |
betaros/traffic_sign | [
"6f5ef4afb7093c929cc2e94c7f72daebbd149b7e"
] | [
"src/traffic_sign.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\n\nimport cv2\n\nimport roslib\nroslib.load_manifest('traffic_sign')\nimport rospy\n\nfrom sensor_msgs.msg import CompressedImage\nfrom std_msgs.msg import String\n\nclass image_feature:\n def __init__(self):\n self.counter = 1;\n self.raspi_subscriber =... | [
[
"numpy.fromstring"
]
] |
yongpi-scu/TPRNet | [
"bc97169ebe4d123a64da6b0fdc787ecb89c7372f"
] | [
"utils/metrics.py"
] | [
"import numpy as np\r\ndef get_confusion_matrix(output,target):\r\n confusion_matrix = np.zeros((output[0].shape[0],output[0].shape[0]))\r\n for i in range(len(output)):\r\n true_idx = target[i]\r\n pred_idx = np.argmax(output[i])\r\n confusion_matrix[true_idx][pred_idx] += 1.0\r\n ret... | [
[
"numpy.argmax",
"numpy.zeros"
]
] |
ninastijepovic/MasterThesis | [
"2579f1e74c0ce404f350a6d441e273b6aef4eadc"
] | [
"train_unet.py"
] | [
"# import the necessary packages\nimport os\nimport argparse\nimport random\nimport pandas as pd\nimport numpy as np\nimport pickle\nimport matplotlib.pyplot as plt\nimport matplotlib\nfrom matplotlib import image, pyplot as plt\nfrom random import sample,randint\nmatplotlib.use(\"Agg\")\n\nfrom preprocessor import... | [
[
"sklearn.metrics.roc_curve",
"matplotlib.pyplot.grid",
"sklearn.metrics.auc",
"matplotlib.pyplot.savefig",
"tensorflow.python.keras.callbacks.ReduceLROnPlateau",
"tensorflow.python.keras.callbacks.ModelCheckpoint",
"matplotlib.pyplot.subplots",
"tensorflow.python.keras.optimizers.A... |
philippgualdi/PyQMRI | [
"5de3a7da5feb2d01b746acd47d1dba91a8a1417e"
] | [
"test/unittests/test_symmetrized_gradient_double.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 12 11:26:41 2019\n\n@author: omaier\n\"\"\"\n\nimport pyqmri\ntry:\n import unittest2 as unittest\nexcept ImportError:\n import unittest\nfrom pyqmri._helper_fun import CLProgram as Program\nfrom pkg_resources import resource_filenam... | [
[
"numpy.zeros_like",
"numpy.stack",
"numpy.random.randn",
"numpy.flip",
"numpy.testing.assert_allclose",
"numpy.array"
]
] |
g-mitu/timeseries | [
"3b2daf33f9af022d1aae7c4a9caf69b8abd58348"
] | [
"WritingNovel/show_matplotlib.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np # 导入包\r\n\r\nt1 = np.arange(0.0, 4.0, 0.1)\r\nt2 = np.arange(0.0, 4.0, 0.05) # 准备一些数据\r\n\r\nfig = plt.figure() # 准备好这张纸,并把句柄传给fig\r\nax1 = fig.add_subplot(211) # 使用句柄fig添加一个子图\r\nline1, = plt.plot(t1, np.sin(2 * np.pi * t1), '--*') # 绘图,将句柄返给line1\r\nplt.... | [
[
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure",
"numpy.cos",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.text",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.ylim",
... |
muntashir/movie-review-sentiment-classifier | [
"f850f4902186b4ac6bc62126fa333d8e9975a759"
] | [
"data.py"
] | [
"import os\r\nimport random\r\nimport json\r\nimport torch\r\nimport numpy as np\r\n\r\nVOCAB_SIZE = 89528\r\nMAX_LENGTH = 150\r\n\r\nclass Dataset:\r\n\r\n def __init__(self, data_dir):\r\n test_percent = 0.1\r\n validation_percent = 0.1\r\n\r\n # Index for minibatches\r\n self.data_... | [
[
"torch.zeros",
"torch.from_numpy",
"numpy.min",
"numpy.zeros"
]
] |
rmothukuru/probability | [
"24352279e5e255e054bfe9c7bdc7080ecb280fba"
] | [
"tensorflow_probability/python/bijectors/reciprocal.py"
] | [
"# Copyright 2018 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.compat.v2.name_scope",
"tensorflow.compat.v2.math.abs"
]
] |
SchetininVitaliy/AeroPy | [
"65a4c68fafcbd0bd04ee70ffa9d4a98302a45c6b"
] | [
"aeropy/filehandling/vtk.py"
] | [
"import numpy as np\n\ndef generate_surface(data, filename='panair') :\n '''\n Function to generate vtk files from a panair input mesh \n INPUT :\n - data is a list of networks which are 3D arrays with the dimensions being \n columns, rows, and coordinates)\n - 'filename' is a string to use in fil... | [
[
"numpy.ascontiguousarray",
"numpy.zeros"
]
] |
zamanashiq3/code-DNN | [
"c6133740fa272f9cac005b9ee754642b5bb20975"
] | [
"time_dis_cnn.py"
] | [
"\"\"\"\nMultiple stacked lstm implemeation on the lip movement data.\n\nAkm Ashiquzzaman\n13101002@uap-bd.edu\nFall 2016\n\n\"\"\"\nfrom __future__ import print_function\nimport numpy as np\nnp.random.seed(1337)\n#random seed fixing for reproducibility\n\n#data load & preprocessing \nX_train = np.load('../data/vid... | [
[
"numpy.load",
"numpy.save",
"numpy.random.seed"
]
] |
skat00sh/Handcrafted-DP | [
"d1f8bc004adc240d5c424a10bdcc30fc266c8218"
] | [
"log.py"
] | [
"import numpy as np\nimport os\nimport shutil\nimport sys\nfrom torch.utils.tensorboard import SummaryWriter\nimport torch\n\n\ndef model_input(data, device):\n datum = data.data[0:1]\n if isinstance(datum, np.ndarray):\n return torch.from_numpy(datum).float().to(device)\n else:\n return datu... | [
[
"torch.utils.tensorboard.SummaryWriter",
"torch.from_numpy"
]
] |
njcuk9999/jwst-mtl | [
"81d3e7ec6adc5dae180cd9d3bff8e4a2a7292596"
] | [
"SOSS/dms/soss_engine.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# TODO remove use of args and kwargs as much as possible for clearer code.\n\n# General imports.\nimport numpy as np\nfrom scipy.sparse import issparse, csr_matrix, diags\nfrom scipy.sparse.linalg import spsolve\nfrom scipy.interpolate import interp1d, Akima1DInterp... | [
[
"numpy.ones",
"numpy.sum",
"scipy.interpolate.interp1d",
"numpy.diff",
"matplotlib.pyplot.tight_layout",
"numpy.any",
"numpy.argsort",
"numpy.nansum",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"numpy.trapz",
"numpy.argmin",
"numpy.log10",
"numpy.... |
nevinkjohn/luminol | [
"42e4ab969b774ff98f902d064cb041556017f635"
] | [
"src/luminol/algorithms/anomaly_detector_algorithms/exp_avg_detector.py"
] | [
"# coding=utf-8\n\"\"\"\n© 2015 LinkedIn Corp. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicab... | [
[
"numpy.std"
]
] |
akilasadhish/Remote-sensing-scene-classification | [
"18c27648553f0db8c67c7df58b851aa27a4b4942"
] | [
"classification.py"
] | [
"import pandas as pd \r\nimport seaborn as sn\r\nimport numpy as np \r\nimport os\r\nfrom sklearn.metrics import accuracy_score, classification_report, confusion_matrix\r\nfrom matplotlib import pyplot as plt\r\n#csv_name:using predict.py and the csv file will be generated.\r\n#labels:A list. The list includes all ... | [
[
"numpy.sum",
"matplotlib.pyplot.legend",
"sklearn.metrics.classification_report",
"pandas.read_csv",
"matplotlib.pyplot.grid",
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.accuracy_score",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"numpy.round",
"matp... |
tianjuchen/pyro | [
"d5b0545c4f992d435692080db6969314a2c32f05"
] | [
"tests/distributions/test_zero_inflated.py"
] | [
"# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport math\n\nimport pytest\nimport torch\n\nfrom pyro.distributions import (\n Delta,\n NegativeBinomial,\n Normal,\n Poisson,\n ZeroInflatedDistribution,\n ZeroInflatedNegativeBinomial,\n ZeroInflate... | [
[
"torch.ones",
"torch.randn",
"torch.rand",
"torch.tensor",
"torch.zeros"
]
] |
makram93/executors | [
"9e88b56650ee154e811b8ecfaf883861475c082f"
] | [
"tests/integration/psql_dump_reload/test_dump_psql.py"
] | [
"import os\nimport time\nfrom collections import OrderedDict\nfrom pathlib import Path\nfrom typing import Dict\n\nimport numpy as np\nimport pytest\nfrom jina import Flow, Document, Executor, DocumentArray, requests\nfrom jina.logging.profile import TimeContext\nfrom jina_commons.indexers.dump import (\n import... | [
[
"numpy.random.random",
"numpy.testing.assert_allclose"
]
] |
FrederichRiver/neutrino | [
"e91db53486e56ddeb83ae9714311d606b33fb165"
] | [
"applications/alkaid/alkaid/phoenix.py"
] | [
"#!/usr/bin/python3\n# from strategy_base import strategyBase\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader, Dataset\n\ninput_size = 4\nhidden_size = 4 * input_size\nnum_layers = 1\nseq_len = 10\nbatch_size = 20\n\n\nclass strategyBase(object):\n def __init__(self):\n pass\... | [
[
"torch.utils.data.DataLoader",
"torch.nn.LSTM",
"torch.nn.Linear",
"torch.randn",
"pandas.DataFrame",
"torch.nn.CrossEntropyLoss",
"numpy.array"
]
] |
DSPLab-IC6/ikfs_anomaly_detector | [
"e0a36e185be6e9dcd75451c956a2aaf6a6fec677"
] | [
"ikfs_anomaly_detector/intellectual/tests.py"
] | [
"import unittest\n\nimport numpy as np\n\nfrom ikfs_anomaly_detector.intellectual.autoencoder import LSTMAutoencoder\nfrom ikfs_anomaly_detector.intellectual.predictor import LSTMPredictor\nfrom ikfs_anomaly_detector.intellectual.utils import (\n z_normalization,\n calculate_mean,\n find_anomaly_points,\n ... | [
[
"numpy.array"
]
] |
yoshihikosuzuki/pbcore | [
"956c45dea8868b5cf7d9b8e9ce98ac8fe8a60150"
] | [
"pbcore/io/align/BamIO.py"
] | [
"# Author: David Alexander\n\n\n\n\n__all__ = [ \"BamReader\", \"IndexedBamReader\" ]\n\ntry:\n from pysam.calignmentfile import AlignmentFile # pylint: disable=no-name-in-module, import-error, fixme, line-too-long\nexcept ImportError:\n from pysam.libcalignmentfile import AlignmentFile # pylint: disable=no-n... | [
[
"numpy.array",
"numpy.flatnonzero",
"numpy.rec.fromrecords",
"numpy.zeros"
]
] |
jschuhmac/qiskit-nature | [
"b8b1181d951cf8fa76fe0db9e5ea192dad5fb186"
] | [
"test/problems/second_quantization/lattice/models/test_fermi_hubbard_model.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ... | [
[
"numpy.array",
"numpy.testing.assert_array_equal"
]
] |
walterddr/nestedtensor | [
"2818db1d83dbd475aa54aee3ab84749a4c13e911"
] | [
"nestedtensor/nested/fuser.py"
] | [
"import torch.fx as fx\nfrom typing import Type, Dict, Any, Tuple, Iterable\nimport torch\nimport copy\nfrom torch.fx import symbolic_trace\nimport time\n\ndef _parent_name(target : str) -> Tuple[str, str]:\n \"\"\"\n Splits a qualname into parent path and last atom.\n For example, `foo.bar.baz` -> (`foo.b... | [
[
"torch.fx.GraphModule",
"torch.fx.symbolic_trace"
]
] |
QiXi9409/Simultaneous_ECG_Heartbeat | [
"8984084d570a0e45bf3508a1a23d562ba147ca84"
] | [
"rcn_tool_b.py"
] | [
"from rcn_tool_a import rcn_tool_a\r\nimport torch\r\nfrom config import cfg\r\nclass rcn_tool_b(rcn_tool_a):\r\n def roi_pooling_cuda(self, features, proposal, label=None, stride=cfg.feature_stride, pool=None, batch=False):\r\n if batch == True:\r\n batch_output = []\r\n batch_label... | [
[
"torch.stack"
]
] |
pquochuy/SeqSleepNet | [
"ae0b4bd72aec456d0ef6fe15589ef17cdb9468e3"
] | [
"tensorflow_net/E2E-ARNN/train_arnn_sleep.py"
] | [
"import os\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0,-1\"\nimport numpy as np\nimport tensorflow as tf\n\n#from tensorflow.python.client import device_lib\n#print(device_lib.list_local_devices())\n\nimport shutil, sys\nfrom datetime import datetime\nimport h5py\n\nfrom arnn_sleep import ARNN_Sleep\nfrom arnn_sleep_... | [
[
"tensorflow.initialize_all_variables",
"tensorflow.train.global_step",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.all_variables",
"numpy.reshape",
"tensorflow.train.AdamOptimizer",
"tensorflow.Graph",
"sklearn.metrics.accuracy_score",
"numpy.expand_dims",
"tensorflow... |
AdityaSavara/Frhodo | [
"90ad23b8f238bd2b4dd9b94eea757fa658e92499"
] | [
"src/mech_fcns.py"
] | [
"# This file is part of Frhodo. Copyright © 2020, UChicago Argonne, LLC\n# and licensed under BSD-3-Clause. See License.txt in the top-level \n# directory for license and copyright information.\n\nimport os, io, stat, contextlib, pathlib, time\nimport cantera as ct\nfrom cantera import interrupts, cti2yaml#, ck2yam... | [
[
"numpy.sort",
"numpy.hstack",
"numpy.power",
"numpy.shape",
"numpy.isnan",
"numpy.array",
"numpy.concatenate",
"numpy.linspace"
]
] |
Jos33y/student-performance-knn | [
"4e965434f52dd6a1380904aa257df1edfaebb3c4"
] | [
"venv/Lib/site-packages/sklearn/tree/tests/test_reingold_tilford.py"
] | [
"import numpy as np\r\nimport pytest\r\nfrom sklearn.tree._reingold_tilford import buchheim, Tree\r\n\r\nsimple_tree = Tree(\"\", 0,\r\n Tree(\"\", 1),\r\n Tree(\"\", 2))\r\n\r\nbigger_tree = Tree(\"\", 0,\r\n Tree(\"\", 1,\r\n Tree(\"\", ... | [
[
"sklearn.tree._reingold_tilford.Tree",
"sklearn.tree._reingold_tilford.buchheim",
"numpy.unique"
]
] |
samueljamesbell/scikit-optimize | [
"c53998816481d150ccc745ffd07d022fdb1fd25d"
] | [
"examples/utils.py"
] | [
"# Module to import functions from in examples for multiprocessing backend\nimport numpy as np\n\n\ndef obj_fun(x, noise_level=0.1):\n return np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2)) +\\\n np.random.randn() * noise_level\n"
] | [
[
"numpy.sin",
"numpy.random.randn",
"numpy.tanh"
]
] |
smiledinisa/SimpleCVReproduction | [
"c6ac180887472a920d86b6eb15f933294b65dcec"
] | [
"RL/actor_critic.py"
] | [
"import argparse\nimport gym\nimport numpy as np\nfrom itertools import count\nfrom collections import namedtuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.distributions import Categorical\n\n# Cart Pole\n\nparser = argparse.ArgumentParser(descr... | [
[
"torch.stack",
"torch.nn.Linear",
"torch.distributions.Categorical",
"torch.manual_seed",
"torch.tensor",
"torch.from_numpy",
"numpy.finfo"
]
] |
mjchi7/CS234 | [
"c476714aafcd880c4d7707799d9556dfb2de24a6"
] | [
"assignment2/core/deep_q_learning.py"
] | [
"import os\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport time\r\n\r\nfrom q_learning import QN\r\n\r\n\r\nclass DQN(QN):\r\n \"\"\"\r\n Abstract class for Deep Q Learning\r\n \"\"\"\r\n def add_placeholders_op(self):\r\n raise NotImplementedError\r\n\r\n\r\n def get_q_values_op(se... | [
[
"tensorflow.summary.scalar",
"tensorflow.placeholder",
"tensorflow.summary.merge_all",
"tensorflow.global_variables_initializer",
"numpy.argmax",
"tensorflow.cast",
"tensorflow.train.Saver",
"tensorflow.Session",
"tensorflow.summary.FileWriter"
]
] |
shkarupa-alex/segme | [
"d5bc0043f9e709c8ccaf8949d662bc6fd6144006"
] | [
"segme/model/f3_net/model.py"
] | [
"import tensorflow as tf\nfrom keras import models, layers\nfrom keras.utils.generic_utils import register_keras_serializable\nfrom keras.utils.tf_utils import shape_type_conversion\nfrom .decoder import Decoder\nfrom ...backbone import Backbone\nfrom ...common import ConvBnRelu, HeadActivation, HeadProjection, res... | [
[
"tensorflow.TensorSpec"
]
] |
syakoo/galois-field | [
"e642adfa7da55f6cd95cadceb0116cdea379c181"
] | [
"galois_field/core/gcd.py"
] | [
"from typing import Tuple\n\nimport numpy as np\n\nfrom . import modulus, inverse\n\n\ndef gcd_poly(poly1: np.poly1d, poly2: np.poly1d, p: int) -> np.poly1d:\n \"\"\"Seek the gcd of two polynomials over Fp.\n\n Args:\n poly1 (np.poly1d): A polynomial.\n poly2 (np.poly1d): A polynomial.\n ... | [
[
"numpy.poly1d",
"numpy.polydiv"
]
] |
sghislandi/GSSI_Numerical_Methods_2020-2021 | [
"171853ff2d99560565783bdd2e0f3a9e0c4c5ca5"
] | [
"pyplots/simpson_integration/error_plotter.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport os.path\n\n#Reading the output\nflag = 0\nif os.path.exists('../../build/output/simpson_integration/simpson_approximation_errors_v1.txt'):\n flag = 1\n N, deviation = np.loadtxt('../../build/output/simpson_integration/simpson_approximation_errors_v1... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"numpy.log10",
"matplotlib.pyplot.ylabel",
"numpy.polyfit",
"numpy.sqrt",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"numpy.loadtxt"
]
] |
woonzh/semantics | [
"8689acb5af7be689318486aea10da812aa383bb4"
] | [
"modeling.py"
] | [
"# coding=utf-8\r\n# Copyright 2018 The Google AI Language Team Authors.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE... | [
[
"tensorflow.reshape",
"tensorflow.ones",
"tensorflow.variable_scope",
"tensorflow.matmul",
"tensorflow.squeeze",
"tensorflow.one_hot",
"tensorflow.slice",
"tensorflow.get_variable_scope",
"tensorflow.concat",
"tensorflow.nn.softmax",
"tensorflow.contrib.layers.layer_nor... |
GinoBacallao/openai-python | [
"88bbe08947bceb10845b335d7f4cfb5ff406d948"
] | [
"examples/embeddings/utils.py"
] | [
"import openai\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom tenacity import retry, wait_random_exponential, stop_after_attempt\nfrom sklearn.metrics import precision_recall_curve\nfrom sklearn.metrics import average_precision_score\n\n\n@retry(wait=wait_random_exponential(min=1,... | [
[
"matplotlib.pyplot.legend",
"numpy.linalg.norm",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gcf",
"sklearn.metrics.precision_recall_curve",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot... |
elsa-burren/easy-neuralnetwork | [
"249149397016c104dd963c17a580f3fe45397191"
] | [
"myNN.py"
] | [
"# myNN.py\n# tested with Python3.7\n# author: Elsa Burren\n\nimport numpy as np\n\ndef sigmoid(x):\n return 1 / (1 + np.exp(-x))\n\nclass MyNode:\n def __init__(self, w):\n self.w = w\n def update(self, dw):\n self.w += dw\n def output(self, x):\n return sigmoid(np.dot(x, self.w))... | [
[
"numpy.zeros",
"numpy.dot",
"numpy.exp",
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.plot",
"numpy.inner",
"numpy.linspace"
]
] |
teshima058/3d_pose_baseline_openpose | [
"a5103a6db6df3cb34590bf68ddb179d4e543ffb2"
] | [
"src/poseVisualizer.py"
] | [
"import matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\n# pose.shape : ({joint_num}, 3)\n# index_list : np.arange({joint_num})\ndef visualizePose(pose, mode=None, fig_scale=1, index_list=None,):\n fig = plt.figure()\n ax = fig.add_subplot(111 , projection='3d')\n for i,p in enumerate(p... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
megcrow/kinetic-schemes | [
"d1f5c5cc95481554e2d68a69b3b8663f9501df3d"
] | [
"functions/blasi.py"
] | [
"\"\"\"\nFunctions for Blasi 1993 and Blasi Branca 2001 kinetic reaction schemes for\nbiomass pyrolysis. See comments in each function for more details.\n\nReferences:\nBlasi, 1993. Combustion Science and Technology, 90, pp 315–340.\nBlasi, Branca, 2001. Ind. Eng. Chem. Res., 40, pp 5547-5556.\n\"\"\"\n\nimport num... | [
[
"numpy.exp"
]
] |
sethusaim/Automatic-Number-Plate-Recognition | [
"8b26008f8511e52600b150157901079e0fd0ebfe"
] | [
"base2designs/utils/vrd_evaluation.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.ones",
"numpy.sum",
"numpy.empty",
"numpy.zeros",
"numpy.maximum",
"numpy.dtype",
"numpy.setdiff1d",
"numpy.isin",
"numpy.array",
"numpy.concatenate",
"numpy.unique",
"numpy.minimum"
]
] |
nuannuanhcc/ps_reppoint | [
"abf9a82f53e5812936d0eed46f417c4500ffe151"
] | [
"mmdetection/mmdet/models/anchor_heads/anchor_head.py"
] | [
"from __future__ import division\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom mmcv.cnn import normal_init\n\nfrom mmdet.core import (AnchorGenerator, anchor_target, delta2bbox, force_fp32,\n multi_apply, multiclass_nms)\nfrom ..builder import build_loss\nfrom ..registry im... | [
[
"numpy.ceil",
"torch.nn.Conv2d",
"torch.cat"
]
] |
gongzhitaao/adversarial-classifier | [
"ded40b5b319fe13e8eb40147113e9fced53433ed"
] | [
"src/figure_1.py"
] | [
"import os\n# supress tensorflow logging other than errors\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom keras import backend as K\nfrom keras.datasets import mnist\nfrom keras.models import Sequential, load_model\nfrom keras.layers import Dense, Dropout, Activatio... | [
[
"numpy.load",
"tensorflow.placeholder",
"numpy.save",
"numpy.empty",
"numpy.squeeze",
"numpy.ceil",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.random.choice",
"numpy.argmax",
"tensorflow.InteractiveSession",
"numpy.max",
"numpy.all",
"ma... |
dreadbird06/tso_vace_wpe | [
"3e9d9d9b0ebe3d3e360e678af5960ff23d57eae2"
] | [
"run.py"
] | [
"\"\"\"\nExample codes for speech dereverberation based on the WPE variants.\n\nauthor: Joon-Young Yang (E-mail: dreadbird06@gmail.com)\n\"\"\"\nimport os\n# os.environ[\"CUDA_VISIBLE_DEVICES\"]=args.gpu_id\n\nimport numpy as np\nimport soundfile as sf\n\nimport torch\ntorch.set_printoptions(precision=10)\n\nfrom t... | [
[
"torch.set_printoptions",
"torch.no_grad",
"numpy.random.choice",
"torch.from_numpy",
"torch.cuda.is_available",
"numpy.stack",
"torch.device"
]
] |
faridsaud/ML-Snippets | [
"4e846e7dde63480c34f51329f261aef73040b0d6"
] | [
"UnsupervisedLearning/HerarchicalClustering/Hierarchical Clustering Lab.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Hierarchical Clustering Lab\n# In this notebook, we will be using sklearn to conduct hierarchical clustering on the [Iris dataset](https://archive.ics.uci.edu/ml/datasets/iris) which contains 4 dimensions/attributes and 150 samples. Each sample is labeled as one of the... | [
[
"scipy.cluster.hierarchy.dendrogram",
"sklearn.metrics.adjusted_rand_score",
"matplotlib.pyplot.figure",
"scipy.cluster.hierarchy.linkage",
"matplotlib.pyplot.show",
"sklearn.preprocessing.normalize",
"sklearn.cluster.AgglomerativeClustering",
"sklearn.datasets.load_iris"
]
] |
aassumpcao/tseresearch | [
"8c46a81fddee1f2a18b35a28a32dfe0a1f294750"
] | [
"scripts/10_tse_sentence_classification.py"
] | [
"### electoral crime and performance paper\n# judicial decisions script\n# this script uses the trained models to predict sentence categories. i\n# use the textual info in the sentences to determine the (class)\n# allegations against individual candidates running for office.\n# author: andre assumpcao\n# by and... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"scipy.sparse.load_npz",
"sklearn.externals.joblib.load",
"pandas.concat"
]
] |
tylertownsend/bingo | [
"0aeebe03df71a632f833c56ceb9c697dddbe78fc"
] | [
"tests/Base/test_continuous_local_optimization.py"
] | [
"# Ignoring some linting rules in tests\n# pylint: disable=redefined-outer-name\n# pylint: disable=missing-docstring\nimport pytest\nimport numpy as np\n\nfrom bingo.Base.FitnessFunction import FitnessFunction, VectorBasedFunction\nfrom bingo.Base.ContinuousLocalOptimization import ContinuousLocalOptimization\nfrom... | [
[
"numpy.sqrt",
"numpy.linalg.norm",
"numpy.mean"
]
] |
ruizca/astromatch | [
"14fa56768149d0d292b939248560210c17d6d3b1"
] | [
"astromatch/priors.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nastromatch module for calculation of magnitude priors.\n\n@author: A.Ruiz\n\"\"\"\nimport os\nimport warnings\n\nimport numpy as np\nfrom astropy import units as u\nfrom astropy.table import Table\nfrom astropy.utils.exceptions import AstropyUserWarning\nfrom scipy.interpolate impo... | [
[
"numpy.zeros_like",
"scipy.interpolate.interp1d",
"numpy.nanmax",
"numpy.zeros",
"numpy.diff",
"numpy.histogram",
"matplotlib.pyplot.savefig",
"numpy.savetxt",
"scipy.ndimage.convolve",
"numpy.nanmin",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplo... |
predictive-analytics-lab/pgmpy | [
"6c2a31641adc72793acd130d007190fdb1632271"
] | [
"pgmpy/factors/discrete/JointProbabilityDistribution.py"
] | [
"import itertools\nfrom operator import mul\n\nimport numpy as np\n\nfrom pgmpy.factors.discrete import DiscreteFactor\nfrom pgmpy.independencies import Independencies\nfrom pgmpy.extern.six.moves import range, zip\nfrom pgmpy.extern import six\n\n\nclass JointProbabilityDistribution(DiscreteFactor):\n \"\"\"\n ... | [
[
"numpy.sum"
]
] |
Deci-AI/super-gradients | [
"bfed440ecaf485af183570bf965eb5b74cb9f832"
] | [
"src/super_gradients/training/losses/r_squared_loss.py"
] | [
"from __future__ import print_function, absolute_import\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn.modules.loss import _Loss\n\nfrom super_gradients.training.utils import convert_to_tensor\n\n\nclass RSquaredLoss(_Loss):\n\n def forward(self, output, target):\n # FIXME - THIS NEEDS TO BE CHANGE... | [
[
"torch.var",
"torch.nn.MSELoss"
]
] |
lucyundead/athena--fork | [
"04a4027299145f61bdc08528548e0b1b398ba0a6"
] | [
"tst/regression/scripts/tests/pgen/hdf5_reader_serial.py"
] | [
"# Serial test script for initializing problem with preexisting array\n\n# Standard modules\nimport sys\n\n# Other modules\nimport logging\nimport numpy as np\nimport h5py\n\n# Athena modules\nimport scripts.utils.athena as athena\nsys.path.insert(0, '../../vis/python')\nimport athena_read # noqa\nathena_read.chec... | [
[
"numpy.vstack",
"numpy.sum",
"numpy.ones",
"numpy.empty",
"numpy.zeros",
"numpy.arange",
"numpy.all",
"numpy.where"
]
] |
cbfinn/ray | [
"18f9fe0e2b85d04f22e3e04907bbfacadca4bc2d"
] | [
"examples/a3c/runner.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom collections import namedtuple\nimport numpy as np\nimport tensorflow as tf\nimport six.moves.queue as queue\nimport scipy.signal\nimport threading\n\n\ndef discount(x, gamma):\n return scipy.sign... | [
[
"numpy.asarray",
"tensorflow.Summary"
]
] |
perathambkk/ml-techniques | [
"5d6fd122322342c0b47dc65d09c4425fd73f2ea9"
] | [
"text/naivebayes.py"
] | [
"\"\"\"\nAuthor: Peratham Wiriyathammabhum\n\n\n\"\"\"\nimport numpy as np \nimport pandas as pd \nimport scipy as sp\nimport matplotlib.pyplot as plt \nimport scipy.sparse.linalg as linalg\n\ndef naivebayes(X):\n\t\"\"\"\n\tPerform spectral clustering on an input row matrix X.\n\tmode \\in {'affinity','neighborhoo... | [
[
"numpy.argmin",
"scipy.sparse.linalg.eigs",
"sklearn.feature_extraction.text.CountVectorizer"
]
] |
Crypto-TII/syndrome_decoding_estimator | [
"c7d9aaeed83708dbf5db3c45a007c0010a1225c8"
] | [
"sd_estimator/estimator.py"
] | [
"from .theoretical_estimates import *\nfrom math import inf, ceil, log2, comb\nfrom prettytable import PrettyTable\nfrom progress.bar import Bar\nfrom scipy.special import binom as binom_sp\nfrom scipy.optimize import fsolve\nfrom warnings import filterwarnings\n\nfilterwarnings(\"ignore\", category=RuntimeWarning)... | [
[
"scipy.special.binom",
"scipy.optimize.fsolve"
]
] |
Siddhant085/tensorflow | [
"6f6161a0110d99b2655efc9d933b753dadadbc38"
] | [
"tensorflow/contrib/boosted_trees/estimator_batch/estimator_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.feature_column.feature_column_lib.numeric_column",
"tensorflow.contrib.layers.python.layers.feature_column.real_valued_column",
"tensorflow.python.platform.googletest.main",
"tensorflow.python.estimator.canned.head._binary_logistic_head_with_sigmoid_cross_entropy_loss",
"ten... |
aliabdelkader/FusionTransformer | [
"4175e13a3633a6c6b8b2aa44beb94a89acf7307f"
] | [
"FusionTransformer/common/utils/torch_util.py"
] | [
"import random\nimport numpy as np\nimport torch\n\n\ndef set_random_seed(seed):\n if seed < 0:\n return\n random.seed(seed)\n np.random.seed(seed)\n torch.manual_seed(seed)\n torch.cuda.manual_seed(seed)\n torch.cuda.manual_seed_all(seed)\n torch.backends.cudnn.deterministic = True\n ... | [
[
"torch.cuda.manual_seed_all",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.initial_seed",
"numpy.random.seed",
"torch.IntTensor"
]
] |
beiyan1911/conditional_aia_generation | [
"0ace640d6e8dae41b63f26809a494b88cc3718e2"
] | [
"models/base_model.py"
] | [
"import os\nfrom abc import ABC, abstractmethod\nfrom collections import OrderedDict\nimport torch.optim as optim\nimport torch\nfrom models import net_utils\n\n\nclass BaseModel(ABC):\n\n def __init__(self, config):\n self.config = config\n self.isTrain = config.isTrain\n self.device = conf... | [
[
"torch.optim.lr_scheduler.CosineAnnealingLR"
]
] |
andrejromanov/dd-trace-py | [
"661011e891d4699006614b1a238096d7140cc55c"
] | [
"tests/tracer/test_span.py"
] | [
"# -*- coding: utf-8 -*-\nimport time\nfrom unittest.case import SkipTest\n\nimport mock\nimport pytest\n\nfrom ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY\nfrom ddtrace.constants import ENV_KEY\nfrom ddtrace.constants import SERVICE_VERSION_KEY\nfrom ddtrace.constants import SPAN_MEASURED_KEY\nfrom ddtrace.... | [
[
"numpy.int64"
]
] |
marwahaha/dit | [
"feaa7dfa87b4f6067039be4ac05c7e645fdcec3c"
] | [
"dit/profiles/base_profile.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nThe base information profile.\n\"\"\"\n\nfrom abc import ABCMeta, abstractmethod\n\nfrom six import with_metaclass\n\nimport numpy as np\n\n\nprofile_docstring = \"\"\"\n{name}\n\nStatic Attributes\n-----------------\nxlabel : str\n The label for the x-a... | [
[
"matplotlib.pyplot.figure",
"numpy.isclose"
]
] |
lgasyou/spark-scheduler-configuration-optimizer | [
"05c0ea9411db642c7c7e675a6949ffcc6814947a"
] | [
"optimizer/environment/yarn/statebuilder.py"
] | [
"from typing import Tuple\n\nimport requests\nimport torch\nfrom requests.exceptions import ConnectionError\n\nfrom optimizer.hyperparameters import STATE_SHAPE\nfrom optimizer.environment.yarn.yarnmodel import *\nfrom optimizer.environment.spark.sparkapplicationtimedelaypredictor import SparkApplicationTimeDelayPr... | [
[
"torch.zeros",
"torch.Tensor"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.