repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
jattenberg/ml_flower | [
"414a1ba3f93452d4c83e2084f4e70f127aaefacb"
] | [
"ml_flower/onnx_utils.py"
] | [
"def log_model(model, artifact_path, data):\n import io\n import torch\n import onnx\n import mlflow.onnx\n mlflow.set_tag(\"onnx_version\",onnx.__version__)\n f = io.BytesIO()\n torch.onnx.export(model, data, f)\n onnx_model = f.getvalue()\n mlflow.onnx.log_model(onnx_model, artifact_pat... | [
[
"torch.onnx.export"
]
] |
abartoha/python-snippets-ref | [
"04e4feada96077f0e849b277204c012194e8fbcd"
] | [
"Python-code-snippets-201-300/272-Animated-fire-effect.py"
] | [
"\"\"\"Code snippets vol-55\n 272-Animated fire effect\n\n Download all snippets so far:\n https://wp.me/Pa5TU8-1yg\n Blog: stevepython.wordpress.com\n\nRequirements:\npip3 install numpy\npip3 install pygame\n\nOrigin:\nhttps://github.com/beltoforion/recreational_mathematics_with_python/\nblob/master/fire.p... | [
[
"numpy.copy",
"numpy.zeros"
]
] |
GioLopez/PUJ-Buscaminas | [
"282f8abfe1e49ab8c9d306c696113357f78f0481"
] | [
"lib/python3/PUJ/Debug/Polynomial.py"
] | [
"## =========================================================================\n## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)\n## =========================================================================\n\nimport numpy\nimport matplotlib.pyplot as plot\nimport PUJ.Model.Linear\n\n'''\n'''\nclass P... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ioff",
"numpy.array",
"matplotlib.pyplot.ion"
]
] |
chaudha4/python-projects | [
"baba3235069b7d6b084f28904f0662c043762175"
] | [
"data_analysis/ch02-demographic_data_analyzer/demographic_data_analyzer.py"
] | [
"import pandas as pd\nimport pathlib\nimport os\n\ndef calculate_demographic_data(print_data=True):\n\n #print(pathlib.Path().absolute())\n\n try:\n #print(os.getcwd())\n df = pd.read_csv(\"./data_analysis/ch02-demographic_data_analyzer/adult.data.csv\")\n except:\n return \"\\n\\nCann... | [
[
"pandas.read_csv"
]
] |
joelmichelson/alpha-zero-general-with-Go-game | [
"387999f7b1dc9ae4a09cb7e2b885d17d1d800e68"
] | [
"go/pytorch/AlphaNet.py"
] | [
"import numpy as np\nimport torch.utils.model_zoo as model_zoo\nimport torch\nimport torchvision as tv\nimport torch.nn as nn\nfrom torch.nn.functional import Variable\nfrom scipy import misc\nimport math\nimport torch.nn.functional as F\n\nfrom torchvision.models.resnet import ResNet\nfrom torchvision.models.resne... | [
[
"torch.nn.Sequential",
"torch.nn.functional.log_softmax",
"torch.nn.functional.tanh",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
grawe/pyrsss | [
"31fd88734b00f814e7aaa5829c4ac49c7bf53563",
"31fd88734b00f814e7aaa5829c4ac49c7bf53563",
"31fd88734b00f814e7aaa5829c4ac49c7bf53563"
] | [
"pyrsss/gnss/ipp.py",
"pyrsss/emtf/util.py",
"pyrsss/signal/spectrum.py"
] | [
"import numpy as NP\nimport scipy.optimize\n\nfrom ..gpstk import PyPosition, point\n\n\ndef ipp_from_azel(stn_pos, az, el, ht=450, tol=1e-5):\n \"\"\"\n Compute the :class:`PyPosition` IPP for line-of-sight specified by\n the :class:`PyPosition` receiver position *stn_pos* and azimuth\n *az* (in degree... | [
[
"numpy.array"
],
[
"numpy.angle",
"numpy.abs",
"numpy.linspace"
],
[
"numpy.abs",
"numpy.linspace",
"numpy.fft.fft",
"numpy.fft.rfftfreq",
"numpy.arange",
"numpy.fft.rfft",
"numpy.cos",
"numpy.fft.fftshift",
"numpy.sin",
"numpy.zeros_like",
"nump... |
DPBayes/robust-private-lr | [
"ec36e51a52ea303055bbb72c129d12b4d21dcd8a"
] | [
"python/gdscdata/diffpri.py"
] | [
"#!/bin/env python3\n# Differentially private Bayesian linear regression \n# Arttu Nieminen 2016-2017\n# University of Helsinki Department of Computer Science\n# Helsinki Institute of Information Technology HIIT\n\n# GDSC/drug sensitivity data\n# Tools for executing the robust private linear regression algorithm an... | [
[
"numpy.dot",
"matplotlib.pyplot.imshow",
"numpy.sqrt",
"matplotlib.pyplot.autoscale",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.nanmean",
"scipy.stats.spearmanr",
"numpy.random.laplace",
"numpy.nanstd",
"numpy.allclose",
"numpy.linalg.eig",
"numpy.arange",
... |
sooftware/nvidia-tacotron2 | [
"6c44cbd1ddd20e6607cec1ef7612432e85ae45e8"
] | [
"hparams.py"
] | [
"import tensorflow as tf\nfrom text import VOCAB_DICT\n\n\ndef create_hparams(hparams_string=None, verbose=False):\n \"\"\"Create model hyperparameters. Parse nondefault from given string.\"\"\"\n\n hparams = tf.contrib.training.HParams(\n ################################\n # Experiment Paramete... | [
[
"tensorflow.logging.info"
]
] |
mahdiqezlou/LyTomo-Watershed | [
"76940101c6cc46cd7f1b2622f72c198f55a45251"
] | [
"src/lytomo_watershed/paint_map.py"
] | [
"import h5py\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport imageio\nfrom scipy.ndimage import gaussian_filter as gf\nfrom . import spectra_mocking as sm\nfrom . import minima\nfrom . import load_data\n\nclass Paint:\n \"\"\" A class to paint stoughs on flux map \"\"\"\n def __init__(self, m_da... | [
[
"scipy.ndimage.gaussian_filter",
"numpy.sqrt",
"numpy.abs",
"numpy.arange",
"matplotlib.pyplot.get_cmap",
"numpy.cos",
"numpy.ones",
"numpy.sin",
"numpy.std",
"numpy.array",
"numpy.where",
"numpy.empty"
]
] |
annlor/energy-usage | [
"eb26f34611fc7b9b64d412386ff655004ed7121a",
"eb26f34611fc7b9b64d412386ff655004ed7121a"
] | [
"energyusage/graph.py",
"energyusage/raw_to_json.py"
] | [
"import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nFONTSIZE = 20\nTITLESIZE = 30\nplt.rcdefaults()\n\n\"\"\"\nCreates a pie chart based on the energy composition. Takes a dictionary mapping energy to percent\nbased on energy types:\n- Coal\n- Oil/Petroleum\n- Natural ... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.use",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.close",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.rcdefaults",... |
sibirbil/SimpleKernels | [
"7fc4f5a784bb2256129874064f3fbf16ae5b4b4e"
] | [
"Figure_3_Run.py"
] | [
"#standard imports from numpy, scikit-learn and matplotlib\nimport numpy as np\nfrom time import time\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import accuracy_score\nfrom sklearn import svm, pipeline\nfrom sklearn.svm import LinearSVC\nfrom sklearn.kernel_approximation import (RBFSampler,Nystroem)\nfr... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.min",
"numpy.arange",
"sklearn.kernel_approximation.Nystroem",
"sklearn.kernel_approximation.RBFSampler",
"matplotlib.pyplot.subplot",
"sklearn.svm.SVC",
"sklearn.svm.LinearSVC",
"sklearn.preprocessing.StandardScaler",
"matplotlib.py... |
tingsyo/qpetw | [
"e0f87a401649b367506370beeffaeffcc9484407",
"e0f87a401649b367506370beeffaeffcc9484407"
] | [
"utils/dbz_ipca_with_filter.py",
"utils/dbz_ipca_transform.py"
] | [
"#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nPurpose: Perform Incremental PCA on QPESUMS data.\r\nDescription:\r\n--input: directory that contains QPESUMS data as *.npy (6*275*162)\r\n--output: the prefix of output files.\r\n--filter: the file contains a list of timestamp that filters the input da... | [
[
"numpy.log",
"pandas.read_csv",
"sklearn.decomposition.IncrementalPCA",
"pandas.DataFrame",
"numpy.floor",
"numpy.transpose",
"numpy.mod",
"numpy.load",
"numpy.array",
"numpy.zeros"
],
[
"numpy.log",
"pandas.DataFrame",
"numpy.transpose",
"numpy.load",
... |
chanul13/hubbard_dimer | [
"0a1eefdf4cb5cc5f80bd3348d045a90890f51b6c"
] | [
"dmrg101/utils/tridiagonal_solver/sturmSeq.py"
] | [
"## module sturmSeq\r\n''' p = sturmSeq(c,d,lam).\r\n Returns the Sturm sequence {p[0],p[1],...,p[n]}\r\n associated with the characteristic polynomial\r\n |[A] - lam[I]| = 0, where [A] = [c\\d\\c] is a n x n\r\n tridiagonal matrix.\r\n\r\n numLam = numLambdas(p).\r\n Returns the number of eigenva... | [
[
"numpy.ones"
]
] |
AstroPathJHU/AstroPathPipeline | [
"3b0d9cdad18b84e55d00724f89f09bc7f7464c98"
] | [
"astropath/slides/align/computeshift.py"
] | [
"import cv2, matplotlib.pyplot as plt, numba as nb, numpy as np, scipy.interpolate, scipy.optimize, skimage.feature, skimage.filters, textwrap, uncertainties as unc\n\ndef computeshift(images, *, gputhread=None, gpufftdict=None, windowsize=10, smoothsigma=None, window=None, showsmallimage=False, savesmallimage=None... | [
[
"numpy.all",
"numpy.mean",
"numpy.roll",
"numpy.linalg.eig",
"numpy.real",
"matplotlib.pyplot.close",
"numpy.ravel",
"numpy.fft.fft2",
"numpy.linalg.inv",
"matplotlib.pyplot.savefig",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.sum",
"matplotlib.pyplot.y... |
hubmapconsortium/hubmap-data-portal | [
"eab2f8fc97075d977d7e2412b85cb58b17cdd2e8"
] | [
"hubmap/dataportal/views.py"
] | [
"import matplotlib.cm\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\nfrom django.contrib.auth.decorators import login_required\nfrom django.contrib.auth.models import AnonymousUser, Group\nfrom django.utils.decorators import method_decorator\nfrom rest_framework import generics, permissions, status,... | [
[
"numpy.zeros"
]
] |
cmh1027/Community-Analyzer | [
"dffb0349316e4a3612aec27f6afcd1e42a7053b3"
] | [
"doc2vec.py"
] | [
"from gensim.models.doc2vec import Doc2Vec, TaggedDocument\nfrom tqdm import trange\nfrom utility import constant\nimport json, os\nimport torch\nfrom utility import constant\nfrom tqdm import trange\nimport matplotlib.pyplot as plt\n\nif __name__ == \"__main__\":\n for format in constant.FORMATS:\n token... | [
[
"torch.var",
"torch.mean",
"torch.save",
"torch.tensor"
]
] |
simpeg-research/iris-mt-scratch | [
"ea458f253071db513fd0731118a2a7452a725944"
] | [
"iris_mt_scratch/sandbox/transfer_function/TRME.py"
] | [
"\"\"\"\nfollows Gary's TRME.m in\niris_mt_scratch/egbert_codes-20210121T193218Z-001/egbert_codes/matlabPrototype_10-13-20/TF/classes\n\n% 2009 Gary Egbert , Maxim Smirnov\n% Oregon State University\n\n%\n% (Complex) regression-M estimate for the model Y = X*b\n%\n% Allows multiple columns of Y, but estimates b ... | [
[
"numpy.diag",
"numpy.linalg.svd",
"numpy.minimum",
"numpy.abs",
"numpy.sum",
"numpy.sqrt",
"numpy.matmul",
"numpy.linalg.norm",
"numpy.ones",
"numpy.real",
"numpy.transpose",
"numpy.linalg.qr",
"numpy.exp",
"numpy.zeros",
"scipy.linalg.solve_triangular"
... |
anishacharya/nlp-wrapper | [
"c9722d541c8f90c178330483eaf060d6dd52f357"
] | [
"common/evaluation/evaluate_classifier.py"
] | [
"from common.utils.utils import argmax_from_onehot\nimport sklearn.metrics as metrics\nimport numpy as np\nimport torch\n\n\ndef binary_accuracy(y_hat, y):\n # round predictions to the closest integer\n correct = 0\n examples = len(y)\n for pred, true in zip(y_hat, y):\n y_pred = argmax_from_oneh... | [
[
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"sklearn.metrics.accuracy_score"
]
] |
Qwerty71/tensorflow | [
"45e1e4598d3ebab316bf87df9160656f524af36c"
] | [
"tensorflow/python/compat/compat.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.util.tf_export.tf_export"
]
] |
s-ryosky/ST3D | [
"73dda8c131b960f6970ffd49d44d0f15f6f60f00",
"73dda8c131b960f6970ffd49d44d0f15f6f60f00"
] | [
"pcdet/datasets/augmentor/augmentor_utils.py",
"pcdet/utils/self_training_utils.py"
] | [
"import torch\nimport numpy as np\nimport numba\nimport copy\nfrom ...utils import common_utils\nfrom ...ops.roiaware_pool3d import roiaware_pool3d_utils\nfrom ...ops.iou3d_nms import iou3d_nms_utils\n\nimport warnings\ntry:\n from numba.errors import NumbaPerformanceWarning\n warnings.filterwarnings(\"ignore... | [
[
"numpy.logical_xor",
"numpy.expand_dims",
"numpy.random.choice",
"torch.from_numpy",
"numpy.ones",
"numpy.max",
"numpy.random.permutation",
"numpy.random.uniform",
"numpy.array"
],
[
"torch.no_grad",
"numpy.array",
"torch.distributed.is_initialized",
"numpy.... |
Asjidkalam/studio | [
"5a4f2bbd6a2e3508d740404b0177f21c0c412f6e"
] | [
"studio/model_util.py"
] | [
"import types\ntry:\n import keras\n from keras.preprocessing import image as image_prep\nexcept ImportError:\n keras = None\n\nfrom . import logs\n\nfrom PIL import Image\n\ntry:\n from Queue import Full, Empty, Queue\nexcept ImportError:\n from queue import Full, Empty, Queue\n\nfrom threading impo... | [
[
"numpy.random.random",
"numpy.mean"
]
] |
YueCao94/learning-to-learn | [
"0c80d67493a40cb5c81c64660dc3f7d0b4cd3273"
] | [
"meta.py"
] | [
"# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.variables_initializer",
"tensorflow.train.AdamOptimizer",
"tensorflow.while_loop",
"tensorflow.Variable",
"tensorflow.greater",
"tensorflow.gradients",
"tensorflow.stop_gradient",
"tensorflow.add",
"tensorflow.name_sc... |
HonoMi/jiant | [
"61acb4a73e4c9c2a7ba0e279d3f652b27cce8f24"
] | [
"jiant/scripts/download_data/dl_datasets/files_tasks.py"
] | [
"import json\nimport logging\nimport os\nimport pandas as pd\nimport re\nimport shutil\nimport tarfile\nfrom operator import itemgetter\nfrom collections import Counter\nimport logging\n\nimport jiant.scripts.download_data.utils as download_utils\nimport jiant.utils.display as display\nimport jiant.utils.python.fil... | [
[
"pandas.isnull"
]
] |
juneweng/PASSL | [
"491f5d9010a0efb6e2382791c353dc57b0b76ae9",
"491f5d9010a0efb6e2382791c353dc57b0b76ae9"
] | [
"passl/modeling/backbones/clip.py",
"passl/datasets/preprocess/transforms.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.\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 req... | [
[
"numpy.log"
],
[
"numpy.random.uniform",
"numpy.array"
]
] |
kenakai16/vietnam_ocr | [
"9d1542e6bcaec35fcafe42a9bb47d668090af8fe"
] | [
"train_pytorch_ctc.py"
] | [
"from __future__ import print_function\nimport argparse\nimport random\nimport torch\n# import torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nfrom torch.autograd import Variable\nimport numpy as np\n# from warpctc_pytorch import CTCLoss\nfrom torch.nn import CTCLoss\nimport uti... | [
[
"numpy.random.seed",
"torch.isnan",
"torch.load",
"torch.manual_seed",
"torch.nn.CTCLoss",
"torch.device"
]
] |
vlbthambawita/singan-seg-polyp | [
"8764cf1d813c99f9e646419ff219b34ad8a8e1f5"
] | [
"singan_seg_polyp/SinGAN/manipulate.py"
] | [
"from __future__ import print_function\nimport singan_seg_polyp.SinGAN.functions\nimport singan_seg_polyp.SinGAN.models\nimport argparse\nimport os\nimport random\nfrom singan_seg_polyp.SinGAN.imresize import imresize\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\nimport torchvision.d... | [
[
"matplotlib.pyplot.imsave",
"numpy.dstack"
]
] |
yoshida-lab/pythroughput | [
"ea52f27507a7e103c1a33f24db8dd882c27c77e3"
] | [
"pythroughput/model/modelanalyser.py"
] | [
"# coding: utf-8\n# Copyright (c) 2018-2019, Taku MURAKAMI. All rights reserved.\n# Distributed under the terms of the BSD 3-clause License.\n\nimport logging\nimport numpy\nimport pymatgen\nfrom pymatgen.io.vasp.inputs import Poscar\n\n\"\"\"\nModel analyser.\n\"\"\"\n\nlogger = logging.getLogger(__name__)\n\n\ncl... | [
[
"numpy.array",
"numpy.linalg.norm"
]
] |
ktmurray1999/dopamine-drosophila | [
"13410a93461baf33a2c4f4fdec58fa9840213963"
] | [
"simpleModel.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 2 14:20:18 2022\n\n@author: murra\n\"\"\"\nimport torch\nimport torch.nn as nn\n\npnCells = 3\nknCells = 50\nmbonCells = 10\ndanCells = 10\n \nclass KenyonCell(nn.Module):\n def __init__(self, tau, RC, batch, dt):\n super(KenyonCell, self).__init__(... | [
[
"torch.ones",
"torch.zeros",
"torch.reshape",
"torch.unsqueeze",
"torch.tensor",
"torch.nn.Sigmoid",
"torch.matmul",
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.squeeze"
]
] |
olgabot/modish | [
"f3fafebcbe6b525d9b461eb02494399229402269"
] | [
"anchor/visualize.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"See log bayes factors which led to modality categorization\"\"\"\nimport locale\n\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\n\n\nlocale.setlocale(locale.LC_ALL, 'en_US')\n\n\n\ndarkblue, green, red, purp... | [
[
"matplotlib.pyplot.gca",
"pandas.Categorical",
"matplotlib.pyplot.subplot2grid",
"matplotlib.pyplot.figure"
]
] |
stoil-ganev/mmpose | [
"88c984155d2a07f1d409cf6b3aee01a7ccdebdb8",
"88c984155d2a07f1d409cf6b3aee01a7ccdebdb8"
] | [
"mmpose/models/losses/mesh_loss.py",
"mmpose/datasets/datasets/top_down/topdown_jhmdb_dataset.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nimport torch.nn as nn\n\nfrom ..builder import LOSSES\nfrom ..utils.geometry import batch_rodrigues\n\n\ndef perspective_projection(points, rotation, translation, focal_length,\n camera_center):\n \"\"\"This function comput... | [
[
"torch.nn.SmoothL1Loss",
"torch.zeros",
"torch.einsum",
"torch.eye",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.L1Loss",
"torch.stack",
"torch.nn.ReLU",
"torch.nn.MSELoss"
],
[
"numpy.minimum",
"numpy.linalg.norm",
"numpy.max",
"numpy.array",
"numpy.zeros"
... |
zhang-alvin/proteus_old | [
"5f9419175daa1ee1ceac32444bdfce7491910da9",
"5f9419175daa1ee1ceac32444bdfce7491910da9",
"5f9419175daa1ee1ceac32444bdfce7491910da9"
] | [
"proteus/tests/LS_with_edgeBased_EV/NCLS/test_ncls.py",
"proteus/tests/LS_with_edgeBased_EV/VOF/test_vof.py",
"proteus/SWFlows/tests/solitary_steady_state/SWFlow.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nTest module for NCLS with EV\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom builtins import object\nfrom proteus.iproteus import *\nfrom proteus import Comm\ncomm = Comm.get()\nProfiling.logLevel=2\nProfiling.verbose=True\nimport numpy as np\nimport tables\nimport sys\nsys.p... | [
[
"numpy.array"
],
[
"numpy.array"
],
[
"numpy.cosh",
"numpy.tanh",
"numpy.sqrt"
]
] |
samyakjain3001/Build-ML-Algos-From-Scratch | [
"739d2a85f01b8fd11bc3136ab067a41f8a614451"
] | [
"Supervised/Regression/knn.py"
] | [
"import pandas as pd\nimport numpy as np\nimport math\nfrom sklearn.datasets import load_digits, load_iris, load_boston, load_breast_cancer\nfrom sklearn.model_selection import train_test_split\n\n\nclass KNeighbours():\n def __init__(self, k = 5, distance_metric = 'euclid', problem = \"classify\"):\n sel... | [
[
"numpy.asarray",
"sklearn.model_selection.train_test_split",
"numpy.mean",
"sklearn.datasets.load_boston",
"numpy.array",
"numpy.sum"
]
] |
SergioLaRosa/Twitter_Extraction_Analysis | [
"0dd63f21350788cd4dc9ae6b245b656ef1ef13af"
] | [
"country_plotter.py"
] | [
"#!/usr/bin/env python3\n\nimport csv\nimport sys\nfrom collections import Counter\nimport argparse\nimport os\nimport warnings\nimport multiprocessing\ntry:\n import matplotlib.cbook\nexcept ImportError:\n print(\"[ERROR] Unable to import MatPlotLib module! Exit...\")\n sys.exit()\ntry:\n import geocod... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.pie",
"matplotlib.pyplot.show"
]
] |
vidyabhandary/BuildML | [
"f8e66ea11935cb68219f0f1fda88f7023c0564bb"
] | [
"ml_editor/ch7_model_v2.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jan 6 08:31:44 2021\n\n@author: Vidya\n\"\"\"\n\nimport os\nfrom pathlib import Path\n\nimport spacy\nfrom sklearn.externals import joblib\nfrom tqdm import tqdm\nimport pandas as pd\nimport nltk\nfrom scipy.sparse import vstack, hstack\n\nnltk.download('vader_lexic... | [
[
"scipy.sparse.hstack",
"scipy.sparse.vstack",
"sklearn.externals.joblib.load",
"pandas.DataFrame"
]
] |
lucasthim/covid19-prediction | [
"c08b6bc396218b2d42fb612d9f57552192dc9960"
] | [
"utils/metrics_utils.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom sklearn.metrics import confusion_matrix,recall_score, classification_report, auc, roc_curve,roc_auc_score\n\nplt.style.use('seaborn')\n\ndef evalute_model_performance(model,model_name,X,y,df_result):\n plot_c... | [
[
"sklearn.metrics.roc_auc_score",
"matplotlib.pyplot.legend",
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.roc_curve",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"sklearn.metrics.classification_report",
... |
MikeOMa/DriftMLP | [
"e7ba3b170f31dd13f37504d778aaf7ff980b15db",
"e7ba3b170f31dd13f37504d778aaf7ff980b15db"
] | [
"driftmlp/drifter_indexing/makehdf5/__init__.py",
"tests/test_network_creation.py"
] | [
"import os\n\nimport h5py\nimport numpy as np\nimport pandas as pd\n\n\ndef make_all_strings_len2(str_array):\n out = np.array(\n [\"0\" + string if len(string) == 1 else string for string in str_array],\n dtype=\"str\",\n )\n return out\n\n\ndef makeHDF5(hf, folder_raw=\"raw_data\", folder_m... | [
[
"pandas.read_csv",
"numpy.full",
"numpy.floor",
"numpy.mod",
"numpy.array",
"pandas.to_numeric"
],
[
"numpy.vstack",
"numpy.linspace"
]
] |
szenergy/szenergy-path-tracking | [
"83cccd326d9999234e289507e35e65531a86bed9"
] | [
"multi_goal_pure_pursuit/scripts/datacollector_plot_circular.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\nimport glob, os\n\n#x = pd.read_csv(\"./data/simple_pure_pursuit.csv\")\n#x = pd.read_csv(\"./data/simple_pure_pursuit_long.csv\")\n#x = pd.read_csv(\"./data/2019_November_15_01_26_25.csv\")\n\n# Circular track \nx = pd.read_csv(\"./data/2019_November_15_23_00_... | [
[
"matplotlib.pyplot.gca",
"pandas.read_csv",
"matplotlib.pyplot.show"
]
] |
k-dominik/nifty | [
"067e137e9c1f33cccb22052b53ff0d75c288d667",
"067e137e9c1f33cccb22052b53ff0d75c288d667",
"067e137e9c1f33cccb22052b53ff0d75c288d667"
] | [
"src/python/module/nifty/graph/rag/__init__.py",
"src/python/module/nifty/graph/agglo/__init__.py",
"src/python/test/hdf5/test_hdf5.py"
] | [
"from __future__ import absolute_import\nfrom . import _rag as __rag\nfrom ._rag import *\nfrom .. import Configuration\n\nimport numpy\n\n\n__all__ = []\nfor key in __rag.__dict__.keys():\n try:\n __rag.__dict__[key].__module__='nifty.graph.rag'\n except:\n pass\n\n __all__.append(key)\n\n\n... | [
[
"numpy.issubdtype",
"numpy.require"
],
[
"numpy.concatenate",
"numpy.arange",
"numpy.require",
"numpy.ones"
],
[
"numpy.arange",
"numpy.array_equal",
"numpy.ones"
]
] |
nsanina/pandapipes | [
"b2daaca6b83e7d8934502796721846bd9d552364",
"b2daaca6b83e7d8934502796721846bd9d552364"
] | [
"pandapipes/test/pipeflow_internals/test_pipeflow_modes.py",
"pandapipes/create.py"
] | [
"# Copyright (c) 2020 by Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IEE), Kassel. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.\n\nimport os\n\nimport numpy as np\nimport pandapipes as pp\nimport pandas as pd... | [
[
"numpy.all",
"numpy.concatenate",
"numpy.abs"
],
[
"numpy.zeros"
]
] |
FrederikLehn/alveus | [
"71a858d0cdd8a4bbd06a28eb35fa7a8a7bd4814b"
] | [
"alveus/charts.py"
] | [
"import math\r\nimport numpy as np\r\nfrom pubsub import pub\r\nimport wx\r\nimport wx.grid\r\nimport matplotlib as mpl\r\nimport matplotlib.figure\r\nimport matplotlib.dates as mdates\r\nmpl.use('WXAGG')\r\nimport matplotlib.pyplot as plt\r\nfrom mpl_toolkits.mplot3d import axes3d\r\nfrom matplotlib.widgets import... | [
[
"matplotlib.dates.DateFormatter",
"matplotlib.figure.Figure",
"matplotlib.use",
"numpy.round",
"matplotlib.widgets.RectangleSelector",
"matplotlib.dates.YearLocator",
"matplotlib.backends.backend_wxagg.FigureCanvasWxAgg",
"matplotlib.pyplot.text",
"matplotlib.dates.num2date",
... |
Levin-Kobelke/CNN-only-Numpy | [
"82866094f03e6bc60bee346421a2960158429943",
"82866094f03e6bc60bee346421a2960158429943"
] | [
"numpyNet/imports/layer_conv_V3.py",
"numpyNet/imports/customdataset.py"
] | [
"import numpy as np\n\n \nclass Layer_conv:\n \"\"\"\n Should take as input data from the previous layer in format H,W,C,N height, width, channel, Number\n and return H,W,C,N where H,W is dependent on the filter size and step size, but are equal to the inputs for\n paddin... | [
[
"numpy.expand_dims",
"numpy.pad",
"numpy.squeeze",
"numpy.ones",
"numpy.shape",
"numpy.lib.stride_tricks.sliding_window_view",
"numpy.average",
"numpy.zeros",
"numpy.sum",
"numpy.random.default_rng"
],
[
"pandas.read_csv",
"torch.tensor"
]
] |
sourcery-ai-bot/pystiche | [
"57bc6cfd074d47e8ad98a4f6e570b92ce37131bc"
] | [
"pystiche/papers/johnson_alahi_li_2016/data.py"
] | [
"from typing import Optional, Sized, Tuple\nfrom urllib.parse import urljoin\n\nimport torch\nfrom torch.utils.data import DataLoader, Dataset, Sampler\n\nfrom pystiche.data import (\n DownloadableImage,\n DownloadableImageCollection,\n FiniteCycleBatchSampler,\n ImageFolderDataset,\n)\nfrom pystiche.im... | [
[
"torch.utils.data.DataLoader"
]
] |
ilkeratik/PythonRobotics | [
"ee729d6b6ef1809c4cd402531e8fdce91a54d155"
] | [
"PathTracking/rear_wheel_feedback/rear_wheel_feedback.py"
] | [
"\"\"\"\n\nPath tracking simulation with rear wheel feedback steering control and PID speed control.\n\nauthor: Atsushi Sakai(@Atsushi_twi)\n\n\"\"\"\nimport matplotlib.pyplot as plt\nimport math\nimport numpy as np\n\nfrom scipy import interpolate\nfrom scipy import optimize\n\nKp = 1.0 # speed proportional gain\... | [
[
"matplotlib.pyplot.legend",
"scipy.optimize.fmin_cg",
"numpy.arange",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.gcf",
"numpy.arctan2",
"matplotlib.pyplot.plot",
"scipy.interpolate.CubicSpline",
"matplotlib.pyplot.axis",
"matplotlib.pyplot... |
thjashin/gpytorch | [
"92b3278eeb1ec93219f2a3921742a10aba9c8ceb"
] | [
"gpytorch/functions/_inv_matmul.py"
] | [
"#!/usr/bin/env python3\n\nimport torch\nfrom torch.autograd import Function\n\nfrom .. import settings\n\n\ndef _solve(lazy_tsr, rhs):\n from ..lazy import CholLazyTensor, TriangularLazyTensor\n\n if isinstance(lazy_tsr, (CholLazyTensor, TriangularLazyTensor)):\n return lazy_tsr.inv_matmul(rhs)\n i... | [
[
"torch.no_grad",
"torch.cat"
]
] |
velatkilic/mot | [
"44fcfdb9ceb448ab9eaa44f46885c6ddc4484fd8"
] | [
"tests/test_DNN.py"
] | [
"from unittest import TestCase\nimport torch\nfrom xmot.datagen.bead_gen import BeadDataset, Beads, collate_fn, BeadDatasetFile\nfrom xmot.mot.detectors import DNN\nimport os\n\n\nclass TestDNN(TestCase):\n\n def test_DNN_train_with_beads(self):\n beads = Beads()\n dset = BeadDataset(beads, length=... | [
[
"torch.utils.data.DataLoader"
]
] |
cipang/researchstats | [
"7b1ab2a63a7d5e27546add98bb5e555f1c1152e8"
] | [
"anova.py"
] | [
"import pandas as pd\n\nfrom scipy import stats\n\n\n#\n# One-way ANOVA for repeated measures.\n# Reference: https://www.marsja.se/four-ways-to-conduct-one-way-anovas-using-python/\n#\ndef do_anova(label: str, data: pd.DataFrame, col_group: str, col_value: str) -> pd.DataFrame:\n groups = pd.unique(data[col_grou... | [
[
"scipy.stats.f_oneway",
"pandas.unique",
"pandas.DataFrame"
]
] |
mariojy10/MMG-Mass-Classification | [
"b72c067092e809002b5a631fbe7bc93ef8c44b7e"
] | [
"inference.py"
] | [
"import cv2\nimport numpy as np\n\nimport argparse\nfrom pathlib import Path\n\nimport torch\nfrom torch.nn import functional as F\n\n\nNAMES = ['benign','malignant']\nMAX_VALUES_BY_DTYPE = {\n np.dtype(\"uint8\"): 255,\n np.dtype(\"uint16\"): 65535,\n np.dtype(\"uint32\"): 4294967295,\n np.dtype(\"floa... | [
[
"torch.nn.functional.softmax",
"torch.max",
"torch.load",
"torch.from_numpy",
"torch.unsqueeze",
"numpy.dtype",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device"
]
] |
Iscaraca/FitTogether | [
"2fd77928df3157dbbe4ff76a6cb05a67f23c7f0b"
] | [
"Tracking/deep_sort/linear_assignment.py"
] | [
"import numpy as np\nfrom scipy.optimize import linear_sum_assignment\nfrom . import kalman_filter\n\n\nINFTY_COST = 1e+5\n\n\ndef min_cost_matching(\n distance_metric, max_distance, tracks, detections, track_indices=None,\n detection_indices=None):\n \"\"\"Solve linear assignment problem.\n\n P... | [
[
"scipy.optimize.linear_sum_assignment"
]
] |
Open-Speech-EkStep/punctuation-ITN | [
"d4b8340786a836d44b510ff981667a37cac4b65e"
] | [
"sequence_labelling/token_classification/train.py"
] | [
"import os\nimport warnings\nimport json\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom sklearn.metrics import accuracy_score, f1_score, classification_report\nfrom torch.utils.tensorboard import SummaryWriter\nfrom tqdm import tqdm\nfrom transformers import AlbertForTokenClassification, AdamW, ge... | [
[
"torch.load",
"numpy.unique",
"sklearn.metrics.accuracy_score",
"torch.utils.data.DataLoader",
"torch.is_tensor",
"torch.nn.DataParallel",
"numpy.argmax",
"torch.no_grad",
"torch.utils.tensorboard.SummaryWriter",
"sklearn.metrics.f1_score",
"torch.cuda.device_count",
... |
eapcivil/EXUDYN | [
"52bddc8c258cda07e51373f68e1198b66c701d03",
"52bddc8c258cda07e51373f68e1198b66c701d03"
] | [
"main/pythonDev/TestModels/pendulumFriction.py",
"main/pythonDev/Examples/SliderCrank.py"
] | [
"#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n# This is an EXUDYN example\n#\n# Details: Mathematical pendulum with friction;\n# Remark: uses two friction models: CoordinateSpringDamper and CartesianSpringDamper\n#\n# Author: Johannes Gerstmayr\n# Date: 2019-12-26... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.plot",
"matplotlib.ticker.MaxNLocator",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel"
],
[
"matplotlib.pyplot.gc... |
SihongHo/IROS_Noise_MADDPG | [
"867d8f9185ed4c5609f767f5bd74d3e3c50c603d"
] | [
"experiments/train.py"
] | [
"import argparse\nimport numpy as np\nimport tensorflow as tf\nimport time\nimport pickle\nimport sys\nimport os\n\nsys.path.append('../')\nsys.path.append('../../')\nsys.path.append('../../../')\n\nimport maddpg.common.tf_util as U\nfrom maddpg.trainer.maddpg import MADDPGAgentTrainer\nimport tensorflow.contrib.la... | [
[
"scipy.stats.truncnorm",
"tensorflow.contrib.layers.fully_connected",
"numpy.mean",
"tensorflow.variable_scope",
"tensorflow.train.Saver"
]
] |
harisbal/dash-deck | [
"2702bc612c1d5dea1602bec6352a794c312a7c6a"
] | [
"demos/usage-h3-cluster-layer.py"
] | [
"\"\"\"\nAdapted from: https://pydeck.gl/gallery/h3_cluster_layer.html\n\nData grouped by H3 geohash, as an example of one of the geohash schemes \nsupported by pydeck. If you'd simply like to plot a value at an H3 hex \nID, see the H3HexagonLayer.\n\n\"\"\"\nimport os\n\nimport dash\nimport dash_deck\nimport dash_... | [
[
"pandas.read_json"
]
] |
fral92/yapt | [
"4bdb4eeed27cd0f1974f3b46ca663b9af7a80c6b"
] | [
"examples/mnist/model.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch import nn\nfrom torch import optim\n\nfrom collections import OrderedDict\nfrom yapt import BaseModel\nfrom yapt.utils.torch_helpers import get_optimizer\nfrom yapt.utils.metrics import AverageMeter, ConfusionMatrix\n\n\nclass Classifier(BaseModel):\n\n ... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.Dropout",
"torch.nn.functional.nll_loss",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.nn.functional.log_softmax",
"torch.nn.Tanh",
"torch.nn.Linear",
"torch.no_grad"
]
] |
AndreasSahlberg/electrification-scenario-discovery | [
"a7fd9bb407e6030a22e4e970ea6e3c110ae6d205"
] | [
"test/test_grid_penalty.py"
] | [
"import os\n\nfrom onsset import SettlementProcessor\n\nfrom pandas import DataFrame , Series\nfrom pandas.testing import assert_frame_equal , assert_series_equal\nfrom pytest import fixture\n\n\"GRIDPENALTY\"\nclass TestSettlementProcessor:\n\n @fixture\n def setup_settlementprocessor(self) -> SettlementProc... | [
[
"pandas.testing.assert_series_equal",
"pandas.Series",
"pandas.DataFrame"
]
] |
bingsome/Neurospice | [
"9e851c359a38ac2d65c5505a3b58b0c233cbdda7"
] | [
"Neurospice/BasicGeometries.py"
] | [
"import numpy as np\nimport random\nfrom math import sqrt\nimport pygmsh\n\n\nclass SphericalNodes():\n\t\n\t'''\n\tSpericalNodes class generates a spherical distribution of nodes such that the density of nodes lies along a smooth gradient leading away from the center. Arguments are:\n\t\n\tradius = microns\n\tnode... | [
[
"numpy.sqrt",
"numpy.arange",
"numpy.cos",
"numpy.sin",
"numpy.max",
"numpy.array"
]
] |
szhao045/scMPRA | [
"68cd4ed1b28909100507369be0fcc9e37c2d8bb2"
] | [
"scripts/cell_bcs_filtering.py"
] | [
"import os, sys\nimport pandas as pd\nimport numpy as np\nimport pickle\nimport argparse\n\n'''\nIt feels like the progress in this analysis pipeline is a bit \ntoo slow, but it is always slow.\n'''\n\ndef hammingDist(str1, str2):\n '''\n Calculating hamming distance of two strings\n https://www.geeksforge... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
mengjian0502/cifar10-fast | [
"12066d062fbaebde331a67f831ad6f31d2b9beef"
] | [
"utils.py"
] | [
"import os\nimport torch\nimport tabulate\nimport torch.nn as nn\nimport pandas as pd\nimport matplotlib\nimport numpy as np\nmatplotlib.use('svg')\nimport matplotlib.pyplot as plt\nplt.rcParams.update({'font.size': 24})\n\nclass Hook_record_input():\n def __init__(self, module):\n self.hook = module.regi... | [
[
"numpy.asarray",
"matplotlib.use",
"numpy.isnan",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"torch.exp",
"numpy.ceil",
"torch.autograd.set_grad_enabled",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.rcParams.update",
"torch.ones_like",
"matplotlib.pyplot.figu... |
danielballan/bluesky | [
"868c42f6b6be33f320bb3b5100d59c5378d2b5af"
] | [
"bluesky/tests/test_zmq.py"
] | [
"from bluesky import Msg\nimport multiprocessing\nimport os\nimport numpy as np\nimport pytest\nimport signal\nimport threading\nimport time\nfrom bluesky.callbacks.zmq import Proxy, Publisher, RemoteDispatcher\nfrom bluesky.plans import count\n\n\ndef test_zmq(RE, hw):\n # COMPONENT 1\n # Run a 0MQ proxy on ... | [
[
"numpy.array",
"numpy.float64",
"numpy.ones"
]
] |
tangshixiang/grad-cl | [
"dd0a1543c0defe6f41aeca481aa9859522d00689"
] | [
"model/joint_train.py"
] | [
"# Copyright 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nfrom .common import MLP, ResNet18, ResNet18_TinyImagenet\n\n\nclass Net(torch.nn.Module):\n def __init__(... | [
[
"torch.stack",
"torch.nn.CrossEntropyLoss"
]
] |
cmu-catalyst/collage | [
"fd2c7987359e2e4523d1de81bbb21f64bb3c8f75"
] | [
"tvm/sandbox/testing/baselines/taso-tvm/run_baselines.py"
] | [
"import argparse\nimport onnx\nimport onnxruntime\nimport tvm.relay.op\nfrom tqdm import tqdm \nfrom tvm import relay\nimport tvm\nfrom tvm import te\nimport numpy as np\nimport tvm.contrib.graph_executor as runtime\nfrom tvm.relay import testing\n\nmodels = [('bert', [64,1024], np.random.random_sample((64,1024))),... | [
[
"numpy.mean",
"numpy.random.random_sample"
]
] |
pacosalces/physunits | [
"0c24350569b94cf1aa00adfa668028dbe85e75ee"
] | [
"physunits/mass.py"
] | [
"import numpy as np\n\n# Note the SI convention for base unit, kg = 1.0\nng, ug, mg, g, kg, = np.logspace(-12, 0, 5)\n\n# Freedom units\nlb = 0.45359237 * kg\noz = lb / 16\n"
] | [
[
"numpy.logspace"
]
] |
XiangTodayEatsWhat/detr3d | [
"34a47673011fe13593a3e594a376668acca8bddb"
] | [
"projects/mmdet3d_plugin/models/utils/detr.py"
] | [
"import torch\nfrom mmcv.cnn.bricks.registry import TRANSFORMER_LAYER_SEQUENCE\nfrom mmcv.cnn.bricks.transformer import TransformerLayerSequence\n\n\ndef inverse_sigmoid(x, eps=1e-5):\n \"\"\"Inverse function of sigmoid.\n Args:\n x (Tensor): The tensor to do the\n inverse.\n eps (flo... | [
[
"torch.stack",
"torch.log",
"torch.cat"
]
] |
wenjuno/riptable | [
"7d519f6838b061dc66e38a7c2a54a1af9bbe4bb7"
] | [
"riptable/tests/test_saveload.py"
] | [
"import os\r\nimport pathlib\r\nimport shutil\r\nimport sys\r\nfrom typing import Optional\r\n\r\nfrom numpy.random import default_rng\r\nimport riptable as rt\r\nfrom riptable import *\r\nfrom riptable.rt_enum import CategoryMode, SDSFlag\r\nfrom riptable.rt_sds import SDSMakeDirsOn\r\nfrom riptable.Utils.rt_metad... | [
[
"numpy.random.default_rng"
]
] |
AK391/UniFormer | [
"e8024703bffb89cb7c7d09e0d774a0d2a9f96c25",
"22c6b3b98b68236dda6a8fa7152a32af1af62a20",
"22c6b3b98b68236dda6a8fa7152a32af1af62a20"
] | [
"pose_estimation/mmpose/models/backbones/helpers.py",
"image_classification/token_labeling/tlt/models/uniformer.py",
"video_classification/slowfast/models/uniformer.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport math\nimport logging\nimport warnings\nimport errno\nimport os\nimport sys\nimport re\nimport zipfile\nimport pdb\nfrom urllib.parse import urlparse # noqa: F401\n\nHASH_REGEX = re.compile(r'-([a-f0-9]*)\\.')\n_logger = logging.getLogger(__name__)\n\n\ndef loa... | [
[
"torch.cat",
"torch.load",
"torch.hub.get_dir",
"torch.hub.download_url_to_file",
"torch.nn.functional.interpolate"
],
[
"torch.nn.Dropout",
"torch.nn.GELU",
"numpy.random.beta",
"numpy.sqrt",
"torch.ones",
"numpy.clip",
"torch.nn.init.constant_",
"torch.nn.... |
fullerene12/VOTA | [
"3a5cfc1e210ac7ea274537a8d189b54660416599"
] | [
"VOTA_Control/VOTAScopeHW/daq_ai/daq_ai_dev.py"
] | [
"from numpy import zeros,reshape\nfrom PyDAQmx import *\nfrom queue import Queue\nimport time\n\n\"\"\"This example is a PyDAQmx version of the ContAcq_IntClk.c example\nIt illustrates the use of callback functions\n\nThis example demonstrates how to acquire a continuous amount of\ndata using the DAQ device's inter... | [
[
"numpy.reshape",
"numpy.zeros"
]
] |
shrinidhin/recommender-system | [
"a7f91cdedbc325fae57a2e6785ec60f9a2516fe5"
] | [
"rec-system/app.py"
] | [
"from logging import PlaceHolder\r\nfrom h2o_wave import Q,main,app,site,ui\r\nfrom h2o_wave.core import Page, data\r\nimport pickle\r\nimport numpy as np\r\nfrom scipy import sparse\r\nfrom numpy.core.fromnumeric import size\r\nimport pandas as pd\r\nfrom fetch import fetch_data,get_product_data,get_model,get_reco... | [
[
"numpy.round",
"numpy.where",
"pandas.DataFrame"
]
] |
Sg4Dylan/FLAD | [
"03e6e44deeebc8400f469a3b4f98fc2c7ee65d55"
] | [
"export.py"
] | [
"import os\r\nimport torch\r\nfrom efficientnet_pytorch import EfficientNet\r\n\r\ndef export(model_path, export_path):\r\n model = EfficientNet.from_name('efficientnet-b0', num_classes=4)\r\n model.set_swish(memory_efficient=False)\r\n try:\r\n model.load_state_dict(torch.load(model_path, map_locat... | [
[
"torch.device",
"torch.randn",
"torch.onnx.export",
"torch.load"
]
] |
victorcesarsouza/Power_Line_Navigation | [
"a5ce8ba8df1f07b5a1452f6dcf87f4e1544e4cc3"
] | [
"scripts/hough_image_nav_compressed.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import print_function\n## Author: Alan Tavares\n## Date: August, 12, 2019\n# Purpose: Ros node to detect objects using tensorflow\nimport os\nimport sys, time, math\nimport cv2\nimport numpy as np\nimport rospy\nimport roslib\nroslib.load_manifest('line_nav')\n\nfrom sensor_m... | [
[
"numpy.sin",
"numpy.fromstring",
"numpy.cos",
"numpy.ones"
]
] |
lzh233/CeleScope-1 | [
"d83a09742f134ce1f0f6e448c1fd85c7ae3104ce",
"d83a09742f134ce1f0f6e448c1fd85c7ae3104ce",
"d83a09742f134ce1f0f6e448c1fd85c7ae3104ce"
] | [
"celescope/tag/split_tag.py",
"celescope/tools/report.py",
"celescope/rna_virus/count_virus.py"
] | [
"\"\"\"\nsplit scRNA-Seq fastq file(01.barcode/{sample}_2.fq)\n\"\"\"\nimport glob\nimport os\nfrom collections import defaultdict\n\nimport pysam\nimport pandas as pd\n\nimport celescope.tools.utils as utils\nfrom celescope.tools.step import Step, s_common\nfrom celescope.__init__ import HELP_DICT\nfrom celescope.... | [
[
"pandas.read_csv"
],
[
"pandas.read_table",
"pandas.read_csv"
],
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
ivanprado/eli5 | [
"22264c06402aed74131789c128d598b92d8ff750"
] | [
"eli5/lime/samplers.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nimport abc\nfrom functools import partial\nfrom typing import List, Tuple, Any, Union, Dict, Optional\nimport six\n\nimport numpy as np # type: ignore\nfrom scipy.stats import itemfreq # type: ignore\nfrom sklearn.base import BaseEstimator, clone ... | [
[
"numpy.hstack",
"sklearn.model_selection.GridSearchCV",
"sklearn.metrics.pairwise_distances",
"scipy.stats.itemfreq",
"numpy.logspace",
"numpy.asarray",
"sklearn.model_selection.KFold",
"sklearn.base.clone",
"sklearn.neighbors.KernelDensity",
"numpy.array",
"sklearn.uti... |
mjirik/lisa | [
"06c5cb8f375f51302341e768512f02236774c8a3",
"06c5cb8f375f51302341e768512f02236774c8a3"
] | [
"lisa/body_navigation.py",
"lisa/show_segmentation.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\n\n\n# import funkcí z jiného adresáře\nimport argparse\nimport os.path\n\npath_to_script = os.path.dirname(os.path.abspath(__file__))\n# sys.path.append(os.path.join(path_to_script, \"../extern/pyseg_base/src\"))\n# sys.path.append(os.path.join(path_to_script, \"../ex... | [
[
"numpy.radians",
"numpy.asarray",
"numpy.max",
"numpy.argmin",
"scipy.ndimage.filters.gaussian_filter",
"numpy.negative",
"scipy.ndimage.morphology.binary_fill_holes",
"numpy.pad",
"numpy.zeros",
"numpy.nonzero",
"numpy.isnan",
"numpy.median",
"scipy.ndimage.mea... |
wangzelong0663/PARL | [
"9954a18827fd720585b346ec83cdaf9683feb52c"
] | [
"benchmark/torch/ES/mujoco_agent.py"
] | [
"# Copyright (c) 2018 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 ... | [
[
"numpy.expand_dims",
"torch.from_numpy",
"numpy.prod"
]
] |
dodoproptit99/Multilingual_Text_to_Speech | [
"8c5f2c8f3bffe7aca68c576168a12ab3451d09ec"
] | [
"modules/tacotron2.py"
] | [
"import math\nimport torch\nfrom torch.nn import functional as F\nfrom torch.nn import Sequential, ModuleList, Linear, ReLU, Dropout, LSTM, Embedding\n\nimport utils\nfrom modules.layers import ZoneoutLSTMCell, DropoutLSTMCell, ConvBlock\nfrom modules.attention import LocationSensitiveAttention, ForwardAttention, F... | [
[
"torch.sigmoid",
"torch.nn.functional.dropout",
"torch.cat",
"torch.zeros",
"torch.nn.ModuleList",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.zeros_like",
"torch.sum",
"torch.nn.Embedding",
"torch.tensor",
"torch.arange",
"torch.nn.Linear",
"... |
lastIndexOf/ImageProcessing100Wen | [
"1e4eba4bc4c52cbf86e7cfe7e15f215323f5b069"
] | [
"Question_31_40/custom_py/34.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport cv2\n\nfrom os import path\nfrom math import cos, sin, pi, floor, ceil, sqrt\nimport os\n\ncwd = os.getcwd()\ndirname = path.join(cwd, path.dirname(__file__))\n\n\nclass DIP:\n def hpf(self, img):\n r = img[:, :, 2]\n g = img[:, :, 1]\n ... | [
[
"numpy.fft.fft2",
"numpy.fft.ifft2",
"numpy.sqrt",
"numpy.arange",
"numpy.fft.fftshift",
"numpy.fft.ifftshift",
"numpy.zeros_like"
]
] |
Lornatang/TensorFlow2-tutorials | [
"df5bc050e9941f5be23ff9ff826744b18664bb8b",
"df5bc050e9941f5be23ff9ff826744b18664bb8b"
] | [
"Primary_tutorial/Quickstart/mnist-advanced.py",
"Experts_tutorial/distribute/training_loops.py"
] | [
"# Copyright 2019 ChangyuLiu Authors. All Rights Reserved.\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 r... | [
[
"tensorflow.python.keras.layers.Flatten",
"tensorflow.python.keras.layers.Dense",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.optimizers.Adam",
"tensorflow.python.keras.layers.Conv2D",
"tensorflow.keras.metric... |
amilearning/IOT_insuit | [
"4e4c1e81ffe6af40d2e68a94051f4c0142448e93"
] | [
"c_feats.py"
] | [
"#### Author: Edy + HOJIN ########V2\nimport numpy as np\n# import math\nfrom numpy import sqrt\n# import scipy.stats as st\nimport sys\n\n# \"accel_x\":[0.763824897154395,0.5866469526798834,0.8286135232151721],\n# \"accel_y\":[0.615104364012065,0.284677924127019,0.631172176317478],\n# \"accel_z\":[0.28731752062261... | [
[
"numpy.array",
"numpy.random.random",
"numpy.sqrt",
"numpy.fromstring"
]
] |
ZeinabTaghavi/opencv-python | [
"c0082b0b8033f120d11a1fd58b493f6e06b126e4"
] | [
"text_find_unrotated_lines/text_find_unrotated_lines.py"
] | [
"# avg of time = 2.7401173988\n\nfrom lxml import etree\nimport cv2\nfrom scipy import ndimage\nimport pytesseract\nimport numpy as np\nfrom PIL import Image\n\n\ndef making_data_ready(n):\n\n img1 = cv2.imread(n+'.jpg')\n\n img2 = 255 - img1[650:650+200,750:750+1800]\n rotated = ndimage.rotate(img2, 90)\... | [
[
"numpy.arctan",
"numpy.mean",
"scipy.ndimage.rotate",
"numpy.ones"
]
] |
arpit1997/distributed | [
"71c7e4a6305942ae038db05cd55a29e184f998ce"
] | [
"distributed/tests/test_utils.py"
] | [
"import array\nimport datetime\nfrom functools import partial\nimport io\nimport os\nimport queue\nimport socket\nimport sys\nfrom time import sleep\nimport traceback\n\nimport numpy as np\nimport pytest\nfrom tornado import gen\nfrom tornado.ioloop import IOLoop\n\nimport dask\nfrom distributed.metrics import time... | [
[
"numpy.arange",
"numpy.array",
"numpy.ones"
]
] |
yiwuyao3863/nni | [
"c36570a5f6e6d2ff99f3a59d7060e8dbf68b766d"
] | [
"examples/model_compress/pruning/basic_pruners_torch.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\n'''\nNNI example for supported basic pruning algorithms.\nIn this example, we show the end-to-end pruning process: pre-training -> pruning -> fine-tuning.\nNote that pruners use masks to simulate the real pruning. In order to obtain a rea... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.NLLLoss",
"torch.load",
"torch.sign",
"torch.cuda.device_count",
"torch.randn",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.optim.lr_scheduler.StepLR"
]
] |
mac15max15/qstrader_modified | [
"b0f24f5f37e7094dd878664ee5097b957cc685e8"
] | [
"qst/statistics/tearsheet.py"
] | [
"from .base import AbstractStatistics\nfrom ..price_parser import PriceParser\n\nfrom matplotlib.ticker import FuncFormatter\nfrom matplotlib import cm\nfrom datetime import datetime\n\nimport qst.statistics.performance as perf\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matp... | [
[
"matplotlib.pyplot.gca",
"matplotlib.dates.DateFormatter",
"numpy.log",
"numpy.sqrt",
"pandas.Series",
"numpy.min",
"pandas.DataFrame",
"numpy.round",
"numpy.max",
"matplotlib.pyplot.subplot",
"numpy.mean",
"matplotlib.gridspec.GridSpec",
"matplotlib.dates.YearL... |
JiahuiLei/Pix2Surf | [
"ac56ce5a20adab8cb563d96c915e1cc253631bf8"
] | [
"core/models/pix2surf_sv_render.py"
] | [
"\"\"\"\nPix2Surf Single-View Version Post-processing (generate geometry image and texture map)\n\"\"\"\n\nfrom .modelbase_v2 import ModelBase\nfrom .pix2surf_sv import Network as SV_Net\nfrom core.models.utils import *\n\nimport os\nimport torch\n\n\nclass Model(ModelBase):\n def __init__(self, cfg):\n s... | [
[
"torch.ones",
"torch.max",
"torch.cat",
"torch.zeros",
"torch.from_numpy",
"torch.no_grad",
"torch.ones_like",
"torch.argmax"
]
] |
pwasiewi/OpenCLGA | [
"8590fa46b1cdaefe03769e4a62a126d464e288dd"
] | [
"OpenCLGA/simple_chromosome.py"
] | [
"#!/usr/bin/python3\nimport numpy\nimport pyopencl as cl\nfrom .simple_gene import SimpleGene\n\nclass SimpleChromosome:\n # SimpleChromosome - a chromosome contains a list of Genes.\n # __genes - a list of Genes\n # __name - name of the chromosome\n # __improving_func - a function name in kernel to gur... | [
[
"numpy.int32",
"numpy.zeros",
"numpy.float32"
]
] |
Galaxies99/HDR-synthesis | [
"35648a9e993eb89c89db4bc7d0b08e2bf22e3c38"
] | [
"DeepLearningFramework/train.py"
] | [
"import os\nimport torch\n\nfrom torch import optim\nfrom torch.utils.data import DataLoader\nfrom utils.solvers import PolyLR\nfrom utils.loss import HDRLoss\nfrom utils.HDRutils import tonemap\nfrom utils.dataprocessor import dump_sample\nfrom dataset.HDR import KalantariDataset, KalantariTestDataset\nfrom utils.... | [
[
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.manual_seed_all",
"torch.cuda.is_available",
"torch.device",
"torch.nn.DataParallel"
]
] |
richford/SparseGroupLasso | [
"a5024f36d49b34f55828642dbacacd2e5e2203c6"
] | [
"SparseGroupLasso/subgradients_semisparse.py"
] | [
"import numpy\nfrom SparseGroupLasso.utils import S, norm_non0, discard_group\n\nclass SSGL_subgrad:\n def __init__(self, groups, alpha, lambda_, ind_sparse, max_iter=10000,\n rtol=1e-6):\n self.ind_sparse = numpy.array(ind_sparse)\n self.groups = numpy.array(groups)\n self.a... | [
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.max",
"numpy.random.randn",
"numpy.array",
"numpy.sum"
]
] |
wwwidonja/changed_plotly | [
"1bda35a438539a97c84a3ab3952e95e8848467bd",
"1bda35a438539a97c84a3ab3952e95e8848467bd"
] | [
"test_init/test_dependencies_not_imported.py",
"tests/test_optional/test_matplotlylib/test_date_times.py"
] | [
"import sys\nfrom . import version_skip\n\n\n@version_skip\ndef test_dependencies_not_imported():\n\n # Check that creating a figure without using numpy and pandas does not result in\n # the import of numpy and pandas, even if they are installed.\n assert \"new_plotly\" not in sys.modules\n assert \"num... | [
[
"numpy.array",
"pandas.Series"
],
[
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.gcf",
"matplotlib.dates.date2num",
"pandas.date_range"
]
] |
xubo245/AILearning | [
"0ac0c546b5ea832513bf1f99e3c72c414ecb6df4"
] | [
"TensorFlowLearning/src/tensorflowHelloWorld.py"
] | [
"import tensorflow as tf\n\ntf.enable_eager_execution()\nprint(tf.add(1, 2))\nprint(tf.add(12, 23))\nhello = tf.constant('Hello, TensorFlow!')\nprint(hello.numpy())\n\n\n"
] | [
[
"tensorflow.add",
"tensorflow.enable_eager_execution",
"tensorflow.constant"
]
] |
MobtgZhang/2021HuaShuCupMathModeling | [
"bdd14a975fbee9c2db919ae8a66fcf68b8004669"
] | [
"src/model/data.py"
] | [
"import numpy as np\nimport torch.utils.data as data\nclass StatisticsDataset(data.Dataset):\n def __init__(self,dataset):\n '''\n :param dataset: 数据集\n '''\n # train_data = {\"X\":[train_a_data,train_b_c_data,train_b_d_data],\n # \"Y\":train_pred_data,\n ... | [
[
"numpy.vstack"
]
] |
Yuran-Zhao/Inst2Vec | [
"51a232453a75ad47bd995b328017bfe77400a22a"
] | [
"data_collator_for_language_model.py"
] | [
"from dataclasses import dataclass\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Dict,\n List,\n NamedTuple,\n Optional,\n Sequence,\n Tuple,\n Union,\n)\n\nimport numpy as np\nimport tokenizers\nimport torch\nfrom transformers import BatchEncoding\n\nEncodedInput = List[int]\n\n\n@data... | [
[
"torch.stack",
"torch.bernoulli",
"torch.full",
"torch.tensor"
]
] |
wassname/diy-gym | [
"83232ae6971341a86683d316feecf4d34d3caf47"
] | [
"diy_gym/addons/controllers/joint_gain_controller.py"
] | [
"import pybullet as p\n\nfrom gym import spaces\nimport pybullet_planning as pbp\nimport numpy as np\nfrom diy_gym.addons.addon import Addon\n\n\nclass JointGainController(Addon):\n \"\"\"\n JointController with Gain\n\n if gain <0, it's automatic (scaled based on distance to target)\n if gain >0 it's c... | [
[
"numpy.array",
"numpy.abs"
]
] |
peterespinosa/yellowbrick | [
"235e2e71a8430fa88a0e76d0514d29a4a774c213",
"235e2e71a8430fa88a0e76d0514d29a4a774c213"
] | [
"docs/api/model_selection/cv.py",
"tests/test_text/test_tsne.py"
] | [
"#!/usr/bin/env python3\r\n# cv.py\r\n\r\n\"\"\"\r\nGenerates a CVScores image\r\n\"\"\"\r\n\r\n##########################################################################\r\n## Imports\r\n##########################################################################\r\n\r\nimport pandas as pd\r\nimport matplotlib.pyplo... | [
[
"pandas.read_csv",
"sklearn.naive_bayes.MultinomialNB",
"matplotlib.pyplot.subplots",
"sklearn.model_selection.StratifiedKFold",
"sklearn.model_selection.KFold",
"sklearn.linear_model.Ridge"
],
[
"sklearn.datasets.make_classification",
"pandas.Series",
"pandas.DataFrame",
... |
Wanwannodao/DeepLearning | [
"64c1dbc7da96a57eb2c9e3c8be221eded91d1ed7",
"64c1dbc7da96a57eb2c9e3c8be221eded91d1ed7"
] | [
"RL/DQN/dqn.py",
"seq2seq/tf_tutorial/seq2seq_model.py"
] | [
"import tensorflow as tf\nfrom model import QFunction\n\nimport numpy as np\nimport random\n\ndef copy_params(src, dst):\n src_params = [v for v in tf.trainable_variables() if v.name.startswith(src.scope)]\n dst_params = [v for v in tf.trainable_variables() if v.name.startswith(dst.scope)]\n\n op = [d.assi... | [
[
"tensorflow.concat",
"tensorflow.gather_nd",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.less",
"numpy.asarray",
"tensorflow.range",
"tensorflow.placeholder",
"numpy.argmax",
"tensorflow.square",
"tensorflow.trainable_variables",
"tensorflow.abs"
],
[
"tens... |
keisuke-umezawa/cupy | [
"d4070ad0f5bd830638419e70e3f931e7b7d718f7",
"d4070ad0f5bd830638419e70e3f931e7b7d718f7"
] | [
"tests/cupy_tests/linalg_tests/test_eigenvalue.py",
"cupy/creation/matrix.py"
] | [
"import unittest\n\nimport numpy\n\nimport cupy\nfrom cupy import cuda\nfrom cupy import testing\n\n\n@testing.parameterize(*testing.product({\n 'UPLO': ['U', 'L'],\n}))\n@unittest.skipUnless(\n cuda.cusolver_enabled, 'Only cusolver in CUDA 8.0 is supported')\n@testing.gpu\nclass TestEigenvalue(unittest.TestC... | [
[
"numpy.argsort",
"numpy.linalg.eigh",
"numpy.array"
],
[
"numpy.diag",
"numpy.isscalar",
"numpy.diagflat"
]
] |
shukali/SimpleNeuralNet | [
"86cbf6c7b7b52a56c9e8fda3f7432ff00965b028"
] | [
"NeuralNet.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n'''\nExpects data in the form: (see also data_moon.txt)\n\n... ... \n1.000e+00 1.293e+00 -1.138e+00 -1.000e+00\n1.000e+00 -1.504e+00 1.451e+00 1.000e+00\n... ... \n\nwhere the last column con... | [
[
"numpy.dot",
"numpy.amax",
"matplotlib.pyplot.scatter",
"numpy.power",
"numpy.amin",
"numpy.multiply",
"numpy.subtract",
"matplotlib.pyplot.get_cmap",
"numpy.random.shuffle",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.random.rand",
"numpy.add... |
jmeyers314/batoid | [
"85cbd13a9573ddca158c9c21ced2ef0c5ad5cd25"
] | [
"tests/test_zemax.py"
] | [
"# Compare ray by ray tracing to Zemax\nimport os\n\nimport pytest\nimport galsim\nimport numpy as np\nfrom scipy.optimize import least_squares\n\nimport batoid\nfrom test_helpers import timer, init_gpu\n\ndirectory = os.path.dirname(__file__)\n\n\n@timer\ndef test_HSC_trace():\n telescope = batoid.Optic.fromYam... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.abs",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.genfromtxt",
"numpy.linalg.norm",
"numpy.max",
"numpy.deg2rad",
"numpy.linalg.lstsq",
"matplotlib.pyplot.colorbar",
"numpy.testing.assert_... |
yangjy10/lecture | [
"5ceddfb45bcd9b835567bc013f7a829eae9745c7"
] | [
"study1/3_machine_learning/3_3_linear_matrix.py"
] | [
"'''\nCreated on 2018. 6. 15.\n\n@author: eric.hong@aidentify.io\n'''\n\nimport numpy as np\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\n\n# 학습 데이터(배열의 형태로 파일에서 가져올 수 있음)\n#train_X = np.loadtxt('./datas/3_3_linear_matrix.csv', unpack=True, dtype='float')\ntrain_X = [\n [3.3, 4.4, 5.5, 6.71, 6.9... | [
[
"tensorflow.matmul",
"tensorflow.zeros",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.Session",
"tensorflow.square"
]
] |
dpsanders/dymos | [
"ccd0c010537a621def7f46cb7f0dc5a2fd79e372"
] | [
"dymos/examples/brachistochrone/test/test_brachistochrone_integrated_control.py"
] | [
"import os\nimport unittest\n\nimport numpy as np\nfrom scipy.interpolate import interp1d\n\nimport openmdao.api as om\nfrom openmdao.utils.testing_utils import use_tempdirs\n\nimport dymos as dm\n\n\nclass BrachistochroneODE(om.ExplicitComponent):\n\n def initialize(self):\n self.options.declare('num_nod... | [
[
"numpy.arange",
"numpy.cos",
"numpy.sin",
"numpy.ones",
"scipy.interpolate.interp1d",
"numpy.zeros"
]
] |
jinzishuai/BackgroundMattingV2 | [
"29bcd887a542bc829b8d1e137d37a96c2c4df3bc"
] | [
"inference_images.py"
] | [
"\"\"\"\nInference images: Extract matting on images.\n\nExample:\n\n python inference_images.py \\\n --model-type mattingrefine \\\n --model-backbone resnet50 \\\n --model-backbone-scale 0.25 \\\n --model-refine-mode sampling \\\n --model-refine-sample-pixels 80000 \\\n ... | [
[
"torch.load",
"torch.utils.data.DataLoader",
"torch.nn.Identity",
"torch.no_grad",
"torch.nn.functional.interpolate",
"torch.device"
]
] |
TheLampshady/cnn_text | [
"009fce83335550255e63baf9b579a42cce3f5eb6"
] | [
"learning_tensorflow/skip_grams.py"
] | [
"#!/usr/bin/env python3\nimport os, math\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.contrib.tensorboard.plugins import projector\n\nbatch_size = 64\nembedding_demensions = 5\nnegative_samples = 8\nLOG_DIR = \"logs/word2vec_intro\"\n\ndigit_to_word_map = {\n 1: \"One\", 2: \"Two\", 3: \"Three\"... | [
[
"tensorflow.get_default_graph",
"tensorflow.nn.nce_loss",
"tensorflow.summary.scalar",
"tensorflow.Variable",
"tensorflow.random_uniform_initializer",
"tensorflow.truncated_normal_initializer",
"tensorflow.train.exponential_decay",
"tensorflow.name_scope",
"tensorflow.Session",... |
frgfm/deep-reinforcement-learning | [
"4e884dc8070934b5e7096ecc83fb3a3fa7c27907"
] | [
"dqn/exercise/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass QNetwork(nn.Module):\n \"\"\"Actor (Policy) Model.\"\"\"\n\n def __init__(self, state_size, action_size, seed):\n \"\"\"Initialize parameters and build model.\n Params\n ======\n state_size (int): Di... | [
[
"torch.nn.Linear",
"torch.manual_seed",
"torch.nn.ReLU"
]
] |
StaminaTang/mopo | [
"d95d2b860aea8bedc3a94a662eecf0bbea84903d"
] | [
"mopo/off_policy/loader.py"
] | [
"import os\nimport glob\nimport pickle\nimport gzip\nimport pdb\nimport numpy as np\n\n#恢复原状,恢复缓冲区,replay\ndef restore_pool(replay_pool, experiment_root, max_size, save_path=None):\n if 'd4rl' in experiment_root:\n restore_pool_d4rl(replay_pool, experiment_root[5:])\n else:\n assert os.path.exis... | [
[
"numpy.load",
"numpy.split",
"numpy.expand_dims"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.