repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
rubenandrebarreiro/fct-nova-machine-learning-labs | [
"3ad34c4f49d7acfef04c757dc3317da6c717c8c1"
] | [
"tutorials/tutorial-3/files/t3_aux.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nAuxiliary code for tutorial 3\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import LogisticRegression\n\ndef poly_16features(X):\n \"\"\"Expand data polynomially\n \"\"\"\n X_exp = np.zeros((X.shape[0],X.s... | [
[
"matplotlib.pyplot.contourf",
"sklearn.linear_model.LogisticRegression",
"numpy.linspace",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.contour",
"numpy.meshgrid",
"numpy.zeros"
]
] |
Shihara-Dilshan/SinhalaCharacterRecogizer | [
"0662cdd8b8ea8911fc77bba3fea131bd02c22f0f"
] | [
"researchData/createCsv/images/read.py"
] | [
"import numpy as np\nimport pandas as pd\n\ndata = pd.read_csv(\"data.csv\", header=None, sep=\"\\t\")\nprint(data.shape)\n"
] | [
[
"pandas.read_csv"
]
] |
pzharrington/ExaGAN | [
"b86ad31d1581d3bc474fe98d7838bed5af0e8b62"
] | [
"networks/GANbuild.py"
] | [
"import numpy as np\nimport keras\nfrom keras.layers import *\nfrom keras.activations import relu\nfrom keras.models import Model, Sequential\nfrom keras.models import load_model\nimport keras.backend as K\nimport time\nimport sys\nsys.path.append('./utils')\nsys.path.append('./networks')\nimport logging\nimport lo... | [
[
"numpy.ones",
"numpy.concatenate",
"numpy.random.uniform",
"numpy.random.normal",
"numpy.mean",
"numpy.moveaxis",
"numpy.load",
"numpy.zeros",
"numpy.divide"
]
] |
GaniAliguzhinov/tensorMultBenchmarks | [
"352e5d73e784ce346be0c48ca1174821164ac1b2"
] | [
"allocMult.py"
] | [
"import numpy\nimport timeit\nimport matplotlib.pyplot as plt\nimport sys\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport tensorflow as tf\n\n\n\"\"\"\nhttps://sanjayasubedi.com.np/python/efficient-matrix-multiplication-in-python/\n\"\"\"\nglobal A, B\n\nglobal n\n\ndef allocate(n):\n global A\n ... | [
[
"numpy.dot",
"tensorflow.matmul",
"numpy.random.rand",
"numpy.empty"
]
] |
duongkstn/my-tod | [
"4ac82405d22b79e6eb9d3680b4e607c8f25c0c68"
] | [
"utils/utils_schema.py"
] | [
"import json\nimport ast\nimport collections\nimport os\n\nimport pandas as pd\n\nfrom .utils_function import get_input_example\n\n\ndef read_langs_turn(args, dial_files, max_line=None, ds_name=\"\"):\n print((\"Reading from {} for read_langs_turn\".format(ds_name)))\n\n data = []\n\n cnt_lin = 1\n need... | [
[
"pandas.DataFrame"
]
] |
paolotron/Drop-Geo | [
"140badaba61ee33eb31ba92609739cb9b68a0d0f"
] | [
"source/util.py"
] | [
"import torch\nimport shutil\nfrom os.path import join\n\n\ndef save_checkpoint(args, state, is_best, filename):\n model_path = join(args.output_folder, filename)\n torch.save(state, model_path)\n if is_best:\n shutil.copyfile(model_path, join(args.output_folder, \"best_model.pth\"))\n"
] | [
[
"torch.save"
]
] |
UKPLab/acl2018-msr-workshop-binlin | [
"9b8021dfa14a8bc131df117fa9985699fc8cedea"
] | [
"components/nlgen/morph_rnn_algo.py"
] | [
"from components.utils.graph import dg_from_tokens\nfrom components.utils.readers import ConllFileReader, UDConllDataProcessor\nfrom components.data.base_morph_data import BaseMorphData\nfrom components.utils.tensors import cuda_if_gpu\nfrom torch.autograd import Variable\nimport torch\nfrom components.nlgen.base_a... | [
[
"torch.LongTensor"
]
] |
zemarchezi/pyMilne | [
"62567c4d843227cc8de4ad1c3eddd485edd094f2"
] | [
"MilneEddington.py"
] | [
"import numpy as np\nimport pyMilne\n\n\nclass MilneEddington:\n \"\"\"\n MilneEddington class\n\n Purpose: Implementation of a parallel Milne-Eddington solver with analytical response functions\n Coded in C++/python by J. de la Cruz Rodriguez (ISP-SU, 2020)\n \n References:\n Landi Degl... | [
[
"numpy.sqrt",
"numpy.ascontiguousarray",
"numpy.ones",
"numpy.float64",
"numpy.zeros"
]
] |
IBM/sifar-pytorch | [
"3ac9103245b98a4916dd45bcdf0167d01b5f9b38"
] | [
"utils.py"
] | [
"# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the CC-by-NC license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\"\"\"\nMisc functions, including distributed helpers.\n\nMostly copy-paste from torchvision references.\n\"... | [
[
"torch.distributed.init_process_group",
"torch.cuda.set_device",
"torch.cuda.device_count",
"torch.distributed.is_initialized",
"torch.distributed.barrier",
"torch.tensor",
"torch.cuda.max_memory_allocated",
"torch.distributed.is_available",
"torch.cuda.is_available",
"torc... |
wehs7661/advanced_sampling | [
"92e5a25ec205ff84e55cd01de43c274b63f78a03"
] | [
"advanced_sampling/General_analysis/gmx_plot2d.py"
] | [
"#!/usr/bin/env python\n\"\"\"This is a Python code for the plotting of 2-dimensional data.\n\"\"\"\n\nimport argparse\nimport os.path\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import rc\n\n\ndef initialize():\n\n parser = argparse.ArgumentParser(\n description='This code saves... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.ticklabel_format",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"numpy.array",
"... |
mlhenderson/xarray | [
"07de257c5884df49335496ee6347fb633a7c302c"
] | [
"xarray/core/groupby.py"
] | [
"import datetime\nimport warnings\n\nimport numpy as np\nimport pandas as pd\n\nfrom . import dtypes, duck_array_ops, nputils, ops\nfrom .arithmetic import DataArrayGroupbyArithmetic, DatasetGroupbyArithmetic\nfrom .concat import concat\nfrom .formatting import format_array_flat\nfrom .indexes import propagate_inde... | [
[
"numpy.concatenate",
"numpy.arange",
"pandas.factorize",
"pandas.cut"
]
] |
NiklasHoltmeyer/FashionDatasets | [
"a9309f90abd6bff739ecffafd69cf52506f2cb97"
] | [
"fashiondatasets/deepfashion2/helper/pairs/deep_fashion_2_pairs_generator.py"
] | [
"import os\nimport random\n\nfrom fashionscrapper.utils.list import flatten, distinct\n\nfrom fashiondatasets.deepfashion2.helper.pairs._aggregate_collections import load_aggregated_annotations, \\\n DeepFashion_DF_Helper, load_image_quadruplets_csv_path, splits, load_info_path\nimport pandas as pd\nfrom tqdm.au... | [
[
"tensorflow.data.Dataset.from_tensor_slices",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
mathreader/DeepKoopman | [
"26197fb131ac9bed6b5bd6a4d1171fc109b4f170"
] | [
"helperfns.py"
] | [
"import datetime\nimport pickle\nimport time\n\nimport numpy as np\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\n\n\ndef stack_data(data, num_shifts, len_time):\n \"\"\"Stack data from a 2D array into a 3D array.\n\n Arguments:\n data -- 2D data array to be reshaped\n num_shifts ... | [
[
"tensorflow.compat.v1.train.AdagradOptimizer",
"tensorflow.compat.v1.train.RMSPropOptimizer",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.compat.v1.train.ProximalGradientDescentOptimizer",
"numpy.min",
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.arange",
"tensorf... |
cpp-pm/boost | [
"38c6c8c07f2fcc42d573b10807fef27ec14930f8"
] | [
"libs/numeric/ublas/benchmarks/plot.py"
] | [
"#!/usr/bin/env python\n#\n# Copyright (c) 2018 Stefan Seefeld\n# All rights reserved.\n#\n# This file is part of Boost.uBLAS. It is made available under the\n# Boost Software License, Version 1.0.\n# (Consult LICENSE or http://www.boost.org/LICENSE_1_0.txt)\n\nimport argparse\nimport matplotlib.pyplot as plt\nimpo... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
cmcuervol/HydroBalbo | [
"0c70536305d12f6fb9fb8fe7ce7cdb08d88472af"
] | [
"04_QuantUncertain.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Oct 11 18:00:30 2020\n\n@author: Andres\n\"\"\"\nimport os\nimport numpy as np\nimport pandas as pd\nimport datetime as dt\nimport scipy.stats as st\nimport pylab as plt\n\nfrom Modules import Read\nfrom Modules.Utils import Listador, FindOutlier\nfrom Modules.FitSta... | [
[
"pandas.Series",
"numpy.random.choice",
"numpy.isnan",
"pandas.DatetimeIndex",
"pandas.DataFrame",
"numpy.nanstd",
"numpy.array",
"numpy.where"
]
] |
infant-cognition-tampere/trial-srt-variability-analysis | [
"15cfe50f419df3fbac958a4d81da057154aaed40"
] | [
"tasks/lib/utils.py"
] | [
"\nimport gazelib\nimport numpy as np\nimport scipy as sp\n\ndef iter_sequence_files(input_files):\n for source_path in input_files:\n yield gazelib.containers.CommonV1(source_path)\n\ndef iter_target_periods(c):\n '''Parameters: c: CommonV1 object'''\n try:\n targets = c.iter_slices_by_tag('... | [
[
"numpy.std",
"scipy.stats.norm.interval",
"numpy.mean",
"numpy.sqrt"
]
] |
aleaf/MFsetup | [
"85cc44eb767c595b19006e43587699be4771f818"
] | [
"mfsetup/tests/plot.py"
] | [
"import glob\nfrom pathlib import Path\n\nimport numpy as np\nimport rasterio\nfrom matplotlib import pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\n\nfrom mfsetup import load_modelgrid\n\n\ndef make_lake_xsections(model, i_range, j_range,\n bathymetry_raster, datum, out... | [
[
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.pcolormesh",
"numpy.vstack",
"matplotlib.pyplot.figure"
]
] |
davidtvs/kaggle-hpaic | [
"546a98eb2b1591955ada731ab170084bad0e65bf"
] | [
"threshold_finder.py"
] | [
"import os\nfrom functools import partial\nimport torch\nimport torchvision.transforms as tf\nfrom argparse import ArgumentParser\nfrom core import evaluate\nimport data\nimport utils\n\n\ndef arguments():\n parser = ArgumentParser(\n description=(\n \"Human Protein Atlas Image Classification d... | [
[
"torch.device"
]
] |
dstndstn/desimeter | [
"704ab999e901db0f4db569b8446576b98dc656a0"
] | [
"py/desimeter/match.py"
] | [
"\"\"\"\nUtility functions to match two catalogs of 2D coordinates\n\"\"\"\n\n\nimport numpy as np\nfrom scipy.spatial import cKDTree as KDTree\nfrom desimeter.log import get_logger\n\n\ndef compute_triangles_with_arbitrary_orientation(x,y) :\n \"\"\"\n triangle vertices are ordered using the side length\n ... | [
[
"numpy.sum",
"numpy.sqrt",
"numpy.unique",
"numpy.min",
"numpy.ones",
"numpy.intersect1d",
"numpy.max",
"numpy.where",
"numpy.any",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"scipy.spatial.cKDTree"
]
] |
SaimaS786/ga-learner-dsmp-repo | [
"905dbe0ed110016a951656c5dad0884519185950"
] | [
"Amazon-Alexa-Reviews/code.py"
] | [
"# --------------\n# import packages\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\n# Load the dataset\ndf = pd.read_csv(path, sep = \"\\t\")\n#print(dtype(date))\n#datetime.date()\ndf['date'] = pd.to_dateti... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.precision_score",
"sklearn.model_selection.train_test_split",
"sklearn.feature_extraction.text.CountVectorizer",
"matplotlib.pyplot.show",
"mat... |
andraspatka/dsp-labs | [
"5b8842968aec2539a5cc83b7952cb91f93550ff4"
] | [
"fir/fir_example.py"
] | [
"from numpy import cos, sin, pi, absolute, arange\nfrom scipy.signal import kaiserord, lfilter, firwin, freqz\nfrom pylab import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show\n\n\n#------------------------------------------------\n# Create a signal for demonstration.\n#---------------------... | [
[
"numpy.absolute",
"scipy.signal.freqz",
"numpy.arange",
"numpy.cos",
"numpy.sin",
"scipy.signal.kaiserord",
"scipy.signal.lfilter",
"scipy.signal.firwin"
]
] |
Tiffany-HONG/easytext | [
"9c717d11240d96fab98b0532084ebb5c093d55bd"
] | [
"easytext/data/pretrained_vocabulary.py"
] | [
"#!/usr/bin/env python 3\n# -*- coding: utf-8 -*-\n\n#\n# Copyright (c) 2020 PanXu, Inc. All Rights Reserved\n#\n\"\"\"\n预训练好的词汇表,带有预训练好的词向量\n\nAuthors: panxu(panxu@baidu.com)\nDate: 2020/06/23 11:49:00\n\"\"\"\nimport os\nfrom typing import Iterable, List, Dict, Union\nimport torch\nfrom .vocabulary import IVoc... | [
[
"torch.tensor",
"torch.load",
"torch.save"
]
] |
KIT-MBS/pyREX | [
"cf3036400850f8b155399cd9444225352a34db08"
] | [
"pyrexMD/tests/test_misc.py"
] | [
"# @Author: Arthur Voronin <arthur>\n# @Date: 10.05.2021\n# @Filename: test_misc.py\n# @Last modified by: arthur\n# @Last modified time: 28.07.2021\n\n\nimport pyrexMD.misc as misc\nimport MDAnalysis as mda\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom numpy.testing import assert_allclose\nfrom uni... | [
[
"matplotlib.pyplot.sca",
"numpy.all",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.testing.assert_allclose",
"numpy.load",
"numpy.array"
]
] |
mylestunglee/aes | [
"7aa110c54e631fb8eeb94eedfcb2e63280eddcc7"
] | [
"scripts/plot_clear_profiles.py"
] | [
"import numpy as np\nimport csv\nimport matplotlib.pyplot as plt\n\nX = np.arange(1001)\n\ndef empty_lookup():\n\treturn [[] for _ in X]\n\ncpu = {\n\t'full': empty_lookup(),\n\t'partial': empty_lookup(),\n\t'naive': empty_lookup(),\n}\n\nmemory = {\n\t'full': empty_lookup(),\n\t'partial': empty_lookup(),\n\t'naive... | [
[
"numpy.arange",
"numpy.mean"
]
] |
harriliu/marketing_mix_modeling | [
"2a80d229d9a8652111664dc2c010720d87d07d6b"
] | [
"stepwise_mkt_param/model_inference.py"
] | [
"from datetime import datetime, timedelta\nimport matplotlib.pyplot as plt \nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport math\n\nclass driver_analysis:\n \n def __init__(self, beta):\n self.beta = beta*(10**10)\n\n def get_sat_lvl(self, data, ds, alpha, media_var):\n ... | [
[
"numpy.log",
"pandas.to_datetime",
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.max",
"numpy.mean",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use",
"numpy.float"
]
] |
fmahdisoltani/multimodal_madam | [
"ef3545d05b29adc61958caa832a17aa0dff1f2fe"
] | [
"examples/classification/models/mlp.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n__all__ = ['mlp']\n\n\nclass MLP(nn.Module):\n def __init__(self, num_classes=10):\n super().__init__()\n n_hid = 1000\n n_out = 10\n self.l1 = nn.Linear(28*28, n_hid)\n self.l2 = nn.Linear(n_hid, n_hid)... | [
[
"torch.nn.Linear"
]
] |
joinquanter/jqfactor_analyzer | [
"090900a1f6ececeaa270fbed505d8a52a06680d7"
] | [
"jqfactor_analyzer/when.py"
] | [
"# -*- coding: utf-8 -*-\n\n\nimport datetime\n\nimport pandas as pd\n\n\nDateTime = datetime.datetime\nDate = datetime.date\nTime = datetime.time\nTimeDelta = datetime.timedelta\n\ntoday = datetime.date.today\nnow = datetime.datetime.now\n\n\ndef date2str(date, format='%Y-%m-%d'):\n return pd.to_datetime(date).... | [
[
"pandas.to_datetime"
]
] |
Julienbeaulieu/kaggle-computer-vision-competition | [
"7bc6bcb8b85d81ff1544040c403e356c0a3c8060"
] | [
"src/modeling/solver/evaluation.py"
] | [
"import torch\nimport pickle\nimport numpy as np\nfrom torch import nn\nfrom collections import Counter\nfrom yacs.config import CfgNode\nfrom typing import List, Dict, Union\nfrom sklearn.metrics import classification_report\n#from .loss import WeightedFocalLoss, SoftMaxCE\nfrom .loss import build_loss\n\nclass Mu... | [
[
"numpy.argmax",
"numpy.mean",
"torch.stack",
"sklearn.metrics.classification_report",
"numpy.vstack"
]
] |
EFerriss/FTIR | [
"c355a56f4c1c831208b603ecd3d9dd8cbbb99299"
] | [
"pynams/styles.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri May 29 10:43:49 2015\n\n@author: Ferriss\n\nContains my most commonly used plotting style dictionaries (e.g., blue dots)\nand some frequently used plotting setups, e.g., 3 subplots\n\n\"\"\"\nfrom __future__ import print_function, division, absolute_import\nimport ma... | [
[
"numpy.ones_like",
"numpy.abs",
"numpy.isnan",
"matplotlib.pyplot.subplots",
"numpy.ones",
"numpy.array",
"numpy.isinf",
"matplotlib.pyplot.figure"
]
] |
HTaeha/Deep-Learning-based-Coding-Guide-onAspect | [
"adaada4de8448fdfc2e134bc7a75abdfe639111a"
] | [
"Logging/Analysis/make_vocabulary.py"
] | [
"# Required dependencies\n# 1. NLTK\n# 2. Gensim for word2vec\n# 3. Keras with tensorflow/theano backend\nimport random\nimport sys\nimport json\nimport codecs\nimport warnings\nwarnings.filterwarnings(action='ignore', category=UserWarning, module='gensim')\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplo... | [
[
"matplotlib.use",
"numpy.random.seed"
]
] |
jamster112233/ICS_IDS | [
"dac6abc3c8d6e840a21adedcb9e8dcfaa304b499"
] | [
"MLModules/ABD/B_PCAQDA.py"
] | [
"import numpy as np\nfrom keras.utils import np_utils\nimport pandas as pd\nimport sys\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis as QDA\nfrom sklearn.decomposition import PCA\nimport os\nfrom sklearn.externals import joblib\nfrom sklearn... | [
[
"sklearn.externals.joblib.dump",
"pandas.read_csv",
"sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis",
"sklearn.metrics.f1_score",
"sklearn.preprocessing.LabelEncoder",
"sklearn.decomposition.PCA"
]
] |
Mind-the-Pineapple/tpot-age | [
"2969bfa6dc5c652d5b4f00f59e9b0b23869f6bef"
] | [
"BayOptPy/benchmark/plot_tpot_boosting.py"
] | [
"import os\nimport pickle\n\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport matplotlib\nmatplotlib.use('Agg')\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom scipy.stats import ttest_ind, friedmanchisquare\n\n\nfrom BayOptPy.helperfunctions import (set_publication_style,\n ... | [
[
"matplotlib.pyplot.gca",
"matplotlib.use",
"matplotlib.pyplot.ylim",
"numpy.arange",
"numpy.ndarray.flatten",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"scipy.stats.friedmanchisquare",
"matplotlib.pyplot.ylabel",
"numpy.std",
"numpy.mean",
"matplotlib.pyplot.clo... |
lantunes/cellpylib | [
"3868a79f02983e8eeb2ac51b1e2fc378acec5780"
] | [
"demos/wireworld_diodes_demo.py"
] | [
"import cellpylib as cpl\nimport numpy as np\nfrom matplotlib.colors import ListedColormap\n\n\ndef wireworld_rule(n, c, t):\n current_activity = n[1][1]\n if current_activity == 0: # empty\n return 0\n if current_activity == 1: # electron head\n return 2\n if current_activity == 2: # e... | [
[
"numpy.array",
"matplotlib.colors.ListedColormap",
"numpy.count_nonzero"
]
] |
christofferaakre/shakespeare | [
"c2563d19232465edbda2edaeebb7b93f491512d2"
] | [
"shakespeare.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader, Dataset, WeightedRandomSampler\n\n# set to True to enable training\n# if set to False, training is skipped,\n# and the weights are loaded from the session storage.\n# this way, you can... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax",
"torch.load",
"torch.nn.LSTM",
"torch.nn.functional.one_hot",
"torch.zeros",
"torch.utils.data.DataLoader",
"torch.utils.data.WeightedRandomSampler",
"torch.tensor",
"torch.nn.Linear",
"torch.cuda.is_available"... |
sanchit2843/Indian_LPR | [
"b817fe56ce325c5bd464904f8695b78a14487386"
] | [
"src/object_detection/demo_video.py"
] | [
"# test/inference script\nimport numpy as np\nimport torch\nfrom torch import nn\nimport argparse\nimport time\nimport os\nimport sys\nimport cv2\nfrom torchvision import models\nfrom tqdm import tqdm\nfrom model.fcos import FCOSDetector\nfrom torchvision import transforms\nimport matplotlib.pyplot as plt\n\n\ndef ... | [
[
"torch.device",
"torch.no_grad",
"torch.unsqueeze"
]
] |
ArtificialZeng/pyswarms | [
"66b3cf1f5cf335f1297fe8d6098e44dbd109fb3f"
] | [
"pyswarms/utils/plotters/formatters.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nPlot Formatters\n\nThis module implements helpful classes to format your plots or create meshes.\n\"\"\"\n\n# Import modules\nimport numpy as np\nfrom attr import attrib, attrs\nfrom attr.validators import instance_of\nfrom matplotlib import cm, colors\n\n\n@attrs\nclass Designer... | [
[
"numpy.arange",
"numpy.dstack"
]
] |
huangshunliang/Lasagne_h | [
"359ea1b9f12678c3523c0cb100f646528d49df9e"
] | [
"lasagne/tests/test_nonlinearities.py"
] | [
"import pytest\nimport numpy as np\nimport theano.tensor as T\n\n\nclass TestNonlinearities(object):\n def linear(self, x):\n return x\n\n def rectify(self, x):\n return x * (x > 0)\n\n def leaky_rectify(self, x):\n return x * (x > 0) + 0.01 * x * (x < 0)\n\n def leaky_rectify_0(sel... | [
[
"numpy.allclose",
"numpy.expm1",
"numpy.random.uniform",
"numpy.tanh",
"numpy.exp"
]
] |
ImmersiveS/housing | [
"810272aaa79c70911dde621fa2df6288c9e5e384"
] | [
"housing.py"
] | [
"from sklearn.datasets import load_boston\r\nfrom sklearn.preprocessing import scale\r\nfrom sklearn.cross_validation import KFold\r\nfrom sklearn.cross_validation import cross_val_score\r\nfrom sklearn.neighbors import KNeighborsRegressor\r\nimport numpy as np\r\n\r\nboston = load_boston()\r\nboston.data = scale(b... | [
[
"sklearn.cross_validation.cross_val_score",
"numpy.linspace",
"sklearn.neighbors.KNeighborsRegressor",
"sklearn.datasets.load_boston",
"sklearn.preprocessing.scale",
"sklearn.cross_validation.KFold"
]
] |
paquet-a/netptune_concon | [
"9b2867557eea847821934e712b80d5bdd2712bef"
] | [
"neptune/utils.py"
] | [
"#\n# Copyright (c) 2019, Neptune Labs Sp. z o.o.\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 appli... | [
[
"pandas.merge",
"numpy.unique"
]
] |
ducky777/posenet-python | [
"e27d37f31f5402c0770fee8b944f69a7c0289d03"
] | [
"tfjs_graph_converter/optimization.py"
] | [
"# SPDX-License-Identifier: MIT\n# Copyright © 2020 Patrick Levin\n\"\"\"Graph optimization functions\"\"\"\n\nfrom typing import List\n\nimport tensorflow as tf\n\nfrom tensorflow.compat.v1 import GraphKeys\nfrom tensorflow.core.framework.graph_pb2 import GraphDef\nfrom tensorflow.core.protobuf.config_pb2 import C... | [
[
"tensorflow.python.grappler.tf_optimizer.OptimizeGraph",
"tensorflow.TensorShape",
"tensorflow.core.protobuf.meta_graph_pb2.SignatureDef",
"tensorflow.python.framework.dtypes.as_dtype",
"tensorflow.python.training.saver.export_meta_graph",
"tensorflow.core.protobuf.config_pb2.ConfigProto"
... |
AdiletGaparov/sentiment-based-song-recommender | [
"e2c74278a409dbd8494743d0081bd15131181923"
] | [
"streamlit_app/nlp_showcase.py"
] | [
"import pandas as pd\nimport numpy as np\nimport streamlit as st\nimport time\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\"\"\"\n# Sentiment-based Music Recommender\n\"\"\"\n\ndef present_subj(option):\n subject_list_dict = {'subjective-20': '0-20% / Python, R, SQL',\n 'subjective... | [
[
"numpy.round",
"pandas.read_csv",
"numpy.percentile"
]
] |
ir5/onnx-chainer | [
"c4e4a900c612b3528df9ef7535b7f94c7eda2f8a"
] | [
"onnx_chainer/functions/normalization.py"
] | [
"import sys\n\nimport chainer\nimport numpy as np\n\nfrom onnx_chainer.functions.opset_version import support\nfrom onnx_chainer import onnx_helper\n\n\n@support((1, 6, 7))\ndef convert_BatchNormalization(\n func, opset_version, input_names, output_names, context):\n is_fixed_bn = len(func.inputs) > 3\n\n... | [
[
"numpy.ones_like",
"numpy.zeros_like"
]
] |
ysnan/motion_illusions | [
"1b7e8901cbd228a6bdfc8762f6d4756f62361b1f"
] | [
"examples/rotation_warp_image.py"
] | [
"###############################################################################\n#\n# File: rotation_warp_image.py\n#\n# Continuously warp an image by a small random rotation\n#\n# History:\n# 07-28-20 - Levi Burner - Created file\n#\n###############################################################################\... | [
[
"numpy.tan",
"numpy.random.normal",
"numpy.copy"
]
] |
r4lv/VIP | [
"fa45f71e391a4ec84658e5be1d6a057cfafdcd6c"
] | [
"vip_hci/fm/negfc_speckle_noise.py"
] | [
"#! /usr/bin/env python\n\n\"\"\"\nModule with routines allowing for the estimation of the uncertainty on the \nparameters of an imaged companion associated to residual speckle noise.\n\"\"\"\n\n__author__ = 'O. Wertz, C. A. Gomez Gonzalez, V. Christiaens'\n__all__ = ['speckle_noise_uncertainty']\n\n#import itertoo... | [
[
"numpy.linspace",
"matplotlib.pyplot.show",
"numpy.concatenate",
"numpy.deg2rad",
"numpy.array",
"numpy.sum",
"numpy.vstack"
]
] |
foroozandehgroup/mrpypulse | [
"6812ab8331321b46b4093514ddc8e07a19e20f81"
] | [
"tests/test_sequence.py"
] | [
"import numpy as np\nimport copy\nfrom mrpypulse import pulse, sequence, magnetization\n\n\ndef test_pc_rec():\n pc1 = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n pc2 = np.array([0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3])\n pc3 = np.array([0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3,... | [
[
"numpy.all",
"numpy.array",
"numpy.linspace"
]
] |
vladimirwest/deepspeech.pytorch | [
"46e417d8cbdcf1b41f95a8aa7a76b89349f3424f"
] | [
"transcribe.py"
] | [
"import argparse\nimport warnings\n\nfrom opts import add_decoder_args, add_inference_args\nfrom utils import load_model\n\nwarnings.simplefilter('ignore')\n\nfrom decoder import GreedyDecoder\n\nimport torch\n\nfrom data.data_loader import SpectrogramParser\nfrom model import DeepSpeech\nimport os.path\nimport jso... | [
[
"torch.device"
]
] |
nmvbxcz/ddfnet | [
"777bdeb73ad00e4c8ce53323cb282073817badf9"
] | [
"train.py"
] | [
"#!/usr/bin/env python3\n\"\"\" ImageNet Training Script\n\nThis is intended to be a lean and easily modifiable ImageNet training script that reproduces ImageNet\ntraining results with some of the latest networks and training techniques. It favours canonical PyTorch\nand standard Python style over trying to be able... | [
[
"torch.jit.script",
"torch.cuda.synchronize",
"torch.nn.CrossEntropyLoss",
"torch.distributed.init_process_group",
"torch.cuda.set_device",
"torch.manual_seed",
"torch.nn.SyncBatchNorm.convert_sync_batchnorm",
"torch.no_grad",
"torch.distributed.get_rank",
"torch.distribute... |
silverman/silverman.github.io | [
"346120239ed35008a48c296643e7d8233973b324"
] | [
"build-presets/MakePresetTree.py"
] | [
"\"\"\"\nThis code uses the PySAM wrapper for the SAM GUI to generate energy yield and create a new preset tree.\nIt loops through every combination of cell technology, package type, system type, inverter loading ratio\nand location to determine the energy yield with those settings.\n\nNote: this script runs PySAM ... | [
[
"pandas.read_csv"
]
] |
ChetGoerzen/rockhound | [
"28bf3247752ffcf470cdb4b7d782eb5e1706f008"
] | [
"examples/stw105.py"
] | [
"r\"\"\"\nSTW105\n======\n\nThe STW105 Earth model [Kustowski2008]_ is a one-dimensional model representing average Earth\nproperties as a function of depth. The model includes the radius, density, seismic velocities,\nattenuation (Q), and anisotropic parameter (:math:`\\eta`) on the boundaries of several Earth lay... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
skant626/attention-is-all-you-need-pytorch | [
"d4092de8589d463ad7cac222c2293375f5ca1879"
] | [
"transformer/SubLayers.py"
] | [
"''' Define the sublayers in encoder/decoder layer '''\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom transformer.Modules import ScaledDotProductAttention\nimport torch \nimport copy, math\ndef clones(module, N):\n \"Produce N identical layers.\"\n return nn.ModuleList([copy... | [
[
"torch.nn.Dropout",
"torch.nn.functional.softmax",
"torch.nn.LayerNorm",
"torch.matmul",
"torch.nn.Linear"
]
] |
marta-0/hippocampal_volume_quantification | [
"387dcb402b6cac3019fa922663a4f7a86a944d4c"
] | [
"section2/src/data_prep/SlicesDataset.py"
] | [
"\"\"\"\nModule for Pytorch dataset representations\n\"\"\"\n\nimport torch\nfrom torch.utils.data import Dataset\n\nclass SlicesDataset(Dataset):\n \"\"\"\n This class represents an indexable Torch dataset\n which could be consumed by the PyTorch DataLoader class\n \"\"\"\n def __init__(self, data):... | [
[
"torch.from_numpy"
]
] |
xiaoyi-Zeng/nerf_pl | [
"53f5fcfe911a1248963f6f82ada1e0361bb7e296"
] | [
"models/nerf.py"
] | [
"import torch\nfrom torch import nn\n\nclass Embedding(nn.Module):\n def __init__(self, in_channels, N_freqs, logscale=True):\n \"\"\"\n Defines a function that embeds x to (x, sin(2^k x), cos(2^k x), ...)\n in_channels: number of input channels (3 for both xyz and direction)\n \"\"\"... | [
[
"torch.linspace",
"torch.cat",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.split",
"torch.nn.ReLU"
]
] |
LeianChen/GUI_new2 | [
"4bb97f982c86bc71caa12e03691b3448094e18b5"
] | [
"model.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n__version__ 1.0.0\n\nBasic agent-based modelling. Builds agents into a 2D plane represented by a\nraster environment. Scrapes some web data and use it to initialise the model.\nAgents have methods of move, eat, and share. When running the model, a new\nwindow... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.scatter",
"matplotlib.use",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"matplotlib.animation.FuncAnimation",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
]
] |
agermanidis/glow | [
"2b8fe7d46892d4ad727b9b54adf72754c3350486"
] | [
"demo/runway_model.py"
] | [
"import runway\nfrom model import *\nfrom imutils.face_utils.helpers import FACIAL_LANDMARKS_68_IDXS\nfrom imutils.face_utils.helpers import FACIAL_LANDMARKS_5_IDXS\nfrom imutils.face_utils.helpers import shape_to_np\nimport numpy as np\nimport cv2\nimport dlib\n\n\nclass FaceWarper:\n def __init__(self, predict... | [
[
"numpy.sqrt",
"numpy.clip",
"numpy.arctan2",
"numpy.array",
"numpy.sum"
]
] |
Kexiii/DenseNet-Cifar10 | [
"440e7ffb059be720eb35cdb9092c6c521ea9dd2b"
] | [
"cifar10_train.py"
] | [
"# -*- coding:utf-8 -*-\nimport keras\nimport numpy as np\nimport os\nimport matplotlib \nmatplotlib.use('Agg') \nimport matplotlib.pyplot as plt\nfrom keras.optimizers import SGD\nfrom keras.optimizers import Adam\nfrom keras.callbacks import ModelCheckpoint, ReduceLROnPlateau\nfrom keras import backend as K\nfro... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.use",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
mr-love/openpyxl | [
"31a51044f936e16bea4cc353fe99a5aff6fec7d0"
] | [
"openpyxl/utils/dataframe.py"
] | [
"from __future__ import absolute_import\n# Copyright (c) 2010-2018 openpyxl\n\nimport numpy\nfrom pandas import Timestamp\n\n\ndef dataframe_to_rows(df, index=True, header=True):\n \"\"\"\n Convert a Pandas dataframe into something suitable for passing into a worksheet\n \"\"\"\n blocks = df._data.block... | [
[
"pandas.Timestamp"
]
] |
bmhopkinson/pytorch-deeplab-xception | [
"f652206cfa07363018c1879de496da49358ba289"
] | [
"dataloaders/datasets/cityscapes.py"
] | [
"import os\nimport numpy as np\nimport scipy.misc as m\nfrom PIL import Image\nfrom torch.utils import data\nfrom myinfo import Path\nfrom torchvision import transforms\nfrom dataloaders import custom_transforms as tr\n\nclass CityscapesSegmentation(data.Dataset):\n NUM_CLASSES = 19\n\n def __init__(self, arg... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.subplot",
"numpy.transpose",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
weberlo/tvm | [
"b076cad542524cb3744149d953c341b5815f6474"
] | [
"topi/tests/python/test_topi_conv2d_winograd.py"
] | [
"\"\"\"Example code to do convolution.\"\"\"\n\nimport numpy as np\nimport tvm\nfrom tvm import autotvm\nfrom tvm.autotvm.task.space import FallbackConfigEntity\nimport topi\nimport topi.testing\nfrom tvm.contrib.pickle_memoize import memoize\nfrom topi.util import get_const_tuple\n\n\ndef verify_conv2d_nchw(batch,... | [
[
"numpy.random.uniform",
"numpy.maximum"
]
] |
simon-donike/MoransI_tiff | [
"1b362487fe96282820dde93906681c8d289f6ee6"
] | [
"data/MoransI.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jun 5 18:32:44 2020\n\n@author: simondonike\n\"\"\"\n\nimport pysal\nfrom skimage.io import imread\nfrom libpysal.weights import lat2W\nimport pandas as pd\nfrom esda.moran import Moran\nfrom skimage.color import rgb2gray\nfrom splot.esda imp... | [
[
"numpy.dot",
"matplotlib.pyplot.show"
]
] |
catalystneuro/nwb-conversion-tools | [
"84ca038d99f7928d6c2a15686c9fa3a719466d9e"
] | [
"nwb_conversion_tools/utils/conversion_tools.py"
] | [
"\"\"\"Authors: Cody Baker, Alessio Buccino.\"\"\"\nfrom pathlib import Path\nimport numpy as np\nimport uuid\nfrom datetime import datetime\nfrom warnings import warn\nfrom tempfile import mkdtemp\nfrom shutil import rmtree\nfrom time import perf_counter\nfrom typing import Optional\n\nfrom pynwb import NWBFile\nf... | [
[
"numpy.diff"
]
] |
taylorguo/nsfw-Detection-Segmentation | [
"0befa479af0d1ea790953e840d9ee026aa74b842"
] | [
"depth-stream/ex6_ird_stream.py"
] | [
"'''\nhttps://github.com/elmonkey/Python_OpenNI2/tree/master/samples\nOfficial primense openni2 and nite2 python bindings.\nStreams infra-red camera\nref:\n http://www.eml.ele.cst.nihon-u.ac.jp/~momma/wiki/wiki.cgi/OpenNI/Python.html\n@author: Carlos Torres <carlitos408@gmail.com>\n'''\n\nimport cv2\n\nfrom prim... | [
[
"numpy.hstack",
"numpy.ndarray",
"numpy.dstack"
]
] |
fcomitani/simpsom | [
"a1c48f4e9ab13727cf213ce756cd4848a1d34ae7"
] | [
"simpsom/cluster/density_peak.py"
] | [
"\"\"\"\nDensity Peak Clustering\n\nA Rodriguez, A Laio,\nClustering by fast search and find of density peaks\nSCIENCE, 1492, vol 322 (2014) \n\nF. Comitani @2017-2021\n\"\"\"\n\nimport sys\nimport warnings\n\nfrom operator import attrgetter\n\nfrom math import sqrt, exp\nimport numpy as np\n\nimport matplotlib.pyp... | [
[
"numpy.random.seed",
"matplotlib.pyplot.scatter",
"numpy.random.multivariate_normal",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"numpy.std",
"matplotlib.pyplot.clf",
"numpy.mean",
"numpy.random.uniform",
... |
ANUPAMA1028/FACEMASKDETECTION | [
"ecca5e986e3fb2101448d655636f64e9b3b996b6"
] | [
"detect_mask_image.py"
] | [
"# USAGE\n# python detect_mask_image.py --image images/pic1.jpeg\n\n# import the necessary packages\nfrom tensorflow.keras.applications.mobilenet_v2 import preprocess_input\nfrom tensorflow.keras.preprocessing.image import img_to_array\nfrom tensorflow.keras.models import load_model\nimport numpy as np\nimport argp... | [
[
"tensorflow.keras.models.load_model",
"numpy.expand_dims",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input",
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array"
]
] |
Totilarson/CorePy | [
"9691f89692a552c1527d6c2fce74ace268d20b58"
] | [
"CorePycodes/NN_model_build.py"
] | [
"import pandas as pd\nimport numpy as np\n#from sklearn import preprocessing\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.metrics import classification_report, confusion_matrix\nimport pickle\n... | [
[
"sklearn.neural_network.MLPClassifier",
"pandas.read_csv",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.train_test_split",
"numpy.concatenate",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.show",
"sklearn.metrics.classification_report"
]
] |
usc-ee250-spring2021/lab02-haotianxu2021 | [
"1be1f20f03d0f9da3f732db7777eb72b7da6ed9f"
] | [
"Software/Python/grove_hightemperature_sensor/grove_hightemperature_sensor.py"
] | [
"import grovepi\nimport math\nimport json\nimport numpy as np\nfrom scipy.interpolate import interp1d\n\n# Library written for Python 3!\n\n# take a look in the datasheet\n# http://www.mouser.com/catalog/specsheets/Seeed_111020002.pdf\n\n# class for the K-Type temperature sensor (w/ long probe/sonde)\nclass HighTem... | [
[
"scipy.interpolate.interp1d"
]
] |
tdurham86/L2_sci-ATAC-seq | [
"6d6e3be43d26ef2534b538021edf02cc2e59ea83"
] | [
"scripts/lda_clustering/split_bed_script.py"
] | [
"#! /usr/bin/env python\n\n#Author: Timothy Durham (c) 2018\n\nimport argparse\nimport numpy\nimport os\nfrom plumbum import local\nimport sys\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n parser.add_argument('--cell_name_to_cluster_map')\n parser.add_argument('--cuts_bed_file')\n ... | [
[
"numpy.where",
"numpy.loadtxt"
]
] |
wangxihao/rgbd-kinect-pose | [
"03180723c99759ba2500bcd42b5fe7a1d26eb507"
] | [
"extern/face_expression/face_expression/utils/misc.py"
] | [
"import collections\nimport pydoc\n\nimport torch\nimport torch.nn.functional as F\n\nfrom face_expression import utils\n\n\ndef infer_smplx(smplx_model, expression, pose, beta):\n batch_size = expression.shape[0]\n device = expression.device\n \n # extract\n jaw_pose = pose[:, 63:66]\n translatio... | [
[
"torch.nn.functional.pad",
"torch.zeros"
]
] |
vacancy/TensorArtist | [
"7654eb026f6d87f64e28ca152d006ef7625b0f45"
] | [
"tartist/nn/tfutils.py"
] | [
"# -*- coding:utf8 -*-\n# File : tfutils.py\n# Author : Jiayuan Mao\n# Email : maojiayuan@gmail.com\n# Date : 1/31/17\n# \n# This file is part of TensorArtist.\n\nimport re\nimport tensorflow as tf\n\n\nclass TArtGraphKeys:\n PLACEHOLDERS = 'placeholders'\n TART_VARIABLES = 'tart_variables'\n INFERENC... | [
[
"tensorflow.group"
]
] |
rileymcdowell/snakenet | [
"21e06a8491c1897630cbe95add157e29063a0f1f"
] | [
"snakenet/model_player.py"
] | [
"import pygame\nimport pickle\nimport numpy as np\n\nfrom snakenet.game_constants \\\n import DOWN, UP, LEFT, RIGHT, MOVE_TO_KEYPRESS, VALID_MOVES\n\n_MODEL = None\ndef get_model():\n global _MODEL\n if _MODEL is None:\n with open('model.pkl', 'rb') as f:\n _MODEL = pickle.load(f)\n ... | [
[
"numpy.argmax"
]
] |
parthpatwa/Persona-Dialogue-Generation | [
"909b32d0b84b6e34de68745391f3fbfb4711b4d8"
] | [
"train_transmitter.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"Train model for ppl metric with pre-selected parameters.\nThese parameters have some variance in their fi... | [
[
"torch.random.manual_seed",
"torch.cuda.manual_seed"
]
] |
wjbKimberly/tf-cpn-need | [
"4eec0bf14bd6ecfe19a8d3709f8b99a90c93a9cd"
] | [
"models/COCO.res50.384x288.CPN/COCOAllJoints_minus.py"
] | [
"#!/usr/bin/python3\n# coding=utf-8\n\nimport os\nimport os.path as osp\nimport numpy as np\nimport cv2\n\nimport sys\ncur_dir = os.path.dirname(__file__)\nsys.path.insert(0, os.path.join(cur_dir, 'MSCOCO', 'PythonAPI'))\nfrom pycocotools.coco import COCO\n\nclass COCOJoints(object):\n def __init__(self):\n ... | [
[
"numpy.array",
"numpy.sum",
"numpy.random.randint"
]
] |
yhzhang35/transformer-xl | [
"0afa266400e34b9a71c8fd799eb6cf47704987a9"
] | [
"pytorch/predict.py"
] | [
"'''该py code是用训练好的模型来进行预测(生成数据)'''\nimport torch\nimport os\nif __name__=='__main__':\n '''加载模型'''\n model=None\n model_dir_path=\"\"\n with open(os.path.join(model_dir_path, 'model.pt'), 'rb') as f:\n model = torch.load(f)\n\n '''定义输入'''\n input_list=['3']\n predict_times_each=10\n #... | [
[
"torch.load"
]
] |
obver-se/fairMLHealth | [
"cf7db71e741e7093a84970b7bed397b01def540f"
] | [
"fairmlhealth/tutorial_helpers.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nAdd-ons for loading data, formatting, and generating tables as part of\nKDD 2020 Tutorial on Measuring Fairness for Healthcare.\nTo be called by Tutorial Notebook.\n\nContributors:\n camagallen <christine.allen@kensci.com>\n\"\"\"\n# Copyright (c) KenSci and contributors.\n# Lic... | [
[
"pandas.read_csv",
"pandas.Series",
"numpy.random.randint"
]
] |
FateScript/clearml | [
"f6651d39e062075d0480baf000a0711f2fd9dc5d"
] | [
"examples/pipeline/pipeline_from_decorator.py"
] | [
"from clearml.automation.controller import PipelineDecorator\n\n\n# Make the following function an independent pipeline component step\n# notice all package imports inside the function will be automatically logged as\n# required packages for the pipeline execution step\n@PipelineDecorator.component(return_values=['... | [
[
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"sklearn.linear_model.LogisticRegression"
]
] |
BioJoe/AHC-assay-by-DNA-content | [
"22c251a33a57faddef9aaf2bab3884a1f7cf909f"
] | [
"1_merge DNA content results.py"
] | [
"#load python included modules\r\nimport os\r\nimport ntpath\r\nimport tkinter as tk\r\nfrom tkinter import filedialog, simpledialog, messagebox\r\n#load additional python modules\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\n\r\n#create function to get a list of all files in a directory and its subdirectorie... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
FeU-aKlos/gdal | [
"bba6781133815248c9329842d365f8812b74c33f"
] | [
"swig/python/gdal-utils/osgeo_utils/gdal_merge.py"
] | [
"#!/usr/bin/env python3\n###############################################################################\n# $Id$\n#\n# Project: InSAR Peppers\n# Purpose: Module to extract data from many rasters into one output.\n# Author: Frank Warmerdam, warmerdam@pobox.com\n#\n################################################... | [
[
"numpy.isnan",
"numpy.choose",
"numpy.equal"
]
] |
shashankaryan/sudoku-generator | [
"3d71c6f1e75bc924c41a5e1e8a15f03584267a02"
] | [
"sudoku-generator.py"
] | [
"import numpy as np\nimport math\nimport random\nimport os\nimport multiprocessing\nfrom colorama import init, Fore, Back, Style\n\n\nclass SudokuGenerator(object) :\n \"\"\" Generate unique sudoku solutions everytime for n*n grids. \"\"\"\n\n def __init__(self, num):\n\n self.num = num\n\n def gene... | [
[
"numpy.zeros"
]
] |
jayjung121/CSE163-Python | [
"70f86826b81c17851c91e6593506f10e2b8e30b0"
] | [
"hw2/hw2_pandas.py"
] | [
"\nimport pandas as pd\n\n\n# Write your functions here!\ndef parse(file_name):\n '''\n This function takes .csv file and return pandas dataframe.\n '''\n return pd.read_csv(file_name, header=0)\n\n\ndef species_count(df):\n '''\n This function returns the number of unique Pokemon\n species (de... | [
[
"pandas.read_csv",
"pandas.unique"
]
] |
cxclark/hive_ml | [
"9e00b8028bfc5a6a913ac9319f4de5ea407977ec"
] | [
"hive_ml/layers/activation.py"
] | [
"import numpy as np\n\nclass ReluLayer:\n \"\"\"\n Implements ReLU nonlinearity elementwise.\n f(x) = max(0, x)\n \"\"\"\n\n def __init__(self):\n self.cache = {}\n self.type = 'relu'\n\n def forward(self, Z):\n \"\"\"\n Applies ReLU activation function to input Z.\n ... | [
[
"numpy.where"
]
] |
MonikaFJ/CarND-Behavioral-Cloning-P3 | [
"94a5550f6e5acddc86e48b482d2fe6e3c861d713"
] | [
"model_inception.py"
] | [
"import csv\nimport cv2\nimport numpy as np\nimport os\nfrom keras.applications.inception_v3 import InceptionV3\nimport tensorflow as tf\nfrom keras.models import Model\n\nfrom keras.models import Sequential\nfrom keras.layers.core import Dense, Activation, Flatten, Dropout, Lambda\nfrom keras.layers.convolutional ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"sklearn.utils.shuffle",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
seanrmcneil/CS7641-ML-public | [
"cb8a56c0422a8d80d6d833f34094fb5b6b5694fd"
] | [
"assignment1/run_experiment.py"
] | [
"import argparse\nfrom datetime import datetime\nimport logging\nimport numpy as np\n\nimport experiments\nfrom data import loader\n\n# Configure logging\nlogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')\nlogger = logging.getLogger(__name__)\n\n\ndef run_experim... | [
[
"numpy.random.randint"
]
] |
ReturnCloud/hindsight-experience-replay | [
"a7a461cc10b49815c29a12277a39b9615153a117"
] | [
"her_modules/her.py"
] | [
"import numpy as np\n\nclass her_sampler:\n def __init__(self, replay_strategy, replay_k, reward_func=None, is_her=False):\n self.replay_strategy = replay_strategy\n self.replay_k = replay_k\n if self.replay_strategy == 'future':\n self.future_p = 1 - (1. / (1 + replay_k))\n ... | [
[
"numpy.random.uniform",
"numpy.random.randint"
]
] |
alexliberzonlab/mixed_age_algae_population_modeling | [
"56735952515dd918b1e9abcabf914d7a1caa7f7d"
] | [
"algae_population.py"
] | [
"# collect all the functions to remove duplication\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport math\n\n# Create a new variable and store all\n# built-in functions within it using dir( ).\nnot_my_data = set(dir())\n\n\n# some definitions that we keep through the simulations... | [
[
"numpy.log",
"matplotlib.ticker.StrMethodFormatter",
"numpy.meshgrid",
"numpy.isnan",
"numpy.arange",
"matplotlib.pyplot.subplots",
"numpy.zeros_like",
"numpy.exp",
"scipy.interpolate.interp2d",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.sum"
]
] |
carlosb1/kornia | [
"a2b34d497314e7ed65f114401efdd3cc9ba2077c"
] | [
"kornia/augmentation/functional.py"
] | [
"from typing import Tuple, List, Union, Dict, cast, Optional\n\nimport torch\nimport torch.nn as nn\n\nfrom kornia.constants import Resample, BorderType, pi\nfrom kornia.geometry import (\n get_perspective_transform,\n get_rotation_matrix2d,\n get_affine_matrix2d,\n warp_perspective,\n rotate,\n c... | [
[
"torch.eye",
"torch.is_tensor",
"torch.where",
"torch.tensor"
]
] |
michellab/Siamese-RNN-Self-Attention | [
"a730e02153709b9c0e7f83deb0042ae9f9c1ce15"
] | [
"model/snn.py"
] | [
"\"\"\"\nImplements the Recurrent Siamese Neural Network (RSNN) model.\n\n\"\"\"\n\nimport numpy as np # Linear algebra\nimport pandas as pd # Data wrangling\n\n# Deep learning\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.nn.init as tnni\nimport torch.nn.utils.rnn as tnnur\nim... | [
[
"torch.nn.Softmax",
"torch.mean",
"torch.transpose",
"torch.abs",
"torch.cat",
"torch.nn.GRU",
"torch.sum",
"torch.nn.Embedding",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.BCEWithLogitsLoss",
"torch.cuda.is_available",
"torch.pow",
"torch.nn.Dropout",
... |
Leonui/BRECQ | [
"e455d62e93c70351961f8991c913b59435bd165f"
] | [
"linklink/dist_helper.py"
] | [
"import os\nimport torch\nimport pickle\nimport numpy as np\nimport linklink as link\n\n\ndef save_file(dict, name):\n if link.get_local_rank() == 0:\n torch.save(dict, name)\n\n\ndef dist_finalize():\n link.finalize()\n\n\nclass AllReduce(torch.autograd.Function):\n @staticmethod\n def forward(c... | [
[
"torch.ByteTensor",
"torch.cuda.set_device",
"torch.cuda.current_device",
"numpy.arange",
"torch.zeros_like",
"torch.cuda.device_count",
"torch.ByteStorage.from_buffer",
"torch.save"
]
] |
MezerLab/age-pred-r1 | [
"5e72fa3ede6306f779a262ded4e2c10d932df038"
] | [
"src/exploratory/qc_ringing.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Mar 10 13:43:27 2019\n\n@author: asier.erramuzpe\n\"\"\"\n### RINGING DETECTION MODULE\n# file1 = OK, file2 = RINGING, file2 = SLIGHT RINGING, file3 = SLIGHT FRONTAL MOVE\n\nfile1 = '/ems/elsc-labs/mezer-a/Mezer-Lab/analysis/reading_stanford/s... | [
[
"matplotlib.colors.LogNorm",
"numpy.abs",
"numpy.indices",
"numpy.cumsum",
"scipy.fftpack.fft2",
"numpy.log10",
"numpy.argsort",
"numpy.where",
"numpy.sum",
"numpy.hypot",
"scipy.fftpack.fftshift"
]
] |
YongyiTang92/tensorpack | [
"49675590da8a39c649b5f0f5ba522a22b90e2d69"
] | [
"examples/FasterRCNN/train.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: train.py\n\nimport argparse\nimport itertools\nimport numpy as np\nimport os\nimport shutil\nimport cv2\nimport six\nassert six.PY3, \"FasterRCNN requires Python 3!\"\nimport tensorflow as tf\nimport tqdm\n\nimport tensorpack.utils.viz as tpviz\nfrom tensorpa... | [
[
"tensorflow.get_variable",
"tensorflow.transpose",
"tensorflow.constant",
"tensorflow.gather_nd",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.sigmoid",
"tensorflow.expand_dims",
"tensorflow.placeholder",
"tensorflow.squeeze",
"numpy.concatenate",
"tensorfl... |
RyanStronge/AgileMTurk | [
"7f94173d3e9cf6e14081d9d624d26e1e1231ba4e"
] | [
"processing/processPolyline.py"
] | [
"import requests\nimport json\nfrom PIL import Image, ImageDraw\nimport numpy as np\nimport os\n#import cv2\nimport psycopg2\nimport time\n\nconn = psycopg2.connect(dbname=\"ddcdvtofrshbnj\", user=\"ntvhhmrhgzdmqh\", password=\"70f5719386ca8d7a4464e7ba903ff81ddbe1fe1d444071cc5ce4e1ad28059870\",\n ... | [
[
"numpy.asarray",
"numpy.array",
"numpy.empty"
]
] |
Vevn/ENVISIoN | [
"d0e48a5ec38ed95375f632eafdc5814415f0f570"
] | [
"inviwo/modules/fermi/tests/unittests/scripts/brillouin_zone.py"
] | [
"#\n# ENVISIoN\n#\n# Copyright (c) 2020 Alexander Vevstad\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 conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright noti... | [
[
"numpy.eye",
"numpy.zeros"
]
] |
maroacc/padel-video-classification | [
"3fcbe360fb84e7840634dadac76676098a8894a4"
] | [
"extractor.py"
] | [
"from keras.preprocessing import image\nfrom keras.applications.inception_v3 import InceptionV3, preprocess_input\nfrom keras.models import Model, load_model\nfrom keras.layers import Input\nimport numpy as np\n\nclass Extractor():\n def __init__(self, image_shape=(299, 299, 3), weights=None):\n \"\"\"Eit... | [
[
"numpy.expand_dims"
]
] |
trandinhson3086/cp-vton | [
"0e86598a95b5306f4fd262086b3fd0c0759a72aa"
] | [
"score_fid_infinity.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import Parameter as P\nfrom torchvision.models.inception import inception_v3\nfrom torch.utils.data import Dataset\nimport torchvision.transforms as transforms\nimport numpy as np\nimport math\nfrom sklearn.linear_model import Line... | [
[
"torch.nn.functional.softmax",
"numpy.linspace",
"torch.cat",
"torch.nn.functional.dropout",
"numpy.mean",
"torch.no_grad",
"torch.nn.functional.interpolate",
"numpy.iscomplexobj",
"numpy.exp",
"numpy.trace",
"torch.randn",
"numpy.eye",
"torch.tensor",
"nump... |
akash-chowdhary/akash-data-x-plaksha | [
"81a264ce8990c4d93e95c57ddb8f09d5d2a4a4d9"
] | [
"18-dataviz_elias/DASH_Plotly/dash_intro.py"
] | [
"#!/usr/bin/env python3\n\nimport pandas as pd\nimport plotly.express as px # (version 4.7.0)\nimport plotly.graph_objects as go\n\nimport dash # (version 1.12.0) pip install dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\n\napp = dash.Da... | [
[
"pandas.read_csv"
]
] |
PINE4PPLE/transformer-lm | [
"da76a4afd29d1fd023ba866ccc21a49901ad46f2"
] | [
"utils/beam_search.py"
] | [
"import torch\nEOS_ID = 1\nINF = 1. * 1e7\n\ndef _merge_beam_dim(tensor):\n \"\"\"Reshapes first two dimensions in to single dimension.\n\n Args:\n tensor: Tensor to reshape of shape [A, B, ...]\n\n Returns:\n Reshaped tensor of shape [A*B, ...]\n \"\"\"\n shape = list(tensor.shape)\n ... | [
[
"torch.ones",
"torch.max",
"torch.zeros",
"torch.cat",
"torch.reshape",
"torch.min",
"torch.lt",
"torch.logical_not",
"torch.unsqueeze",
"torch.tensor",
"torch.top_k",
"torch.any",
"torch.log",
"torch.where",
"torch.arange",
"torch.gather",
"torc... |
jamfly/segmented-phone-ST | [
"4df11fd14e79f8116243a06e6fcbeceb60cd0e6f"
] | [
"espnet/nets/pytorch_backend/conformer/decoder_layer.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Copyright 2019 Shigeki Karita\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"Decoder self-attention layer definition.\"\"\"\n\nimport torch\nfrom torch import nn\n\nfrom espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm\n... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Sigmoid",
"torch.cat"
]
] |
Di-Is/stylegan2-ada | [
"c1228c08a27fda80e512cfecf3b10c3c93c8b6d3"
] | [
"training/dataset.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution of this softwa... | [
[
"numpy.log2",
"numpy.dtype",
"numpy.concatenate",
"numpy.fromstring",
"numpy.floor",
"numpy.prod",
"numpy.load",
"numpy.zeros",
"numpy.random.randint"
]
] |
junwon1994/Coursera-ML | [
"91e96c3c14c058cd6d745a4fada1baf40d91458f"
] | [
"ex7/plotDataPoints.py"
] | [
"import matplotlib.pyplot as plt\nfrom show import show\n\n\ndef plotDataPoints(X, idx):\n \"\"\"plots data points in X, coloring them so that those\n with the same index assignments in idx have the same color\n \"\"\"\n # Create palette\n # palette = hsv(K + 1)\n # colors = palette(idx, :)\n #... | [
[
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.scatter"
]
] |
pzivich/MossSpider | [
"43cb6d22959afb47a9862f73754965473f42ddc1"
] | [
"mossspider/estimators/utils.py"
] | [
"import warnings\nimport numpy as np\nimport pandas as pd\nimport networkx as nx\nimport statsmodels.api as sm\n\n\ndef probability_to_odds(prob):\n \"\"\"Converts given probability (proportion) to odds\n\n Parameters\n ----------\n prob : float, array\n Probability or array of probabilities to c... | [
[
"numpy.asarray",
"numpy.nanvar",
"pandas.cut",
"numpy.repeat",
"numpy.where",
"numpy.sum"
]
] |
NeLy-EPFL/utils2p | [
"104620a55e0f5b6cf368e89131003773a5e877a4"
] | [
"utils2p/synchronization.py"
] | [
"\"\"\"\nSynchronization module\n======================\n\nThis module provides functions to process the synchronization data\nacquired with Thor Sync during imaging.\n\"\"\"\nimport warnings\nimport json\n\nimport numpy as np\nimport h5py\nimport scipy.signal\n\nimport utils2p.main as main\n\n\nclass Synchronizati... | [
[
"numpy.logical_not",
"numpy.ones_like",
"numpy.unique",
"numpy.arange",
"numpy.issubdtype",
"numpy.rint",
"numpy.cumsum",
"numpy.concatenate",
"numpy.all",
"numpy.zeros_like",
"numpy.diff",
"numpy.array",
"numpy.logical_and",
"numpy.where"
]
] |
billwright93/pybird | [
"32f51c831c2917bb6d402e309e28d08a31f5b655"
] | [
"cosmosis_module/pnl/bird_like.py"
] | [
"from cosmosis.datablock import names, option_section, SectionOptions\nimport numpy as np\nimport os\n\n\nclass BirdLikelihood(object):\n # I take as example TwoPointLikelihood\n # They subclass the Gaussian one, but we can't\n like_name = \"bird_like\"\n\n def __init__(self, options):\n # Genera... | [
[
"numpy.dot",
"numpy.log",
"numpy.sqrt",
"numpy.einsum",
"numpy.linalg.inv",
"numpy.diagflat",
"numpy.argwhere",
"numpy.concatenate",
"numpy.ones",
"numpy.linalg.det",
"numpy.array",
"numpy.zeros",
"numpy.loadtxt"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.