repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
dependencyInversion/UdemyML
[ "9e1a0a01688a82c61ef006a592a58c12fb186552" ]
[ "Chapter2_Python/NumpyIntro.py" ]
[ "import numpy as np\n\nlist1 = np.array([-2, 1, 2, -10, 22, -10])\nlist2 = np.array([-20, 123, 112, -10, 22, -120])\n\nprint(\n f\"values: {list1}\",\n f\"min: {np.min(list1)}\",\n f\"max: {np.max(list1)}\",\n f\"mean: {np.mean(list1)}\",\n f\"median: {np.median(list2)}\",\n sep=\"\\n\",\n end=...
[ [ "numpy.median", "numpy.max", "numpy.min", "numpy.array", "numpy.mean" ] ]
RobZelluf/RL_pong
[ "55c8feeb9c43c1c11d6fd8924660e8038138cf7e" ]
[ "DQN_SAA/DQN_SAA.py" ]
[ "from wimblepong import Wimblepong\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport numpy as np\nfrom utils import Transition, ReplayMemory\n\n\nclass Q_CNN(nn.Module):\n def __init__(self, state_space, action_space, size, fc1_size=64):\n ...
[ [ "torch.stack", "torch.nn.Linear", "torch.load", "numpy.zeros", "torch.argmax", "torch.no_grad", "torch.tensor", "torch.cuda.is_available", "torch.nn.Conv2d", "torch.from_numpy", "torch.zeros", "torch.cat", "torch.Tensor", "torch.cuda.set_device" ] ]
adellanno/MetaXcan
[ "cfc9e369bbf5630e0c9488993cd877f231c5d02e" ]
[ "software/metax/misc/KeyedDataSource.py" ]
[ "import gzip\nimport io\nimport pandas\n\nfrom .. import Utilities\n\ndef try_parse(string, fail=None):\n try:\n return float(string)\n except Exception:\n return fail;\n\ndef skip_na(key, value):\n skip = (not value or value == \"NA\")\n return skip\n\ndef skip_non_rsid_value(key, value):...
[ [ "pandas.DataFrame" ] ]
simonfqy/DTI_prediction
[ "e01c592cc06c4de04b3ed6db35da5af5ff7f863f" ]
[ "davis_data/preprocess.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\nimport pandas as pd\nimport argparse\nimport os\nimport sys\nimport pdb\nimport csv\n\n\ndef generate_data(input_csv, binarize=False, head_o...
[ [ "numpy.array", "numpy.log10", "numpy.isnan" ] ]
zjjszj/PS_DM_mydetector_faster_rcnn_pytorch
[ "f1d3ad0711ca6b606f05dfee3ed223edd0ea699f" ]
[ "faster_rcnn/datasets/imdb.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\nimport os\nimport os.path as osp\nimport PIL\nimport numpy ...
[ [ "numpy.vstack", "numpy.zeros_like", "numpy.zeros", "numpy.arange", "numpy.hstack", "numpy.sort", "numpy.where" ] ]
vberthiaume/vblandr
[ "dbd139e7b6172b9dbc97707ff4874bc398de7aaa" ]
[ "mnist/mainMnist.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.contrib.learn.python.learn.datasets.mnist.read_data_sets", "tensorflow.initialize_all_variables", "tensorflow.matmul", "tensorflow.name_scope", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.Variable", "tensorflow.nn.in_top_k", "tensorflow.train.S...
mawanda-jun/NoLabels
[ "6861867ad5ab49fc7ae6f562977f60195f9ff216" ]
[ "Dataset/generate_hamming_set.py" ]
[ "\"\"\"\nThis file generates a set of most distant permutations from each other. This is only a support dataset: this will be useful\nwhen we will crop each image and reorder them in those distances.\nThis is a kind of mathematical distribution, no data are loaded here.\n\"\"\"\n\nimport numpy as np\nimport itertoo...
[ [ "numpy.array", "numpy.random.randint", "scipy.spatial.distance.cdist", "numpy.delete" ] ]
Gnupur/scikit-learn
[ "513695f1e4f7613f988159333bfccc59358879dd" ]
[ "sklearn/ensemble/_voting.py" ]
[ "\"\"\"\nSoft Voting/Majority Rule classifier and Voting regressor.\n\nThis module contains:\n - A Soft Voting/Majority Rule classifier for classification estimators.\n - A Voting regressor for regression estimators.\n\"\"\"\n\n# Authors: Sebastian Raschka <se.raschka@gmail.com>,\n# Gilles Louppe <g.louppe...
[ [ "numpy.hstack", "numpy.bincount" ] ]
andreasala98/pykeen
[ "205af6c2604b3882bf0adf275610bceb6ac53c0c" ]
[ "src/pykeen/triples/triples_numeric_literals_factory.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Implementation of factory that create instances containing of triples and numeric literals.tsv.\"\"\"\n\nimport logging\nimport pathlib\nfrom typing import Any, Dict, Optional, TextIO, Tuple, Union\n\nimport numpy as np\nimport torch\n\nfrom .triples_factory import TriplesFactory\n...
[ [ "torch.as_tensor", "numpy.ndarray.flatten" ] ]
Fanping/ai.example
[ "452a8c00e58a6c3a27ab78a2b4a30bdd054ef165" ]
[ "10.Face-Generated-With-GAN/face_generated_gan_model.py" ]
[ "import tensorflow as tf\n\n\nclass FaceGANModel(object):\n def __init__(self, batch_size=64, learning_rate=1e-3):\n # 1. Define input.\n self.input_image = tf.placeholder(tf.float32, [batch_size, 40 * 55],\n name=\"input_image\")\n self.input_prior =...
[ [ "tensorflow.placeholder", "tensorflow.nn.tanh", "tensorflow.zeros", "tensorflow.truncated_normal", "tensorflow.train.AdamOptimizer", "tensorflow.matmul", "tensorflow.concat", "tensorflow.slice", "tensorflow.log" ] ]
Fngg/contact_tracing
[ "0df5d859fe7b89ac6539d409af8e6cec86f32137" ]
[ "src/service.py" ]
[ "'''\n流调查询\n'''\nfrom settings_class import settings_obj\nimport pandas as pd\nfrom util.logger import logger\nfrom sqlalchemy import desc\nfrom datetime import datetime,timedelta\n\n\ndef get_forward_backward_time(current_time, minutes):\n # 获取向前和向后的时间\n if isinstance(current_time,str):\n current = da...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
HsiuWen/FairMOT
[ "67c4fe4b5ce11f960251bd8d0cdfd37622194e29" ]
[ "src/lib/datasets/dataset/jde.py" ]
[ "import glob\nimport math\nimport os\nimport os.path as osp\nimport random\nimport time\nfrom collections import OrderedDict\n\nimport cv2\nimport json\nimport numpy as np\nimport torch\nimport copy\n\nfrom torch.utils.data import Dataset\nfrom torchvision.transforms import transforms as T\nfrom cython_bbox import ...
[ [ "numpy.ones", "torch.stack", "matplotlib.pyplot.imshow", "matplotlib.pyplot.plot", "numpy.ascontiguousarray", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.fliplr", "torch.from_numpy", "matplotlib.use", "numpy.eye", "numpy.zeros", "matplotlib.p...
llichengtong/yx1
[ "6619532e43799fea739a21fb14b999f7d1898fe9" ]
[ "h_RNN/Mnist.py" ]
[ "import time\r\nimport tflearn\r\nimport numpy as np\r\nimport tensorflow as tf\r\n\r\nfrom h_RNN.RNN import RNNWrapper, Generator\r\nfrom h_RNN.SpRNN import SparseRNN\r\nfrom Util.Util import DataUtil\r\n\r\n\r\nclass MnistGenerator(Generator):\r\n def __init__(self, im=None, om=None, one_hot=True):\r\n ...
[ [ "tensorflow.reset_default_graph" ] ]
vamsigp/EVA5
[ "e03603cbf41f8d18d2e0ac149ddc5718371a360e" ]
[ "trainer/trainer.py" ]
[ "from __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom tqdm import tqdm\n\n\nclass Trainer():\n\n def __init__(self, model, device, train_loader, test_loader, optimizer, loss_func, lr_scheduler):\n self.is_last_epoch ...
[ [ "torch.no_grad", "torch.max" ] ]
AlantheBenign/Minecraft-Stronghold-Finder
[ "05d3eb89eaccd3620fa25cd4c828c907aecf2178" ]
[ "finder.py" ]
[ "import numpy as np\n\n#hitCircle calculates where the first stronghold generation ring starts, where the player would \"hit\" it, moving directly forward\n#and calculates the position to the second ender eye throw\ndef hitCircle(pX,pZ,angle):\n xHit = None\n yHit = None\n cos = np.cos(angle*np.pi/180)\n ...
[ [ "numpy.sqrt", "numpy.tan", "numpy.linspace", "numpy.cos" ] ]
OliverScherf/mlir-emitc
[ "af6a34bee5563bf71a218a93139da0e25cd9b2a5" ]
[ "scripts/optimize_tf_dialect.py" ]
[ "# 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 to in writing, software\n# dist...
[ [ "tensorflow.python.pywrap_mlir.experimental_run_pass_pipeline" ] ]
V4I2021/V4IBack
[ "88c6215d65eccae42cde18515d1da84d94c45ba6" ]
[ "dataService/dataService.py" ]
[ "import datetime\nimport os\nimport pandas as pd\nfrom flask_caching import Cache\nimport seaborn as sns\nfrom scipy.stats import pearsonr\n\nimport numpy as np\nimport math\n\nfrom sklearn.cluster import DBSCAN\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.preprocessing import StandardScaler\n\n...
[ [ "numpy.vstack", "numpy.zeros_like", "numpy.cumsum", "scipy.stats.pearsonr", "pandas.read_csv", "sklearn.cluster.DBSCAN", "sklearn.linear_model.LinearRegression", "pandas.to_datetime", "pandas.merge", "sklearn.preprocessing.StandardScaler", "numpy.array" ] ]
tfederico/human_dynamics
[ "ab7ab6aefce5ec33c208091710a37624a1a6ef4a" ]
[ "src/discriminators.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\n\n\nclass PoseDiscriminator(object):\n def __init__(self, weight_decay):\n self.vars = []\n self.reuse = False\n ...
[ [ "tensorflow.stack", "tensorflow.contrib.slim.conv2d", "tensorflow.contrib.slim.fully_connected", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.contrib.slim.flatten", "tensorflow.contrib.framework.get_variables", "tensorflow.variable_scope", "tensorflow.contrib.slim.arg_scop...
mohanadhammad/dlnd-sagemaker-deployment
[ "ad1da6fc928e351f6782d1a9c180e0910b67b702" ]
[ "Project/train/train.py" ]
[ "import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport torch\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\ndef model_fn(model_dir):\n \"\"\"Load the PyTorch model from the `model_dir` directory.\...
[ [ "torch.utils.data.DataLoader", "torch.load", "torch.manual_seed", "torch.save", "torch.cuda.is_available", "torch.from_numpy", "torch.nn.BCELoss", "torch.utils.data.TensorDataset" ] ]
yuhongsun96/PySyft
[ "36f624ec47336d58fb73504c0817aa988a678626" ]
[ "packages/syft/src/syft/core/node/common/client.py" ]
[ "# stdlib\nimport sys\nfrom typing import Any\nfrom typing import Dict\nfrom typing import Iterator\nfrom typing import List\nfrom typing import Optional\nfrom typing import Tuple\nfrom typing import Union\n\n# third party\nfrom google.protobuf.reflection import GeneratedProtocolMessageType\nfrom nacl.signing impor...
[ [ "pandas.DataFrame" ] ]
ibivu/protein-glue
[ "47f68b4789c6750dfb9bf6d6ae382a9061514bfd" ]
[ "dataset/ss3.py" ]
[ "from numpy import float32\nimport tensorflow as tf\nimport constants as c\n\ndef _parse_example(example_proto):\n features = {\n \"sequence\": tf.io.FixedLenFeature((), tf.string, default_value=\"\"),\n \"ss3\": tf.io.VarLenFeature(tf.int64),\n \"ss8\": tf.io.VarLenFeature(tf.int64)\n }\...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.io.parse_single_example", "tensorflow.sparse.to_dense", "tensorflow.shape", "tensorflow.ones_like", "tensorflow.io.decode_raw", "tensorflow.cast", "tensorflow.io.FixedLenFeature", "tensorflow.io.VarLenFeature" ] ]
gabrieldemarmiesse/tracks_separation
[ "81b0b1cb0bce269a76403ad5e16c3e0469160f40" ]
[ "converter.py" ]
[ "from glob import glob\nfrom tqdm import tqdm as tq\nfrom scipy.io.wavfile import read, write\nfrom resampy import resample\nnew_rate = 16000\npath = \"./data/DSD100_16kHz/Sources/*/*/*.wav\"\n\nfor file in tq(glob(path)):\n rate, array = read(file)\n new_array = resample(array,rate, new_rate, axis=0)\n wr...
[ [ "scipy.io.wavfile.write", "scipy.io.wavfile.read" ] ]
Yu-AnChen/tabbi
[ "bf4655905d0f3fc5b7dd49a1cd12c69cb83e5bb5" ]
[ "tabbi/gmm.py" ]
[ "import sklearn.mixture\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom matplotlib import ticker\r\nimport matplotlib.patheffects as mpatheffects\r\n\r\n\r\ndef get_gmm_and_pos_label(\r\n array, n_components=2, n_steps=5000\r\n):\r\n gmm = sklearn.mixture.GaussianMixture(\r\n n_compone...
[ [ "matplotlib.pyplot.tight_layout", "numpy.log1p", "numpy.ediff1d", "numpy.argmin", "matplotlib.pyplot.get_cmap", "numpy.absolute", "numpy.expm1", "numpy.linspace", "numpy.round", "numpy.mean", "numpy.sqrt", "matplotlib.ticker.ScalarFormatter", "numpy.argmax", ...
Dtananaev/tf_lstm_depth
[ "94f83e8671e8928eba24eac6936a02cd9d123686" ]
[ "layers/conv.py" ]
[ "#\n# Author: Denis Tananaev\n# File: conv.py\n# Date: 9.02.2017\n# Description: convolution functions for neural networks\n#\n\n#include libs\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n#import os\nfrom six.moves import xrange\n#import os\n#impor...
[ [ "tensorflow.constant_initializer", "tensorflow.add_to_collection", "tensorflow.truncated_normal_initializer", "tensorflow.nn.bias_add", "tensorflow.nn.atrous_conv2d", "tensorflow.device", "tensorflow.reshape", "tensorflow.sqrt", "tensorflow.variable_scope", "tensorflow.nn.l...
ravi-0841/spect-pitch-gan
[ "ea4b9ea8396df753e25e0b2cb210288f683d3903" ]
[ "utils/convert.py" ]
[ "import argparse\nimport os\nimport numpy as np\nimport librosa\nimport scipy.io.wavfile as scwav\nimport scipy.signal as scisig\nimport pylab\nimport numpy.matlib as npmat\n\nimport utils.preprocess as preproc\nfrom utils.helper import smooth, generate_interpolation\n#from nn_models.model_embedding_wasserstein imp...
[ [ "numpy.sum", "numpy.transpose", "scipy.signal.medfilt", "numpy.squeeze", "numpy.reshape", "numpy.matlib.repmat", "numpy.where", "numpy.expand_dims", "numpy.max", "numpy.min", "numpy.ascontiguousarray", "numpy.mean" ] ]
fabibo3/pytorch3d
[ "36b7656753ae759aed2eb7ffb432b6eca4d42fe2" ]
[ "pytorch3d/io/experimental_gltf_io.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\n\n\"\"\"\nThis module implements loading meshes from glTF 2 assets stored in a\nGLB container file or ...
[ [ "torch.FloatTensor", "numpy.transpose", "numpy.dtype", "torch.from_numpy", "numpy.prod", "numpy.array", "numpy.frombuffer" ] ]
dmnlk/namedivider-python
[ "d87a488d4696bc26d2f6444ed399d83a6a1911a7" ]
[ "namedivider/name_divider.py" ]
[ "import numpy as np\nimport pandas as pd\nimport regex\nfrom namedivider.divided_name import DividedName\nfrom namedivider.kanji_statistics import KanjiStatistics\nfrom pathlib import Path\nfrom typing import Optional\nCURRENT_DIR = Path(__file__).resolve().parent\n\n\nclass NameDivider:\n def __init__(self, pat...
[ [ "numpy.sum", "pandas.read_csv", "numpy.exp", "numpy.array", "numpy.concatenate" ] ]
siril-pivotchain/ETAG-OCR
[ "216c27e8ab63acc5b3686da2948a6881da70350e" ]
[ "keras_ocr/recognition.py" ]
[ "# pylint: disable=invalid-name,too-many-locals,too-many-arguments\nimport typing\nimport string\n\nimport tensorflow as tf\nfrom tensorflow import keras\nimport numpy as np\nimport cv2\n\nfrom . import tools\n\nDEFAULT_BUILD_PARAMS = {\n 'height': 31,\n 'width': 200,\n 'color': False,\n 'filters': (64,...
[ [ "numpy.ones", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Concatenate", "tensorflow.reshape", "tensorflow.ones", "tensorflow.keras.layers.Lambda", "tensorflow.matmul", "tensorflow.linspace", "tensorflow.keras.models.Model", "tensorflow.keras.backend.cast", ...
tomoino/GagRocket
[ "1f0bbef1a48cc12774d11bc380f0b72b9ffaf9f1" ]
[ "src/humorcalc.py" ]
[ "import numpy as np\nfrom keras.models import load_model\nimport MeCab\nimport re\n\ndef calc_humor_score(text, model, word_index):\n (words, reading) = morph(text)\n if not is_dajare(reading):\n return 0\n \n return predict(words, model, word_index)\n \ndef morph(text):\n words = [] # 単語の原...
[ [ "numpy.array" ] ]
LukasDegitz/kge
[ "0ff3d2623d520e0634374e81d4184d525c189a25" ]
[ "kge/model/hmcn_model.py" ]
[ "import torch\nfrom torch import Tensor\nfrom kge import Config, Dataset\nfrom kge.model.kge_model import KgeModel\nimport json\nimport os\nimport numpy as np\nimport time\n\nclass hmcn_model(KgeModel):\n\n \"\"\"\n Implements hierarchical Multi-Label classification Network as defined in Wehrmann et al. (...
[ [ "torch.stack", "torch.nn.Linear", "torch.logical_or", "torch.nn.BatchNorm1d", "torch.nn.init.normal_", "torch.nn.ReLU", "torch.from_numpy", "torch.nn.ModuleList", "torch.max", "numpy.array", "torch.sigmoid", "torch.cat", "torch.nn.Dropout" ] ]
EricPWilliamson/bhattacharyya-distance
[ "d67498d58bed342151c9d820a520254a503abdc8" ]
[ "bhatta_dist.py" ]
[ "\"\"\"\r\nThe function bhatta_dist() calculates the Bhattacharyya distance between two classes on a single feature.\r\n The distance is positively correlated to the class separation of this feature. Four different methods are\r\n provided for calculating the Bhattacharyya coefficient.\r\n\r\nCreated on 4/14/...
[ [ "numpy.histogram", "scipy.stats.gaussian_kde", "numpy.log", "numpy.array", "numpy.concatenate", "numpy.unique" ] ]
zenetio/AI-4-Clinical-Workflow
[ "7128f2eeafb5e5fc5a70e7c3770847ca1c924dea" ]
[ "src/inference/UNetInferenceAgent.py" ]
[ "\"\"\"\nContains class that runs inferencing\n\"\"\"\nimport torch\nimport numpy as np\n\nfrom networks.RecursiveUNet import UNet\n\nfrom utils.utils import med_reshape\n\nclass UNetInferenceAgent:\n \"\"\"\n Stores model and parameters and some methods to handle inferencing\n \"\"\"\n def __init__(sel...
[ [ "torch.load", "numpy.zeros", "torch.argmax", "numpy.max", "numpy.min" ] ]
WouterKoch/Naturalis_data_preparation
[ "05d60d2913838297d30959ccf1388028ac8553bc" ]
[ "combine.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nimport os\nimport sys\nimport hashlib\n\ndef generateId(image_url, prefix, exisiting_ids):\n id = f\"{prefix}:{hashlib.md5(image_url.encode()).hexdigest()}\"\n # while id in exisiting_ids:\n # print(f\"id {id} exists!\")\n # image_...
[ [ "pandas.read_csv", "pandas.merge", "pandas.concat", "numpy.absolute", "pandas.isna" ] ]
dcdanko/MetaSUB_CAP
[ "db5672b0206afb3ffe3204b0577a4a5f84b9bcd4" ]
[ "scripts/beta_diversity_stats.py" ]
[ "#! /usr/bin/env python3\n\n\nimport sys\nimport click\nfrom scipy.spatial.distance import pdist, squareform\nfrom scipy.stats import gmean, entropy\nfrom numpy.linalg import norm\nimport numpy as np\nfrom math import sqrt\nfrom json import dumps as jdumps\nimport pandas as pd\n\n\nclass LevelNotFoundException(Exce...
[ [ "scipy.spatial.distance.pdist", "numpy.divide", "scipy.stats.gmean", "numpy.var", "pandas.DataFrame", "scipy.stats.entropy", "numpy.log", "numpy.linalg.norm" ] ]
PratyushTripathy/momepy
[ "eac89eaff63dd6cb35dfd9a736981723ec77f496" ]
[ "momepy/graph.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# connectivity.py\n# definitions of connectivity characters\nimport math\nimport warnings\n\nimport networkx as nx\nimport numpy as np\nfrom tqdm import tqdm\n\n__all__ = [\n \"node_degree\",\n \"meshedness\",\n \"mean_node_dist\",\n \"cds_length\",\n ...
[ [ "numpy.mean" ] ]
yangguohao/Paddle
[ "81622708a7c904092185ef04897b1e81629f51a6" ]
[ "python/paddle/fluid/tests/unittests/auto_parallel/test_dist_context.py" ]
[ "# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.random" ] ]
siddharthteotia/arrow
[ "b33dfd9c6bd800308bb1619b237dbf24dea159be" ]
[ "python/pyarrow/tests/test_convert_pandas.py" ]
[ "# -*- coding: utf-8 -*-\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 2....
[ [ "pandas.Series", "numpy.random.seed", "pandas.Categorical", "numpy.int64", "pandas.util.testing.assert_series_equal", "numpy.float64", "pandas.period_range", "numpy.ma.masked_array", "pandas.to_numeric", "numpy.testing.assert_array_equal", "pandas.util.testing.rands", ...
pattonw/diluvian
[ "3df1e0666f6e65c7719f703e629239b7f0493f86" ]
[ "diluvian/volumes.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Volumes of raw image and labeled object data.\"\"\"\n\n\nfrom __future__ import division\n\nfrom collections import namedtuple\nimport csv\nimport logging\nimport os\nimport re\n\nimport h5py\nimport math\nimport numpy as np\nfrom PIL import Image\nimport pytoml as toml\nimport reque...
[ [ "numpy.ones", "numpy.multiply", "numpy.array_str", "numpy.any", "numpy.issubdtype", "numpy.asarray", "numpy.random.RandomState", "numpy.full_like", "numpy.transpose", "numpy.where", "numpy.fromstring", "numpy.minimum", "scipy.ndimage.label", "numpy.zeros", ...
DavidNaizheZhou/stanpy
[ "257072bd52154e9e4d68be957fd12eee1ad3dc56" ]
[ "tests/src/stanpy/test_reduction.py" ]
[ "import stanpy as stp\nimport numpy as np\nimport os\ndir_path = os.path.dirname(os.path.realpath(__file__))\n\ndef test_multiple_w0():\n\n EI = 32000 # kN/m2\n l = 3 # m\n\n hinged_support = {\"w\": 0, \"M\": 0}\n roller_support = {\"w\": 0, \"M\": 0, \"H\": 0}\n fixed_support = {\"w\": 0, \"phi\"...
[ [ "numpy.load", "numpy.set_printoptions", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.testing.assert_allclose", "numpy.linspace" ] ]
lleiou/causalml
[ "2d3cacacad5ed3b0e57b593803a33c61c554f3b2" ]
[ "causalml/inference/tree/models.py" ]
[ "\"\"\"\nForest of trees-based ensemble methods for Uplift modeling on Classification\nProblem. Those methods include random forests and extremely randomized trees.\n\nThe module structure is the following:\n- The ``UpliftRandomForestClassifier`` base class implements different\n variants of uplift models based on...
[ [ "numpy.sqrt", "numpy.sum", "numpy.sign", "numpy.zeros", "pandas.DataFrame", "numpy.random.seed", "numpy.percentile", "numpy.clip", "numpy.log", "sklearn.utils.testing.ignore_warnings", "numpy.min", "numpy.array", "numpy.unique", "numpy.mean" ] ]
Open-Speech-EkStep/speech_music_classification
[ "0e394ec0f0d0ac7a177171f7ac7c254b1db38c2a" ]
[ "check.py" ]
[ "import torch\nfrom torch.utils.data import DataLoader\n\nfrom configs.train_config import SpectConfig\nfrom loader.data_loader import SpectrogramDataset, collate_fn\nfrom models.model import Conformer, get_conv_output_sizes\n\nif __name__ == \"__main__\":\n spect_cfg = SpectConfig()\n songs_dset = Spectrogra...
[ [ "torch.utils.data.DataLoader" ] ]
buzem/inzpeech
[ "9e03b876bb3fd1956774c84683cd02661d650c81" ]
[ "models/model_keras_params.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nfrom tensorflow.keras.models import Sequential, Model\nfrom tensorflow.keras.layers import Dense, Input\nfrom tensorflow.keras.layers import Dropout, GlobalMaxPooling2D\nfrom tensorflow.keras.layers import Flatten, Conv2D, MaxPooling2D, ...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.initializers.GlorotUniform", "tensorflow.keras.backend.softmax", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Reshape", "tensorflow.keras.backend.square", "tensorflow.matmul"...
latticetower/dr-derks-mutants
[ "5c3ab86137ecb478a3013985172d160568a86b13" ]
[ "experiments/train_v1.py" ]
[ "\"\"\"Basic 'network'.\n\nThis code is based on example\nhttp://docs.gym.derkgame.com/#neural-network-example\n\"\"\"\nimport gym\nfrom gym_derk.envs import DerkEnv\nfrom gym_derk import ObservationKeys\nimport math\nimport numpy as np\nimport os.path\n\nfrom models.network_v1 import Network\n\nSEED = 137\nnp.rand...
[ [ "numpy.load", "numpy.random.seed", "numpy.asarray", "numpy.argmax", "numpy.savez_compressed" ] ]
TingFree/AI_Conference_Timeline
[ "788dd5a4a8cd5009d8de3a1306ddb38f044cc7c5" ]
[ "codes/nlper/models/text_clf.py" ]
[ "r\"\"\"\n各种文本分类模型的实现\n\"\"\"\n\nimport os\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\nfrom torch.optim import AdamW\nfrom torch.utils.data import DataLoader\nfrom transformers import AutoModel\nfrom transformers.models.bert.modeling_bert import BertModel\nfrom transformers import DataColl...
[ [ "torch.utils.data.DataLoader", "torch.nn.functional.softmax", "torch.optim.AdamW", "torch.nn.Dropout" ] ]
shadiakiki1986/garage
[ "095bb5d25b32df1d44b47e99a78a9b01796941d9" ]
[ "garage/replay_buffer/simple_replay_buffer.py" ]
[ "\"\"\"This module implements a simple replay buffer.\"\"\"\nimport numpy as np\n\nfrom garage.misc.overrides import overrides\nfrom garage.replay_buffer.base import ReplayBuffer\n\n\nclass SimpleReplayBuffer(ReplayBuffer):\n \"\"\"\n This class implements SimpleReplayBuffer.\n\n It uses random batch sampl...
[ [ "numpy.random.randint" ] ]
Jee-King/STNet
[ "221ab60c4fccfce5a03e8878fb168e0baa7152f4" ]
[ "videoanalyst/model/backbone/backbone_impl/snn3.py" ]
[ "# -*- coding: utf-8 -*\n# --------------------------------------------------------\n# SNNformer Feature Extractor (SFE) - SNN branch\n# --------------------------------------------------------\n\nimport torch.nn as nn\nimport torch\n\nfrom videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES,\n ...
[ [ "torch.nn.BatchNorm2d", "torch.min", "torch.ones", "torch.nn.AdaptiveAvgPool2d", "torch.count_nonzero", "torch.where", "torch.log", "torch.nn.Conv2d", "torch.max", "torch.zeros", "torch.histc", "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.mean" ] ]
tobsen2code/pyleecan
[ "1faedde4b24acc6361fa1fdd4e980eaec4ca3a62" ]
[ "Tests/Plot/LamWind/test_Slot_12_plot.py" ]
[ "# -*- coding: utf-8 -*-\nfrom os.path import join\n\nimport matplotlib.pyplot as plt\nfrom numpy import array, pi, zeros\n\nfrom pyleecan.Classes.Frame import Frame\nfrom pyleecan.Classes.LamSlotWind import LamSlotWind\nfrom pyleecan.Classes.LamSquirrelCage import LamSquirrelCage\nfrom pyleecan.Classes.MachineDFIM...
[ [ "matplotlib.pyplot.gcf", "matplotlib.pyplot.close" ] ]
brianhie/icml18-jtnn
[ "fabede920d7def1d248c3157dd31f7cc5a2132e0" ]
[ "jtnn/datautils.py" ]
[ "from torch.utils.data import Dataset\nfrom .mol_tree import MolTree\nimport numpy as np\n\nclass MoleculeDataset(Dataset):\n\n def __init__(self, data_file):\n with open(data_file) as f:\n self.data = [line.strip(\"\\r\\n \").split()[0] for line in f]\n\n def __len__(self):\n return ...
[ [ "numpy.loadtxt" ] ]
Takezo87/torchtools
[ "4230305d9063dabee3614f0dcd8557739b90f817" ]
[ "torchtools/models.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: 01_models.ipynb (unless otherwise specified).\n\n__all__ = ['noop', 'shortcut', 'Inception', 'InceptionBlock', 'InceptionTime', 'Squeeze', 'Unsqueeze', 'Add', 'Concat',\n 'Permute', 'Transpose', 'View', 'Reshape', 'Max', 'LastStep', 'Noop', 'TransformerModel',\...
[ [ "torch.nn.functional.softmax", "torch.rand", "torch.nn.ModuleList", "torch.nn.AdaptiveAvgPool1d", "torch.cat", "torch.nn.Dropout", "torch.nn.modules.transformer.TransformerEncoderLayer", "torch.nn.modules.transformer.TransformerEncoder", "torch.nn.BatchNorm1d", "torch.sign"...
mehak-sachdeva/mgwr
[ "eae8ac3d61ecbbba60b180e9ed8bab074bfb3522" ]
[ "mgwr/gwr.py" ]
[ "# Main GWR classes\n\n__author__ = \"Taylor Oshan Tayoshan@gmail.com\"\n\nimport copy\nimport numpy as np\nimport numpy.linalg as la\nfrom scipy.stats import t\nfrom scipy.special import factorial\nfrom itertools import combinations as combo\nfrom spglm.family import Gaussian, Binomial, Poisson\nfrom spglm.glm imp...
[ [ "numpy.sum", "numpy.ones", "numpy.diag", "numpy.random.seed", "numpy.log", "numpy.cov", "numpy.transpose", "numpy.abs", "numpy.ndarray", "numpy.identity", "numpy.zeros", "scipy.stats.t.ppf", "numpy.arange", "numpy.hstack", "numpy.std", "numpy.array",...
XiaoSanchez/autophase
[ "3d8d173ad27b9786e36efd22d0ceacbcf1cb1dfb" ]
[ "algos/rl/policies.py" ]
[ "# Code in this file is copied and adapted from\n# https://github.com/openai/evolution-strategies-starter.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport gym\nimport numpy as np\nimport tensorflow as tf\n\nimport ray\nfrom ray.rllib.evalua...
[ [ "numpy.array", "numpy.random.randn", "tensorflow.global_variables_initializer" ] ]
koetjen/steinbock
[ "b0abcc16120f7a028167cc0a6f9b4f78d010844b" ]
[ "steinbock/preprocessing/imc.py" ]
[ "import logging\nimport numpy as np\nimport pandas as pd\nimport re\n\nfrom os import PathLike\nfrom pathlib import Path\nfrom scipy.ndimage import maximum_filter\nfrom typing import (\n Generator,\n List,\n Optional,\n Sequence,\n Tuple,\n Union,\n)\n\nfrom steinbock import io\n\ntry:\n from r...
[ [ "numpy.ones", "scipy.ndimage.maximum_filter", "pandas.UInt8Dtype", "pandas.concat", "pandas.StringDtype", "pandas.BooleanDtype", "numpy.where" ] ]
abarcis/robot-framework
[ "a2cef7850784ae4c12b47fc7fb297f3772c2e2fe" ]
[ "robot_framework/position_feedback/px4.py" ]
[ "#! /usr/bin/env python\n\nfrom pyquaternion import Quaternion\nimport numpy as np\n\nfrom rclpy.node import Node\nfrom px4_msgs.msg import VehicleGlobalPosition\n\n\nclass PX4PositionFeedback:\n def __init__(self, system_state, time_delta):\n self.node = Node('position_feedback')\n self.system_sta...
[ [ "numpy.array" ] ]
bb912/MATS-DRS
[ "6e1ae9ba3b865e321d6a2d100d29693b776e1d36" ]
[ "autograph/play/maze_nn_aut_adv.py" ]
[ "import math\nimport os\nimport signal\nimport sys\nfrom typing import Callable, Any, Tuple, List, Union, Optional\n\nimport ptan\nimport torch\nimport torch.nn.functional as F\nfrom tensorboardX import SummaryWriter\nfrom torch import multiprocessing\nfrom torch.optim import Adam, SGD\n\nimport autograph.lib.envs....
[ [ "torch.nn.functional.softmax", "torch.multiprocessing.freeze_support", "torch.multiprocessing.set_start_method", "torch.cuda.is_available", "torch.device", "torch.Tensor" ] ]
EricUrbineer/OpenAeroStruct
[ "26c37a0e86074517680405687824e27b3b2caaec" ]
[ "openaerostruct/aerodynamics/panel_forces.py" ]
[ "from __future__ import print_function\nimport numpy as np\n\nfrom openmdao.api import ExplicitComponent\n\nfrom openaerostruct.utils.vector_algebra import compute_cross, compute_cross_deriv1, compute_cross_deriv2\n\n\nclass PanelForces(ExplicitComponent):\n \"\"\"\n Compute the panel forces acting on all sur...
[ [ "numpy.arange", "numpy.ones", "numpy.eye", "numpy.zeros" ] ]
MiseryForMe/MDC
[ "470b2db76a71d7e4260de7e39e6cf9a61c80ca2b" ]
[ "evaluate.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\n\nimport numpy as np\nimport cv2\nfrom PIL import Image\nfrom tqdm import tqdm\nimport logging\nimport importlib\nimport argparse\nimport os.path as osp\nimport sys\nimport math...
[ [ "numpy.logical_or", "numpy.sum", "numpy.bincount", "torch.load", "numpy.zeros", "numpy.diag", "torch.flip", "torch.nn.functional.softmax", "numpy.logical_and", "torch.no_grad", "torch.zeros", "torch.exp", "numpy.argmax", "numpy.logical_not", "numpy.mean"...
CaoQiNeng/python-classifier-2021
[ "a6350988e7ecf0453aac2655f5b0d8af1e538bfc" ]
[ "resnet.py" ]
[ "# -*- coding: utf-8 -*-\n'''\nupdate: 2021/5/18 lym\n'''\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nfrom torchsummary import summary\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152...
[ [ "torch.nn.functional.softplus", "torch.nn.AdaptiveAvgPool1d", "torch.nn.init.kaiming_uniform_", "torch.nn.Dropout", "torch.nn.BatchNorm1d", "torch.randn", "torch.tanh", "torch.unsqueeze", "torch.nn.MaxPool1d", "torch.nn.LSTM", "torch.nn.Conv1d", "torch.sum", "to...
kew96/GraphcoreExamples
[ "22dc0d7e3755b0a7f16cdf694c6d10c0f91ee8eb" ]
[ "applications/popart/bert/phased_execution/bert_layers.py" ]
[ "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ...
[ [ "numpy.arange", "numpy.sqrt", "numpy.array", "numpy.greater_equal" ] ]
zkneupper/audio
[ "1f136671b84071a2fe1d5b762df64f3a76310c31" ]
[ "examples/pipeline_wav2letter/main.py" ]
[ "import argparse\nimport logging\nimport os\nimport string\nfrom datetime import datetime\nfrom time import time\n\nimport torch\nimport torchaudio\nfrom torch.optim import SGD, Adadelta, Adam, AdamW\nfrom torch.optim.lr_scheduler import ExponentialLR, ReduceLROnPlateau\nfrom torch.utils.data import DataLoader\nfro...
[ [ "torch.utils.data.DataLoader", "torch.jit.script", "torch.optim.lr_scheduler.ExponentialLR", "torch.no_grad", "torch.cuda.is_available", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.cuda.empty_cache", "torch.distributed.init_process_group", "torch.cuda.device_count", ...
EnergyModels/estorage
[ "0f84c87632dba1ff0564ffb68f59ece314f67022" ]
[ "estorage/archive/state.py" ]
[ "from CoolProp.CoolProp import PropsSI\nimport pandas as pd\n\n\nclass State:\n self.fluid = T\n self.T = T\n self.p = p\n self.h = PropsSI('H', 'T', T, 'P', p, fluid)\n self.s = PropsSI('S', 'T', T, 'P', p, fluid)\n self.D = PropsSI('D', 'T', T, 'P', p, fluid)\n\n\nclass Flow(State):\n self.m_...
[ [ "pandas.Series" ] ]
kerwinxu/rqalpha_local
[ "f90da95085df91706ebba8fc905b4cdc85492b11" ]
[ "rqalpha/mod/rqalpha_mod_sys_analyser/plot.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Last Change: 2018-01-09 09:24:03\n# Copyright 2017 Ricequant, 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/lic...
[ [ "matplotlib.pyplot.style.use", "matplotlib.pyplot.legend", "numpy.maximum.accumulate", "matplotlib.pyplot.figure", "matplotlib.image.imread", "matplotlib.pyplot.savefig", "numpy.argmax", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.font_manager.FontPro...
novid1134/solar-3d
[ "1e5b77173abb0d805b3cc613e0a7ab3f063fb7e3" ]
[ "uvf.py" ]
[ "# universal variable formulation, 3rd order differential equation solver for orbital prediction,\n# implemented due to huge efficiency issues when using conventional methods (loops, recursion),\n# algorithms based on Vectorized Analytic Two Body Propagator in MATLAB Copyright (c) 2012, Darin Koblick\n\nfrom scipy....
[ [ "scipy.spatial.distance.cdist", "numpy.sign", "numpy.any", "numpy.argmax", "numpy.tan", "numpy.delete", "numpy.sqrt" ] ]
hecoding/pytorch-lightning-bolts
[ "4d254fde6112b21436003028d553a726bf7ea6ef" ]
[ "tests/models/self_supervised/test_scripts.py" ]
[ "from unittest import mock\n\nimport pytest\nimport torch\n\nfrom tests import DATASETS_PATH\n\n\n@pytest.mark.parametrize('cli_args', [\n f\"--data_dir {DATASETS_PATH} --max_epochs 1 --max_steps 3 --fast_dev_run --batch_size 2\"\n])\ndef test_cli_run_self_supervised_amdim(cli_args):\n \"\"\"Test running CLI ...
[ [ "torch.cuda.is_available" ] ]
arokem/picard
[ "1ca98a51b60bc51bfcf8767dea989cc4f5b8b522" ]
[ "picard/_tools.py" ]
[ "# Authors: Pierre Ablin <pierre.ablin@inria.fr>\n# Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Jean-Francois Cardoso <cardoso@iap.fr>\n#\n# License: BSD (3-clause)\nimport numbers\n\nimport numpy as np\n\n\ndef permute(A, scale=True):\n '''Get a permutation to diagonalize and scale a m...
[ [ "numpy.sum", "numpy.diag", "numpy.abs", "numpy.arange", "numpy.random.RandomState", "numpy.max", "numpy.sqrt", "numpy.dot" ] ]
VitaNova1998/REP
[ "abc640dfca1b23237770b0508f79c45b84baf81b" ]
[ "utils/audio_utils.py" ]
[ "import numpy as np\nimport librosa\nfrom scipy import signal\nimport fnmatch\nimport os\n\n\ndef preemphasis(x, coeff=0.97):\n return signal.lfilter([1, -coeff], [1], x)\n\n\ndef inv_preemphasis(x, coeff=0.97):\n return signal.lfilter([1], [1, -coeff], x)\n\n\ndef griffin_lim(stft_matrix_,\n n...
[ [ "scipy.signal.lfilter", "numpy.abs", "numpy.exp", "numpy.random.random" ] ]
judyheflin/amazon-s3-plugin-for-pytorch
[ "38284c8a5e92be3bbf47b08e8c90d94be0cb79e7" ]
[ "examples/s3_cv_map_example.py" ]
[ "\nfrom awsio.python.lib.io.s3.s3dataset import S3Dataset\nfrom torch.utils.data import DataLoader\n\nurl_list = ['s3://image-data-bucket/train/n01440764/n01440764_10026.JPEG',\n 's3://image-data-bucket/train/n01440764/n01440764_10027.JPEG',\n 's3://image-data-bucket/train/n01440764/n01440764_10029.JPEG']\n\ndatase...
[ [ "torch.utils.data.DataLoader" ] ]
dvav/clonosGP
[ "e7f9a08869df0e1857fe24e4e311999f7ba6560f" ]
[ "run_models_on_simulated_data.py" ]
[ "import os\nimport sys\n\nIDX = int(sys.argv[1])\nos.environ['THEANO_FLAGS'] = f'base_compiledir=\"theano/p{IDX}\"'\n\nimport tqdm as tqd\nimport itertools as itr\nimport numpy as nmp\nimport pandas as pnd\nimport sklearn.metrics as mtr\nimport scipy.special as scp\n\nimport pymc3 as pmc\nimport clonosGP as cln\n\n...
[ [ "pandas.read_csv", "sklearn.metrics.adjusted_rand_score", "sklearn.metrics.adjusted_mutual_info_score", "numpy.random.seed", "pandas.concat", "sklearn.metrics.fowlkes_mallows_score" ] ]
CancerDataScience/NuCLS
[ "c172b55b18d4ea78c3f51a8fd28ee6c2595c8360" ]
[ "TorchUtils.py" ]
[ "import torch\nimport nucls_model.torchvision_detection_utils.transforms as tvdt\n\n\nISCUDA = torch.cuda.is_available()\n\n\ndef tensor_isin(arr1, arr2):\n r\"\"\" Compares a tensor element-wise with a list of possible values.\n See :func:`torch.isin`\n\n Source: https://github.com/pytorch/pytorch/pull/26...
[ [ "torch.cuda.is_available" ] ]
jingjieli95/UnarySim
[ "c03386efdbb8151f3c33f34b44d1d6a6fc960434" ]
[ "test/kernel/test_kernel_exp_comb.py" ]
[ "# %%\nimport torch\nimport math\nfrom UnarySim.kernel.exp import expN1\nfrom UnarySim.stream.gen import RNG, SourceGen, BSGen\nfrom UnarySim.metric.metric import ProgError\nimport matplotlib.pyplot as plt\nimport time\nimport math\nimport numpy as np\n\n# %%\ndef exp_comb_test(bw=8, mode=\"unipolar\", rng=\"Sobol\...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.tight_layout", "torch.no_grad", "numpy.abs", "torch.tensor", "matplotlib.pyplot.subplots", "matplotlib.pyplot.xlim", "numpy.arange", "numpy.max", "matplotlib.pyplot.ylabel", "numpy.min", "matplotlib.pyplot.ylim", "mat...
ilvcd/Flux.jl
[ "d22479318b5f2a19a0003f3201d9b145b4562f9f" ]
[ "u2net.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport torch\nimport torch.nn as nn\nimport math\nimport time\n# class REBNCONVs(nn.Module):\n# def __init__(self,in_ch=3,out_ch=3,dirate=1):\n# super(REBNCONVs,self).__init__()\n\n# self.conv_s1 = nn.Conv2d(in_ch,out_ch,3,...
[ [ "torch.nn.BatchNorm2d", "torch.ones", "torch.nn.MaxPool2d", "torch.nn.functional.avg_pool2d", "torch.nn.functional.conv2d", "torch.nn.functional.upsample", "torch.nn.functional.relu", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.cat", "torch.nn.functional.interpolate" ]...
daniel-dr-rojas/scipy
[ "8e418e38fe6c88105eeae8eeb53248d19a8286fb" ]
[ "scipy/special/_precompute/lambertw.py" ]
[ "\"\"\"Compute a Pade approximation for the principle branch of the\nLambert W function around 0 and compare it to various other\napproximations.\n\n\"\"\"\nimport numpy as np\n\ntry:\n import mpmath # type: ignore[import]\n import matplotlib.pyplot as plt\nexcept ImportError:\n pass\n\n\ndef lambertw_pad...
[ [ "numpy.meshgrid", "matplotlib.pyplot.subplots", "numpy.exp", "matplotlib.pyplot.show", "numpy.log", "numpy.array", "numpy.polyval", "numpy.linspace" ] ]
alexpyattaev/pyquaternion
[ "19c3581799c220607ce327af5f1cbe9f98dba4e6" ]
[ "pyquaternion/test/test_quaternion.py" ]
[ "#!/usr/bin python\n# -*- coding: utf-8 -*-\n\"\"\"\nThis file is part of the pyquaternion python module\n\nAuthor: Kieran Wynn\nWebsite: https://github.com/KieranWynn/pyquaternion\nDocumentation: http://kieranwynn.github.io/pyquaternion/\n\nVersion: 1.0.0\nLicense: The MIT License (...
[ [ "numpy.isclose", "numpy.copy", "numpy.testing.assert_almost_equal", "numpy.allclose", "numpy.cos", "numpy.random.rand", "numpy.random.uniform", "numpy.eye", "numpy.zeros", "numpy.arange", "numpy.hstack", "numpy.linalg.norm", "numpy.sign", "numpy.matrix", ...
prajwal309/HAPILite_Modified
[ "e0527328569ef8bd576114b1619ac5c87ff8c5b2" ]
[ "GenerateDatabase.py" ]
[ "import glob\nimport numpy as np\nfrom lib.CrossSectionFunctions import GetWaveNumbers, BinModel\nimport matplotlib.pyplot as plt\nimport os\nimport itertools\nimport time\nimport multiprocessing as mp\n\n#parse the parameters.ini which contains the information\nData = [f.split(\":\") for f in open(\"CrossSectionPa...
[ [ "numpy.save", "numpy.load", "numpy.ones", "numpy.savetxt", "numpy.arange" ] ]
anzelpwj/arviz
[ "3aba6c9d1831199631a8e48ecc82ed482bdf00e8" ]
[ "arviz/plots/backends/bokeh/bokeh_violinplot.py" ]
[ "\"\"\"Bokeh Violinplot.\"\"\"\nimport bokeh.plotting as bkp\nfrom bokeh.layouts import gridplot\nfrom bokeh.models.annotations import Title\nimport numpy as np\n\nfrom ....stats import hpd\nfrom ....stats.stats_utils import histogram\nfrom ...kdeplot import _fast_kde\nfrom ...plot_utils import get_bins, make_label...
[ [ "numpy.roll", "numpy.diff", "numpy.atleast_1d", "numpy.max", "numpy.min", "numpy.concatenate", "numpy.percentile" ] ]
jopasserat/he-transformer
[ "d2865be507d2e20568ca5289513925c813aa59e6" ]
[ "examples/pyclient_mnist.py" ]
[ "import time\nimport argparse\nimport numpy as np\nimport sys\nimport os\n\nfrom tensorflow.examples.tutorials.mnist import input_data\nimport he_seal_client\n\nFLAGS = None\n\n\ndef test_mnist_cnn(FLAGS):\n mnist = input_data.read_data_sets(FLAGS.data_dir, one_hot=True)\n batch_size = FLAGS.batch_size\n x...
[ [ "numpy.equal", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "numpy.printoptions", "numpy.round", "numpy.array" ] ]
ajweiss/tensorflow
[ "2f4d4da52f0c488417d7e917edaf1b7569b5e408" ]
[ "tensorflow/python/autograph/pyct/ast_util.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.autograph.pyct.anno.hasanno", "tensorflow.python.autograph.pyct.anno.keys", "tensorflow.python.util.tf_inspect.getfullargspec", "tensorflow.python.autograph.pyct.anno.copyanno", "tensorflow.python.autograph.pyct.anno.getanno", "tensorflow.python.autograph.pyct.parser.par...
ivis-kuwata/albert
[ "bd336ba2d324bb35b9d09599da3d635895bac379" ]
[ "export_to_tfhub.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Team 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 requi...
[ [ "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.range", "tensorflow.compat.v1.zeros_initializer", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.gather", "tensorflow.compat.v1.variable_scope", "tensorflow.compat.v1.constant", "tensorflow.compat.v1.nn.log_softmax", ...
acrucetta/Chicago_COVI_WebApp
[ "a37c9f492a20dcd625f8647067394617988de913" ]
[ ".venv/lib/python3.8/site-packages/pandas/core/reshape/tile.py" ]
[ "\"\"\"\nQuantilization functions and related stuff\n\"\"\"\nimport numpy as np\n\nfrom pandas._libs import Timedelta, Timestamp\nfrom pandas._libs.lib import infer_dtype\n\nfrom pandas.core.dtypes.common import (\n DT64NS_DTYPE,\n ensure_int64,\n is_bool_dtype,\n is_categorical_dtype,\n is_datetime6...
[ [ "pandas.core.algorithms.unique", "numpy.dtype", "numpy.asarray", "pandas._libs.Timestamp", "pandas.core.dtypes.common.is_integer", "pandas.core.dtypes.common.is_list_like", "numpy.isfinite", "pandas.core.dtypes.common.is_categorical_dtype", "numpy.iterable", "pandas.core.na...
XDynames/pytorch-lightning
[ "a5d1176cf6ef9e637144f980da11bbe63290c994" ]
[ "pytorch_lightning/core/lightning.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.distributed.init_process_group", "torch.no_grad", "torch.onnx.export", "torch.nn.SyncBatchNorm.convert_sync_batchnorm" ] ]
uw-loci/demo_wsi_superres
[ "38283031eee4823d332fae1b6b32b5da33fb957f" ]
[ "train_paired.py" ]
[ "import os, argparse, sys, shutil, warnings, glob\nfrom datetime import datetime\nimport matplotlib.pyplot as plt\nfrom math import log2, log10\nimport pandas as pd\nimport numpy as np\nfrom collections import OrderedDict\n\nfrom torchvision import transforms, utils\nimport torchvision\nimport torch.nn.functional a...
[ [ "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.utils.data.DataLoader", "torch.nn.MSELoss", "torch.nn.L1Loss", "torch.no_grad", "torch.device" ] ]
thomascherickal/Auto-PyTorch
[ "9e25a3bdef8e836e63979229eef77830cd64bb53" ]
[ "autoPyTorch/training/mixup.py" ]
[ "from autoPyTorch.training.base_training import BaseBatchLossComputationTechnique\nimport numpy as np\nfrom torch.autograd import Variable\nimport ConfigSpace\nimport torch\n\nclass Mixup(BaseBatchLossComputationTechnique):\n def set_up(self, pipeline_config, hyperparameter_config, logger):\n super(Mixup,...
[ [ "numpy.random.beta", "torch.autograd.Variable", "torch.randperm" ] ]
yick2232/google-research
[ "4a59cab927579ea9722e43252c695de5da4eb5e2", "4a59cab927579ea9722e43252c695de5da4eb5e2" ]
[ "unprocessing/network.py", "r4r/r4r_generate_data.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.layers.conv2d", "tensorflow.shape", "tensorflow.name_scope", "tensorflow.layers.max_pooling2d", "tensorflow.image.resize_bilinear", "tensorflow.concat", "tensorflow.identity" ], [ "numpy.arctan2", "numpy.mean" ] ]
Room-10/Opymize
[ "8632e5b618f41a65b1a37df099a6da254500e14b" ]
[ "opymize/tools/__init__.py" ]
[ "\nimport numpy as np\n\ndef truncate(x, n):\n k = -int(np.floor(np.log10(abs(x))))\n # Example: x = 0.006142 => k = 3 / x = 2341.2 => k = -3\n k += n - 1\n if k > 0:\n x_str = str(abs(x))[:(k+2)]\n else:\n x_str = str(abs(x))[:n]+\"0\"*(-k)\n return np.sign(x)*float(x_str)\n\ndef so...
[ [ "numpy.cbrt", "numpy.zeros_like", "numpy.sign", "numpy.abs", "numpy.asarray", "numpy.cos", "numpy.sqrt" ] ]
kaka-lin/ML-Notes
[ "047b88d59346b2ec719b1b3e2fcd605e1ccfaf91" ]
[ "Object Detection/iou.py" ]
[ "import numpy as np\n\n\ndef calculate_iou(bbox1, bbox2):\n \"\"\"\n calculate iou\n args:\n - bbox1 [array]: 1x4 single bbox\n - bbox2 [array]: 1x4 single bbox\n returns:\n - iou [float]: iou between 2 bboxes\n \"\"\"\n xmin = max(bbox1[0], bbox2[0]) # x_left\n ymin = max(bbox1[1], bb...
[ [ "numpy.array" ] ]
noatgnu/colossi
[ "c936bc25b5990f8dfbf4db3ed11ce8a893553668" ]
[ "model_test.py" ]
[ "import unittest\nfrom model import prediction_with_model\nimport pandas as pd\nimport numpy as np\n\nclass PredictionWithModel(unittest.TestCase):\n def test_prediction(self):\n d = pd.read_csv(r\"C:\\Users\\Toan\\Documents\\GitHub\\colossi\\static\\temp\\cc7deed8140745d89f2f42f716f6fd1b\\out_imac_atlas_...
[ [ "pandas.read_csv" ] ]
mhrmm/geosolver
[ "13ae2972c58d5ba4c4878576f9fba8569cc99629" ]
[ "geosolver/diagram/select_primitives.py" ]
[ "import logging\n\nimport numpy as np\n\nfrom geosolver.diagram.states import PrimitiveParse\nfrom geosolver.diagram.computational_geometry import line_length, circumference, \\\n distance_between_circle_and_point, midpoint, line_unit_vector, line_normal_vector, \\\n distance_between_points_squared, distance_...
[ [ "numpy.dot", "numpy.mean" ] ]
focusunsink/study_python
[ "322326642db54df8725793d70a95d21ac40b6507" ]
[ "np/reference/ch9code/animation.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\nfig = plt.figure()\nax = fig.add_subplot(111)\nN = 10\nx = np.random.rand(N)\ny = np.random.rand(N)\nz = np.random.rand(N)\ncircles, triangles, dots = ax.plot(x, 'ro', y, 'g^', z, 'b.')\nax.set_ylim(0, 1)\nplt.axis('of...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "numpy.random.rand", "matplotlib.animation.FuncAnimation" ] ]
BreastGAN/experiment2
[ "2a1d15c1f479bbd6ca58af4e3b1379bf34b89f51" ]
[ "models/breast_cycle_gan/data_provider.py" ]
[ "# Copyright 2018 Lukas Jendele and Ondrej Skopek.\n# Adapted from The TensorFlow Authors, under the ASL 2.0.\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.ap...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.reduce_max", "tensorflow.reshape", "tensorflow.decode_raw", "tensorflow.train.match_filenames_once", "tensorflow.train.batch", "tensorflow.concat", "tensorflow.WholeFileReader", "numpy.reshape", "tensorflow.FixedLenFeature", ...
Leandro-Bertoluzzi/pyspice-power-electronics
[ "960494b23e36c0fac61289744a64c991d62784a2" ]
[ "thyristor/half-wave-converter-RL.py" ]
[ "#r# ============================================\n#r# Controlled half-wave rectifier with an SCR\n#r# ============================================\n\n#r# This example shows the simulation of a controlled half-wave rectifier with an SCR with an RL load\n\n######################################### IMPORT MODULES ##...
[ [ "scipy.fft.fft", "numpy.abs", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "scipy.fft.fftfreq" ] ]
yienxu/counting-strokes-in-chinese-characters
[ "6b8d532b78ec37842c4cf028a48271c6bb735cbf" ]
[ "scripts/df_visualization.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom matplotlib import pyplot as plt\n\ndf = pd.read_csv('data/dataset.csv', encoding='utf-8')\n\n\ndef plot_df_counts(df):\n x_ticks = np.asarray(list(set(df['count'])))\n xx = np.arange(np.max(x_ticks) + 1)\n yy = np.bincount(df['count'])\n\n for x, y in zip(x...
[ [ "numpy.sum", "numpy.bincount", "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.max", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.bar" ] ]
mhashas/intelligent-systems
[ "a108887fa5b13bbc2343423f21a94ca20093ae5a" ]
[ "bots/smt/kb.py" ]
[ "import sys\nimport numpy as np\nimport scipy.optimize as opt\n\nclass Symbol(object):\n \"\"\"\n A class representing a single unit in the boolean SAT problem. This can either refer to an atomic boolean, or a\n constraint based on integer variables\n \"\"\"\n pass\n\nclass Boolean(Symbol):\n\n de...
[ [ "scipy.optimize.linprog" ] ]
colesbury/fairo
[ "9e50a3aa7369c68c80e84d80abd5fcdee8a9277a" ]
[ "polymetis/tests/scripts/5_multithreaded.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.\nimport time\nimport threading\n\nimport torch\n\nfrom polymetis import RobotInterface\nfrom utils import check_episode_log\n\n\nsucces...
[ [ "torch.Tensor", "torch.allclose" ] ]
bf108/elo_package
[ "ec87eba14362ff1de1c4830be2761ef23a32c6e4" ]
[ "src/elopackage/preprocess.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom pathlib import Path\nfrom ast import literal_eval\n\n\ndef convert_scores_literal(score):\n try:\n return literal_eval(score)\n except:\n return f'Error: {score}'\n\n\ndef pts_diff(row):\n try:\n winner_pts = sum(row['winning_team_scores_l...
[ [ "numpy.array", "pandas.to_datetime", "pandas.read_csv" ] ]
vkola-lab/multi-task
[ "6a61db4223e1812744f13028747b07e2f840cc0b" ]
[ "lookupcsv/derived_tables/FHS/get_T1_MRI.py" ]
[ "from glob import glob\nimport pydicom\nfrom pydicom import dcmread\nimport os\nimport numpy as np\nimport nibabel as nib\n\n\ndef dicom_to_nifti(folder):\n dicoms = None\n return\n\n\ndef read_a_dicom(dicom_file):\n ds = dcmread(dicom_file)\n\n\ndef get_array(dcm_file):\n ds = dcmread(dcm_file)\n lo...
[ [ "numpy.stack", "numpy.eye" ] ]
getzlab/SMM_clustering_2020
[ "0a00e11fbde38a1da82167e1c924234a79cba4a5" ]
[ "funcs/plot.py" ]
[ "import matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\nimport os\nfrom typing import Union\nimport pandas as pd\nimport signatureanalyzer as sa\n\n# Cluster Color map\nCOLORMAP={\n 0:'#0073C2FF',\n 1:'#EFC000FF',\n 2:'#868686FF',\n 3:'#CD534CFF',\n 4:'#7AA6DCFF',\n 5:'#003C67...
[ [ "matplotlib.colors.rgb2hex", "pandas.Series", "matplotlib.pyplot.tight_layout", "numpy.log", "matplotlib.pyplot.margins", "scipy.cluster.hierarchy.dendrogram", "numpy.append", "scipy.cluster.hierarchy.linkage", "numpy.log10", "numpy.linspace", "numpy.unique", "matpl...
TeeKay53/Dialogue-systems-for-language-learning
[ "28e226a579b8f22bebf5ec133985d7d86aef6606" ]
[ "chatbot/models/hier_model.py" ]
[ "\"\"\"\nA dialogue system meant to be used for language learning.\n\nThis is based on Google Neural Machine Tranlation model\nhttps://github.com/tensorflow/nmt\nwhich is based on Thang Luong's thesis on\nNeural Machine Translation: https://github.com/lmthang/thesis\n\nAnd on the paper Building End-To-End Dialogue ...
[ [ "tensorflow.gather", "tensorflow.shape", "tensorflow.variable_scope", "tensorflow.add", "tensorflow.nn.dynamic_rnn", "tensorflow.while_loop", "tensorflow.less", "tensorflow.Variable", "tensorflow.contrib.seq2seq.tile_batch", "tensorflow.transpose", "tensorflow.nn.embedd...
Drkun/ZSTCI
[ "93543ee843dac680c33e34de5d61ba048ef1f6d3" ]
[ "models/inception.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n__all__ = ['Inception3', 'inception_v3']\n\ndef inception_v3(**kwargs):\n r\"\"\"Inception v3 model architecture from\n `\"Rethinking the Inception Architecture for Computer Vision\" <http://arxiv.org/abs/1512.00567>`_.\n\n Args:\n ...
[ [ "torch.nn.BatchNorm2d", "torch.nn.Linear", "torch.nn.functional.avg_pool2d", "torch.nn.functional.dropout", "torch.nn.functional.max_pool2d", "torch.nn.functional.relu", "scipy.stats.truncnorm", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.Conv2d", "torch.cat", ...
ziatdinovmax/sidpy
[ "299147bfc22741b5170aa00e92b34159dfc910c5" ]
[ "sidpy/hdf/dtype_utils.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nUtilities for transforming and validating data types\n\nGiven that many of the data transformations involve copying the data, they should\nideally happen in a lazy manner to avoid memory issues.\n\nCreated on Tue Nov 3 21:14:25 2015\n\n@author: Suhas Somnath, Chris Smith\n\"\"\"\n...
[ [ "numpy.array", "numpy.dtype", "numpy.hstack", "numpy.real" ] ]
brandontrabucco/jetpack
[ "aa60488788b2e6fe1d09727943be043158a7af09" ]
[ "mineral/algorithms/tuners/entropy_tuner.py" ]
[ "\"\"\"Author: Brandon Trabucco, Copyright 2019\"\"\"\n\n\nimport tensorflow as tf\nfrom mineral.algorithms.tuners.tuner import Tuner\n\n\nclass EntropyTuner(Tuner):\n\n def __init__(\n self,\n policy,\n **kwargs\n ):\n Tuner.__init__(self, **kwargs)\n self.policy = policy\n...
[ [ "tensorflow.reduce_min", "tensorflow.reduce_mean", "tensorflow.reduce_max", "tensorflow.stop_gradient" ] ]
hassanmohsin/chemprop
[ "b6d84f064f682d6ff7fa42e1f231d7467a87105e" ]
[ "biasdb/split.py" ]
[ "import numpy as np\nfrom copy import deepcopy\n\n\n\ndef stratify(data, classes, ratios, one_hot=False):\n \"\"\"Stratifying procedure.\n\n data is a list of lists: a list of labels, for each sample.\n Each sample's labels should be ints, if they are one-hot encoded, use one_hot=True\n \n classe...
[ [ "numpy.array", "numpy.amax", "numpy.random.choice" ] ]