repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
bcaitech1/p4-mod-model_diet
[ "36d8a747e12c375b07d132ed4d08f9fc77126a8b" ]
[ "src/modules/invertedresidual.py" ]
[ "\"\"\"Inverted Residual v3 block.\n\nReference:\n https://github.com/d-li14/mobilenetv3.pytorch/blob/master/mobilenetv3.py\n- Author: Junghoon Kim\n- Contact: placidus36@gmail.com\n\"\"\"\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\n\nfrom src.modules.activations import HardSigmoi...
[ [ "torch.nn.Sequential", "torch.transpose", "torch.nn.Conv2d", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
harviu/pointnet_vae
[ "fad09f888212fc9c571584e27cd68bdcd589ae38" ]
[ "h_search.py" ]
[ "from utils.process_data import all_file_loader, PointData, collate_ball, collect_file\nfrom torch.utils.data import DataLoader\nimport torch\nimport os, math, time\n\ntry:\n data_path = os.environ['data']\nexcept KeyError:\n data_path = './data/'\n\n\n\ndef get_error (r,data):\n eps = 1e-15\n sample_si...
[ [ "torch.sum", "torch.utils.data.DataLoader", "torch.logical_not" ] ]
zjucx/GAN
[ "641a92aff6695a1046a340038d8b013b2cc2f5bd" ]
[ "cyclegan.py" ]
[ "import tensorflow as tf\nfrom generator import *\nfrom discriminator import *\n\nimg_height = 256\nimg_width = 256\nimg_layer = 3\nbatch_size = 1\nimg_size = img_height * img_width\n\nclass CycleGAN():\n\n def init_model(self):\n self.input_A = tf.placeholder(tf.float32, [batch_size, img_width, img_heigh...
[ [ "tensorflow.control_dependencies", "tensorflow.placeholder", "tensorflow.variable_scope", "tensorflow.no_op", "tensorflow.train.AdamOptimizer", "tensorflow.image.convert_image_dtype", "tensorflow.trainable_variables", "tensorflow.squared_difference", "tensorflow.square", "t...
matejgrcic/Confident_classifier
[ "99ea815c53dde5d45ef958387ab49c6fe834d5b0" ]
[ "src/data_loader.py" ]
[ "# original code is from https://github.com/aaron-xichen/pytorch-playground\n# modified by Kimin Lee\nimport torch\nfrom torchvision import datasets, transforms\nfrom torch.utils.data import DataLoader\nimport os\nimport numpy.random as nr\nimport numpy as np\nfrom torch.utils.data.sampler import SubsetRandomSample...
[ [ "torch.utils.data.DataLoader" ] ]
leontl/hyperframe
[ "ba6f5faa0759d3cfb498e9cc5946b77cb73ed7af" ]
[ "hyperframe.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom collections import OrderedDict\nimport os\nimport json\nimport shutil\nimport warnings\nimport subprocess\n\n\ndef nest(l, depth=1, reps=1):\n \"\"\"create a nested list of depth 'depth' and with 'reps' repititions\"\"\"\n if depth == 0:\n return(None)\n ...
[ [ "numpy.ix_", "numpy.expand_dims", "pandas.Series", "pandas.DataFrame", "numpy.all", "numpy.random.uniform", "numpy.array" ] ]
ToshuuMilia/scikit-mine
[ "dcfa1e65dcf835f908c71f6dc3045d3251e855dd" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nfrom setuptools import find_packages, setup\nimport numpy\nimport codecs\n\nimport skmine\n\nDISTNAME = 'scikit-mine-alt'\nDESCRIPTION = 'Pattern mining in Python'\nMAINTAINER = 'N/A'\nMAINTAINER_EMAIL = 'N/A'\nURL = 'https://github.com/ToshuuMilia/scikit-mine'\n...
[ [ "numpy.get_include" ] ]
kingaza/DLCA
[ "2b29d5cce3e4fee13ab4e45270e6b37c4e22b734" ]
[ "utils/preprocess_adam2020.py" ]
[ "\nimport os \nimport argparse\nimport zipfile as zf\n\nimport numpy as np \nfrom scipy.ndimage.measurements import center_of_mass, label, find_objects\nfrom scipy.ndimage import rotate, zoom, grey_closing\nfrom skimage import io, measure\n\nimport SimpleITK as sitk\nimport nibabel as nib\n\n\n# x y z -> z, y, z\nd...
[ [ "numpy.clip", "scipy.ndimage.grey_closing", "numpy.asarray", "scipy.ndimage.zoom", "numpy.set_printoptions", "scipy.ndimage.rotate", "numpy.ones", "scipy.ndimage.measurements.center_of_mass", "scipy.ndimage.measurements.find_objects", "numpy.repeat", "numpy.array", ...
cburik/machine-learning-engineering-for-production-public
[ "119e093cd52481ebeab0f26b993357812bf0c1b8" ]
[ "course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py" ]
[ "import pickle\nimport numpy as np\nfrom typing import List\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel, conlist\n\n\n\napp = FastAPI(title=\"Predicting Wine Class with batching\")\n\n# Open classifier in global scope\nwith open(\"models/wine-95-fixed.pkl\", \"rb\") as file:\n clf = pickle.load(...
[ [ "numpy.array" ] ]
StoneYeY/Beat-Detection
[ "969619fe04b3e96428e560d604406a3d0cdfcc74" ]
[ "src/dataprocess.py" ]
[ "import os\r\n\r\nimport librosa\r\nimport numpy as np\r\nimport yaml\r\nfrom tqdm import tqdm\r\n\r\ndef create_spectrogram(\r\n file_path,\r\n n_fft,\r\n hop_length,\r\n n_mels):\r\n x, sr = librosa.load(file_path)\r\n hop_length_in_samples = int(np.floor(hop_length * sr))\r\n ...
[ [ "numpy.zeros", "numpy.abs", "numpy.floor" ] ]
starsky2021/Watermark-Removal
[ "7d9747dea3cea4a563b574cdca91169ea7cae77f" ]
[ "src/networks/segmentation.py" ]
[ "import torch\nimport torchvision\n\nfrom torch.nn import functional as F\n\nfrom pytorch_lightning.core.lightning import LightningModule\n\n\nclass WMIDNet(LightningModule):\n\t\"\"\"\n\tWaterMark IDentification Network\n\n\tIdentifies watermarks on an input image. Returns a mask of pixels that show the location o...
[ [ "torch.stack", "torch.nn.functional.cross_entropy" ] ]
Wiggler123/Poker_probability
[ "dc4418e2d5e5308cb8437bde77a3d6e64182c4d9" ]
[ "test2.py" ]
[ "#Importera nödvändiga bibliotek \r\nimport random\r\nimport matplotlib as mpl\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt;plt.rcdefaults()\r\nfrom alive_progress import alive_bar\r\nfrom timeit import default_timer as timer\r\nimport logging\r\nimport threading\r\nimport time\r\n\r\n#Skapar klass kort...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.subplots", "matplotlib.pyplot.gcf", "matplotlib.pyplot.Circle", "matplotlib.pyplot.xticks", "matplotlib.pyplot.bar", "matplotlib.pyplot.rcdefaults", "m...
mcgillmrl/robot_learning
[ "4b9e387524cc6a6058055a7e26bc761c81eb5597" ]
[ "src/robot_learning/ros_plant.py" ]
[ "#!/usr/bin/env python\nimport gym\nimport numpy as np\nimport rospy\n\nfrom gym import spaces\nfrom collections import deque\n\nfrom std_srvs.srv import Empty as EmptySrv\nfrom robot_learning.msg import ExperienceData\nfrom robot_learning.srv import T2VInfo\n\n\nclass ROSPlant(gym.Env):\n '''\n Class for col...
[ [ "numpy.array" ] ]
vtsuperdarn/clustering_superdarn_data
[ "02bc31dd85f66319bb46b632e0e7ac51ed98c432" ]
[ "utilities/classification_utils.py" ]
[ "import numpy as np\n\ndef blanchard_gs_flg(vel, wid, type='code'):\n med_vel = np.median(np.abs(vel))\n med_wid = np.median(np.abs(wid))\n if type == 'paper':\n return med_vel < 33.1 + 0.139 * med_wid - 0.00133 * (med_wid ** 2) # Found in 2009 paper\n if type == 'code':\n return med_vel ...
[ [ "numpy.abs" ] ]
laurenmm/simmate-1
[ "c06b94c46919b01cda50f78221ad14f75c100a14" ]
[ "src/simmate/toolkit/transformations/heredity_mutation_ase.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy\n\nfrom simmate.toolkit.transformations.base import Transformation\n\n\n#!!! I need to figure out how to implement more than two structures\n\n\nclass HeredityASE(Transformation):\n\n # known as CutAndSplicePairing in ase.ga\n # https://gitlab.com/ase/ase/-/blob/master...
[ [ "numpy.lcm" ] ]
komoto48g/wxpj
[ "58152a7a26397b48cff3accedbea31f47be3d93e" ]
[ "plugins/lctf.py" ]
[ "#! python\n# -*- coding: utf-8 -*-\nimport cv2\nimport numpy as np\nfrom numpy import pi\nfrom numpy.fft import fft,ifft,fft2,ifft2,fftshift,fftfreq\nfrom scipy import signal\nfrom matplotlib import patches\nfrom mwx.controls import LParam\nfrom mwx.graphman import Layer\nfrom plugins.lcrf import Model\nfrom wxpyJ...
[ [ "scipy.signal.find_peaks", "numpy.sqrt", "numpy.linspace", "numpy.concatenate", "numpy.any", "numpy.exp", "scipy.signal.savgol_filter", "numpy.arange", "scipy.signal.windows.gaussian", "numpy.sin", "numpy.interp", "numpy.fft.fft2", "numpy.log", "scipy.signal...
sebpadilla09/computer-vision-dojo
[ "4c55081c7ec37278d45f649e1f5109031f776a04" ]
[ "python/class-challenges/scripts/working_pixels_chall_1.py" ]
[ "# Built-int imports \nimport os\nimport sys\nimport argparse\n\n# External imports\nimport cv2 as cv\nimport numpy as np\n\n# My own imports \nimport get_path_assests_folder as gpaf\n\n# Get assets folder in repo for the samples\nASSETS_FOLDER = gpaf.get_assets_folder_path()\n\n\nclass DolphinPlayingWithPixels:\n ...
[ [ "numpy.ndenumerate" ] ]
steven0129/yolact_edge
[ "748e1595a50987d85932ee4ad4fbb3fadf0d3fbb" ]
[ "data/config.py" ]
[ "from backbone import ResNetBackbone, VGGBackbone, ResNetBackboneGN, DarkNetBackbone, MobileNetV2Backbone\nfrom math import sqrt\nimport torch\n\n# for making bounding boxes pretty\nCOLORS = ((244, 67, 54),\n (233, 30, 99),\n (156, 39, 176),\n (103, 58, 183),\n ( 63, 81, 1...
[ [ "torch.nn.functional.softmax", "torch.nn.functional.relu" ] ]
damiandraxler/ghlestimator
[ "83f3929e22cba48e61ffd164c380c026ff6dddac" ]
[ "ghlestimator/ghlestimator.py" ]
[ "import numpy as np\r\nfrom scipy.optimize import minimize\r\n\r\ndef sgn(x):\r\n sig = np.sign(x)\r\n sig[sig == 0] = 1\r\n return sig\r\n\r\ndef _log(x): \r\n return sgn(x) * np.log(1 + np.abs(x))\r\n\r\ndef _loginv(x):\r\n return sgn(x) * (np.exp(np.abs(x)) - 1)\r\n\r\ndef _loginvp(x): \r\n ret...
[ [ "numpy.dot", "numpy.abs", "numpy.sign", "scipy.optimize.minimize", "numpy.zeros", "numpy.sum" ] ]
thomasgilgenast/hic3defdr
[ "7498ac468ccc21fa530d584944c1b12c73926755" ]
[ "hic3defdr/plotting/heatmap.py" ]
[ "import matplotlib.pyplot as plt\n\nfrom lib5c.util.plotting import plotter\n\n\n@plotter\ndef plot_heatmap(matrix, cmap='Reds', vmin=0, vmax=100, despine=False,\n **kwargs):\n \"\"\"\n Plots a simple heatmap of a dense matrix.\n\n Parameters\n ----------\n matrix : np.ndarray\n ...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "matplotlib.pyplot.xticks" ] ]
mGalarnyk/Blueprints
[ "02c46234cad36e159ea26d2fcb864454ca229cc2" ]
[ "Object Detection/Object Detection Retrain/val.py" ]
[ "# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\n\"\"\"\nValidate a trained YOLOv5 model accuracy on a custom dataset\n\nUsage:\n $ python path/to/val.py --weights yolov5s.pt --data coco128.yaml --img 640\n\nUsage - formats:\n $ python path/to/val.py --weights yolov5s.pt # PyTorch\n ...
[ [ "torch.linspace", "torch.Tensor", "torch.zeros", "torch.cat", "numpy.unique", "torch.stack", "pandas.DataFrame", "torch.tensor", "numpy.concatenate", "torch.no_grad", "torch.where", "torch.device", "numpy.zeros", "numpy.savetxt" ] ]
BreakingBytes/simkit
[ "c247b6ecf46d727703c03cb0d987e35fd054eaa6" ]
[ "examples/PVPower/pvpower/formulas/irradiance.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\nThis module contains formulas for calculating PV power.\n\"\"\"\n\nimport pvlib\nimport pandas as pd\n\n\ndef f_linketurbidity(times, latitude, longitude):\n times = pd.DatetimeIndex(times)\n # latitude and longitude must be scalar or else linke turbidity lookup fails\n ...
[ [ "pandas.DatetimeIndex", "pandas.DataFrame" ] ]
stefantaubert/textgrid-ipa
[ "7227e3afa7d711a64f0d911e33b7ce822087f23f" ]
[ "src/textgrid_tools/app/main.py" ]
[ "import re\nfrom logging import getLogger\nfrom pathlib import Path\nfrom shutil import copy, rmtree\nfrom typing import Optional\n\nfrom scipy.io.wavfile import read, write\nfrom text_utils.language import Language\nfrom text_utils.pronunciation.main import EngToIPAMode\nfrom textgrid.textgrid import TextGrid\nfro...
[ [ "scipy.io.wavfile.write", "scipy.io.wavfile.read" ] ]
doinalangille/DS-Unit-3-Sprint-2-SQL-and-Databases
[ "393f3e0f7e20893b66d0a825a0f2b856b77b6d3e" ]
[ "module1-introduction-to-sql/buddymove_holidayiq.py" ]
[ "import pandas as pd\nimport sqlite3\n\n# Load the data\ndf = pd.read_csv('buddymove_holidayiq.csv')\n\n# Open a connection to a new (blank) database file\nconnection = sqlite3.connect('buddymove_holidayiq.sqlite3')\n\n# Insert the data into a new table review in the SQLite3 database\ndf.to_sql('review', con=connec...
[ [ "pandas.read_csv" ] ]
mahgadalla/pysph-1
[ "5b504ebc364d58d2fa877b778e198674139461da" ]
[ "pysph/sph/tests/test_acceleration_eval.py" ]
[ "# Standard library imports.\ntry:\n # This is for Python-2.6.x\n import unittest2 as unittest\nexcept ImportError:\n import unittest\n\n# Library imports.\nimport pytest\nimport numpy as np\n\n# Local imports.\nfrom pysph.base.config import get_config\nfrom pysph.base.utils import get_particle_array\nfrom...
[ [ "numpy.ones_like", "numpy.allclose", "numpy.linspace", "numpy.asarray", "numpy.ones", "numpy.sum" ] ]
AndrewBeers/dreamin
[ "d51a41fe5b85f1af1a13a0eb2ab2aa5466014d01" ]
[ "lucid_experiment.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport keras\nimport os\n\nimport lucid.modelzoo.vision_models as models\nimport lucid.modelzoo.vision_base as vision_base\nfrom lucid.misc.io import show\nimport lucid.optvis.objectives as objectives\nimport lucid.optvis.param as param\nimport lucid.optvis.render as re...
[ [ "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.InteractiveSession", "tensorflow.placeholder", "tensorflow.expand_dims", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.get_default_graph", "tensorflow.saved_model.loader.load" ] ...
Arihant25/beginner-python-projects
[ "43c6489b6973522246073f2187a682487f1684c1" ]
[ "birthday_wisher/main.py" ]
[ "import pandas\nimport smtplib\nimport datetime as dt\nimport random\n\n# Enter the number of letter templates in the folder\nLETTER_TEMPLATES = 3\n\n# Enter your email, password and SMTP Server\nEMAIL = \"example@outlook.com\"\nPASSWORD = \"password0\"\nSMTP_SERVER = \"smtp.office365.com\"\n\nnow = dt.datetime.now...
[ [ "pandas.read_csv" ] ]
mnschmit/conan
[ "31df764de3af462e9cbe8c8bfe981c49334e37e8" ]
[ "src/train/n_k_loop.py" ]
[ "from typing import Callable\nimport pytorch_lightning as pl\nfrom pytorch_lightning import LightningModule\nimport torch\nfrom pathlib import Path\nimport os\nimport argparse\nfrom ..models.multnat_model import MultNatModel\nfrom .utils import add_generic_args\n\n\ndef train(\n model_cls: Callable[[argparse...
[ [ "torch.cuda.empty_cache" ] ]
sernst/track-outline-comparison
[ "5a0fb5ac03f1edcbd11ad3fd49f8a62f93f08774" ]
[ "steps/load_data.py" ]
[ "import pandas as pd\n\nimport measurement_stats as mstats\n\nfrom cauldron import project\n\ndf = pd.read_csv('../Measurements.csv')\n\nmeasurements = []\n\nmeasurement_keys = []\n\nfor toe in ['Left', 'Center', 'Right']:\n measurement_keys.append({\n 'label': '{} Digit Length'.format(toe),\n 'typ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
SiqiTao/Collision_Prediction
[ "5ba99b884f7ccf64483e3acd83eb0b49dafd1aba" ]
[ "src/eda.py" ]
[ "# author: Linh Giang Nguyen\n# date: 2021-11-28\n\n\"\"\"Creates eda plots for the pre-processed training data from the \nNational Collision Database (NCDB) 2017 data (from https://open.canada.ca/data/en/\ndataset/1eb9eba7-71d1-4b30-9fb1-30cbdab7e63a/resource/01426d41-529c-443f-a901-6bc2f94f3d73).\nSaves the plots...
[ [ "pandas.read_csv" ] ]
177arc/fpl-data
[ "cfa9d8a93a8878ca5be1ff4946c4d9f0f1643197" ]
[ "fpldata/s3store.py" ]
[ "import boto3\nimport pandas as pd\nfrom io import StringIO, BytesIO\nfrom zipfile import ZipFile, ZIP_DEFLATED\nfrom gzip import GzipFile\nimport os\nfrom typing import Dict\nimport shutil\n\n# Define type aliases\nDF = pd.DataFrame\nS = pd.Series\n\n\nclass S3Store:\n def_s3_bucket = 'fpl.177arc.net'\n\n de...
[ [ "pandas.read_csv" ] ]
tevang/chemprop
[ "357cbd12039f97a9f58ce6493211cc49bfb8db1d" ]
[ "chemprop/data/utils.py" ]
[ "from collections import OrderedDict, defaultdict\nimport csv\nfrom logging import Logger\nimport pickle\nfrom random import Random\nfrom typing import List, Set, Tuple, Union\nimport os\n\nfrom rdkit import Chem\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom .data import MoleculeDatapoint, MoleculeDataset, mak...
[ [ "numpy.unique", "numpy.arange", "numpy.concatenate", "numpy.count_nonzero", "numpy.array" ] ]
Ewpratten/colourscale
[ "d5d3090b4d154980ff8de76ea30fbfe721ad80e2" ]
[ "colourscale/imsort.py" ]
[ "import argparse\nfrom PIL import Image\nimport numpy as np\n\n## Keys ##\nclass Keys(object):\n overall = lambda x: (int(x[0]) + int(x[1]) + int(x[2]))\n red = lambda x: (int(x[0]))\n green = lambda x: (int(x[1]))\n blue = lambda x: (int(x[2]))\n avg = lambda x: (int(x[0]) + int(x[1]) + int(x[2])) /...
[ [ "numpy.asarray", "numpy.array" ] ]
seanyen/eigenpy
[ "e164f03eb13b5fc531dd6b5e7e0f28560f405464" ]
[ "unittest/python/test_LDLT.py" ]
[ "import eigenpy\n\nimport numpy as np\nimport numpy.linalg as la\n\ndim = 100\nA = np.random.rand(dim,dim)\n\nA = (A + A.T)*0.5 + np.diag(10. + np.random.rand(dim))\n\nldlt = eigenpy.LDLT(A)\n\nL = ldlt.matrixL() \nD = ldlt.vectorD() \nP = ldlt.transpositionsP() \n\nassert eigenpy.is_approx(np.transpose(P).dot(L.do...
[ [ "numpy.diag", "numpy.random.rand", "numpy.transpose" ] ]
YuMao1993/HumanRecognition
[ "5043a03a3904a3710030221c4f71c7416edc9c82" ]
[ "pyHumanRecog/CRF_opt.py" ]
[ "\"\"\" CRF_opt\nThis module contains code for post-processing the\nprediction result by incorporating photo-level\ncontext using CRF via loopy belief propagation(LBP).\n@Yu\n\"\"\"\nimport sklearn.preprocessing\nimport numpy as np\nimport CRF_opt_config as config\n\n\nclass CRFOptimizer:\n\n def __init__(self):...
[ [ "numpy.argmax", "numpy.zeros", "numpy.empty" ] ]
larioandr/pyqumo
[ "67f3866004bddcc9b2246ad7983fc8561fc39301" ]
[ "tests/statistical_tests/test_distributions_from_pyqunet.py" ]
[ "import pyqumo.distributions as cd\n\nimport unittest\nimport numpy\n\n\nclass TestBase(unittest.TestCase):\n \"\"\"Base class for all distributions unit tests. Provides an array of\n descriptors and a number of test methods, each of which inspects a part\n of each descriptor.\n\n Each descriptor is a d...
[ [ "numpy.asarray", "numpy.mean", "numpy.allclose" ] ]
meck93/intro_ml
[ "903710b13e9eed8b45fdbd9957c2fb49b2981f62" ]
[ "task2/task2_mlp_lbfgs.py" ]
[ "from sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.preprocessing import StandardScaler\n\nimport numpy as np\nimport pandas as pd\nimport math\nimport sys\n\n# personal csv reader module\nimport reader\n\n...
[ [ "sklearn.neural_network.MLPClassifier", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.preprocessing.StandardScaler", "sklearn.metrics.accuracy_score" ] ]
MateusRoder/fourier-rbm_avc
[ "90a2f3a9f94ec63e5fe7a9da0f66bb8865f818f7" ]
[ "statistics.py" ]
[ "import torch\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndy, dx = 50, 50\nrep = 15\nepochs = 50\nsave = True\n\nacc = np.zeros((epochs, rep, 4))\nx = np.arange(epochs)\n# 00 for 75/25 split\n# 0 for 50/50 split\n\nfor r in range(rep):\n acc[:, r, 0] = np.loadtxt(\"02test_acc\"+str(r)+\".txt\")*100 #...
[ [ "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.round", "numpy.std", "numpy.mean", "numpy.savetxt", "matplotlib.pyplot.show", "numpy.zeros" ] ]
sgmoorthy/Deepword-rnn-tensorflow
[ "99a00800f5f5ed63593e262969cf75db28d87f34" ]
[ "train.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport tensorflow as tf\n\nimport argparse\nimport time\nimport os\nfrom six.moves import cPickle\n\nfrom utils import TextLoader\nfrom model import Model\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument('--data_dir', type=st...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.summary.FileWriter", "tensorflow.global_variables", "tensorflow.assign", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.summary.merge_all", "tensorflow.GPUOptions" ] ]
AnthonyRaimondo/pandaSuit
[ "cff601e86d062f7c6ef0be14b358faba09137b4a" ]
[ "src/main/python/pandaSuit/stats/classification.py" ]
[ "from sklearn.tree import DecisionTreeClassifier\nfrom pandas import Series, DataFrame\n\n\nclass ClassificationTree:\n def __init__(self, dependent: Series, independent: Series or DataFrame):\n self.dependent = dependent\n self.independent = independent\n self.model = self._fit()\n\n def...
[ [ "sklearn.tree.DecisionTreeClassifier", "pandas.DataFrame" ] ]
TEE-AI/SAI
[ "f2a43d704078057c8f957f4751317e8fea75a07f" ]
[ "train/caffe/convert_tool/convt_cnnsvic.py" ]
[ "#\n# this module converts a floating point caffe model to the model conv.dat and fc.dat\n# conv.dat -- run on TEE comput stick.\n# fc.dat -- runs on host device\n# Note: the input model has to be trained as 1bit/3bits network.\n#\n# Run:\n# python convt_cnnsvic.py teeNet1.caffemodel teeNet1.prototxt teeNet1.json...
[ [ "numpy.zeros" ] ]
sunggg/relax
[ "22f80434838379c46211c292d5211a84eb1d096b" ]
[ "tests/python/relax/test_relay_translator.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.random.rand" ] ]
uc-eqgeo/rsqsim-python-tools
[ "35d65629809b7edc10053a464c212ea03616c8df" ]
[ "src/rsqsim_api/rsqsim_api/catalogue/event.py" ]
[ "from typing import Union, List\nfrom collections import defaultdict\nimport pickle\n\nimport xml.etree.ElementTree as ElemTree\nfrom xml.dom import minidom\n\nfrom matplotlib import pyplot as plt\nfrom matplotlib import cm, colors\nfrom matplotlib.animation import FuncAnimation, PillowWriter, FFMpegWriter\nfrom ma...
[ [ "numpy.nanmax", "matplotlib.animation.PillowWriter", "matplotlib.colors.LogNorm", "numpy.rint", "matplotlib.pyplot.subplots", "numpy.percentile", "numpy.ptp", "matplotlib.animation.FFMpegWriter", "numpy.ones", "numpy.argwhere", "matplotlib.animation.FuncAnimation", ...
ramomar1992/ass-1
[ "a1b5e67b87a05ecffdcd2811ae2e916b7b296ef1" ]
[ "index.py" ]
[ "from pandas import read_csv\nimport numpy as np\n\n# Open the csv as a data frame in python using the pandas package. Inspect the data frame to get an idea of the metrics reported and the format of the table.\ntable = read_csv(\"phi_data.csv\")\nprint(table)\n\n# Create a list that contains the following elements:...
[ [ "numpy.array", "pandas.read_csv" ] ]
jayleicn/mmf-1
[ "4f0f0ca9563e035e2f82329d1db83364c47d3c58" ]
[ "mmf/modules/metrics.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\nThe metrics module contains implementations of various metrics used commonly to\nunderstand how well our models are performing. For e.g. accuracy, vqa_accuracy,\nr@1 etc.\n\nFor implementing your own metric, you need to follow these steps:\n\n1. Create yo...
[ [ "torch.mean", "torch.nn.functional.softmax", "torch.sigmoid", "torch.max", "torch.round", "torch.sum", "torch.tensor", "torch.le", "torch.no_grad", "torch.arange", "torch.topk", "torch.logical_and" ] ]
mori97/dgl
[ "ed1948b5555106dee133cef91ed9ecfd3bd4310d" ]
[ "tests/backend/pytorch/__init__.py" ]
[ "from __future__ import absolute_import\n\nimport torch as th\n\ndef cuda():\n return th.device('cuda')\n\ndef array_equal(a, b):\n return th.equal(a, b)\n\ndef allclose(a, b):\n return th.allclose(a.float(), b.float(), rtol=1e-4, atol=1e-4)\n\ndef randn(shape):\n return th.randn(*shape)\n\ndef attach_g...
[ [ "torch.device", "torch.randn", "torch.full", "torch.equal" ] ]
sizumita/restaurants_viewer
[ "eae056893941cf39fa87640bffea72a8aed47c4a" ]
[ "arview.py" ]
[ "# coding: utf-8\n\nimport json\nimport time\nfrom enum import IntFlag\nfrom math import pi\nimport location\nimport numpy\nimport requests\nimport ui\nfrom numpy import sin, cos\nfrom objc_util import *\n\n\nclass SCNVector3(Structure):\n _fields_ = [('x', c_float), ('y', c_float), ('z', c_float)]\n\n\nload_fra...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.cos", "numpy.sin" ] ]
williamdjones/moses
[ "bbea6b06bdb9ca0dc0d4550c52ac40beef8dae0b" ]
[ "scripts/eval.py" ]
[ "import argparse\nimport numpy as np\nimport rdkit\n\nfrom moses.metrics.metrics import get_all_metrics\nfrom moses.script_utils import read_smiles_csv\n\nlg = rdkit.RDLogger.logger()\nlg.setLevel(rdkit.RDLogger.CRITICAL)\n\n\ndef main(config, print_metrics=True):\n test = None\n test_scaffolds = None\n pt...
[ [ "numpy.load" ] ]
zchu-hit-scir/SG-Bert-reproduced
[ "792e61a90947e6e02db646dce422ba558d579cb4" ]
[ "myModule.py" ]
[ "from re import template\nfrom torch.nn.modules.activation import GELU\nfrom transformers import (\n AutoModel, \n AutoTokenizer\n)\nimport numpy as np\nimport random\nimport torch\nfrom torch import nn, utils, optim\nfrom torch.utils.data import DataLoader\nfrom torch.nn import functional as F\nimport os\nfr...
[ [ "torch.mean", "torch.nn.GELU", "torch.ones", "torch.nn.functional.cross_entropy", "torch.eye", "torch.nn.Linear", "torch.log", "torch.nn.functional.cosine_similarity", "torch.arange", "torch.stack" ] ]
pyroll-project/pyroll-core
[ "f59094d58c2f7493ddc6345b3afc4700ca259681" ]
[ "tests/grooves/test_constricted_swedish_oval.py" ]
[ "from numpy import pi, isclose\n\nfrom pyroll.core import ConstrictedSwedishOvalGroove\n\n\ndef check(g):\n assert isclose(g.even_ground_width, 14.81966011 * 2)\n assert isclose(g.alpha1, 63.434949 / 180 * pi)\n assert isclose(g.alpha2, 100.304846 / 180 * pi)\n assert isclose(g.alpha4, 36.869898 / 180 *...
[ [ "numpy.isclose" ] ]
Coslate/Machine_Learning
[ "fd1e51cfdb02e1249819aa7d54a18b91fcd4225e" ]
[ "HW7/python/t_SNE/hw7.py" ]
[ "#! /usr/bin/env python3\n'''\n Author : BCC\n Date : 2022/05/02\n'''\n\nimport argparse\nimport math\nimport sys\nimport re\nimport os\nimport glob\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport numba as nb\nimport pylab\nimport io\nfrom scipy.spatial import distance\nfrom PIL impor...
[ [ "numpy.dot", "matplotlib.pyplot.imshow", "numpy.sqrt", "numpy.concatenate", "numpy.random.randn", "numpy.mean", "numpy.square", "matplotlib.pyplot.tight_layout", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.log", "matplotlib.pyplot.title", "matplotlib.pyplo...
aachong/fairseq
[ "1d720f20cf1f37255c0e2b1dd449905f3fec9778" ]
[ "fairseq/models/transformer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport torch\nimport torch.nn as nn\nfrom fairseq import utils\n...
[ [ "torch.empty", "torch.Tensor", "torch.zeros", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Embedding", "torch.nn.Linear", "torch.nn.init.normal_", "torch.FloatTensor", "torch.nn.init.xavier_uniform_" ] ]
industrial-optimization-group/offline_data_driven_moea
[ "4e454694f444ff44f86da24dc33672eb23561bfa" ]
[ "Other_files/All_analyses/plot_parallel_coord.py" ]
[ "import dash\nimport plotly.graph_objs as go\nfrom dash.dependencies import Input, Output\nimport dash_table\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport pandas as pd\nimport numpy as np\n\n\ndef plot_parallel_coord_interactive(names, stdnames, means, std, col):\n names = [\"x...
[ [ "numpy.random.rand", "pandas.DataFrame" ] ]
SimonScapan/AuntElisa
[ "5ce6aa1feabdee0244fa270db6e796ec1b0dc857" ]
[ "backend/chatbot/model_1/training.py" ]
[ "import tensorflow as tf\nimport tensorlayer as tl\nimport numpy as np\nfrom tensorlayer.cost import cross_entropy_seq, cross_entropy_seq_with_mask\nfrom tqdm import tqdm\nfrom sklearn.utils import shuffle\nfrom tensorlayer.models.seq2seq import Seq2seq\nfrom tensorlayer.models.seq2seq_with_attention import Seq2seq...
[ [ "sklearn.utils.shuffle", "tensorflow.reshape", "tensorflow.optimizers.Adam", "numpy.load", "tensorflow.GradientTape" ] ]
jbenjoseph/GitGeo
[ "205e0e3b8e0cd38e69d15d2386ee0e9e79effdc0" ]
[ "test_gitgeo.py" ]
[ "\"\"\"Unit tests and integration tests for GitGeo.\"\"\"\n\n# pylint: disable=no-self-use, too-many-locals\n\nimport csv\nimport glob\nimport os\nimport textwrap\n\nimport pandas as pd\nimport pytest\n\nfrom custom_csv import create_csv, add_committer_to_csv\nfrom geolocation import get_country_from_location\nfrom...
[ [ "pandas.DataFrame" ] ]
chxy95/SRCNN
[ "b2d43e3d605b751cd6cd0290047f24932d159185" ]
[ "train.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jun 25 16:50:16 2019\n\n@author: chxy\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom model import SRCNN_net\nimport torch.optim as optim\nfrom data_loader import loadtraindata, loadtestdata\nfrom torch.autograd import Variable\n\nfrom math import ceil\ndef trai...
[ [ "torch.nn.MSELoss", "torch.autograd.Variable" ] ]
yinchi/simpy-examples
[ "bb9f2d8ab009f7089d50d63aa699aebfce29ace3" ]
[ "ex07_mmkk_mdkk.py" ]
[ "# 07 M/M/k/k vs M/D/k/k\n\n'''\nBecause of insensitivity, the request blocking probability of the\nM/G/k/k queue, of which the M/M/k/k and M/D/k/k queues are subtypes,\nis insensitive to the shape of the service time distribution apart\nfrom the mean.\n\nHere, we use confidence intervals to demonstrate this for di...
[ [ "numpy.arange", "numpy.max", "numpy.mean", "numpy.empty" ] ]
johnlees/mandrake
[ "f34deb1aeed730041398923c1c0d6e6d5ccb9611" ]
[ "mandrake/dists.py" ]
[ "# vim: set fileencoding=<utf-8> :\n# Copyright 2020 John Lees and Gerry Tonkin-Hill\n\n'''Methods for calculating distances from sequence input'''\n\nimport re\nimport numpy as np\nimport pandas as pd\nfrom sklearn.neighbors import kneighbors_graph\n\n# C++ extensions\nimport pp_sketchlib\n\nfrom .pairsnp import r...
[ [ "sklearn.neighbors.kneighbors_graph", "numpy.array", "pandas.read_csv" ] ]
joao-aveiro/OOPAO
[ "213a447cd6a154683a7339f35d80b3cd36d9063a" ]
[ "AO_modules/SPRINT.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Jun 2 13:30:51 2021\r\n\r\n@author: cheritie\r\n\"\"\"\r\n\r\nfrom AO_modules.mis_registration_identification_algorithm.estimateMisRegistration import estimateMisRegistration\r\nfrom AO_modules.mis_registration_identification_algorithm.computeMetaSensitivyMatrix...
[ [ "numpy.round", "numpy.asarray", "numpy.arctan", "numpy.ndim" ] ]
snc2/tequila
[ "6767ced9215408f7d055c22df7a66ccd610b00fb" ]
[ "src/tequila/hamiltonian/paulis.py" ]
[ "\"\"\"\nConvenience initialization\nof Pauli Operators. Resulting structures can be added and multiplied together.\nCurrently uses OpenFermion as backend (QubitOperators)\n\"\"\"\nimport typing\nfrom tequila.hamiltonian import QubitHamiltonian\nfrom tequila import BitString, TequilaException\nfrom tequila.wavefunc...
[ [ "numpy.isclose" ] ]
Ricky-Wilson/Python
[ "9896d7a9901dabea4b3d555af471577a624d1b95" ]
[ "Lib/test/test_buffer.py" ]
[ "#\n# The ndarray object from _testbuffer.c is a complete implementation of\n# a PEP-3118 buffer provider. It is independent from NumPy's ndarray\n# and the tests don't require NumPy.\n#\n# If NumPy is present, some tests check both ndarray implementations\n# against each other.\n#\n# Most ndarray tests also check ...
[ [ "numpy.ndarray" ] ]
jmc529/BentoML
[ "96c1ec9e486d98930e24bbbac5b2991a6d416f97" ]
[ "tests/_internal/bento_services/pytorch_classifier.py" ]
[ "import numpy\nimport torch # pylint: disable=import-error\n\nimport bentoml\nfrom bentoml.adapters import DataframeInput\nfrom bentoml.pytorch import PytorchModelArtifact\n\n\n@bentoml.env(infer_pip_packages=True)\n@bentoml.artifacts([PytorchModelArtifact(\"model\")])\nclass PytorchClassifier(bentoml.BentoService...
[ [ "torch.from_numpy" ] ]
lidanh/game-of-thrones-tweets-generator
[ "92921073fd3e0812d785f92dbc2f5e0f3588e15b" ]
[ "create_batch.py" ]
[ "from __future__ import print_function\n\nfrom random import randint\nimport os\n\nimport tensorflow as tf\nfrom six.moves import cPickle\n\nfrom rnnmodel import RNNModel\n\nVOCABULARY_FILE = 'words_vocabulary.pickle'\n\nCONFIGURATION_FILE = 'configuration.pickle'\n\n\ndef main():\n\n\t# typical tweet length\n\tnum...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.all_variables", "tensorflow.initialize_all_variables", "tensorflow.Session" ] ]
power4454/studio
[ "d8115a8f483edab8d674f567e277863ea1bb3f79" ]
[ "function/python/brightics/function/statistics/correlation.py" ]
[ "import matplotlib.pyplot as plt\nimport seaborn as sns\nfrom brightics.common.report import ReportBuilder, strip_margin, plt2MD,\\\n pandasDF2MD\nfrom scipy import stats\nfrom brightics.common.groupby import _function_by_group\nfrom brightics.common.utils import check_required_parameters\nimport pandas as pd\n\...
[ [ "matplotlib.pyplot.gca", "scipy.stats.pearsonr", "pandas.DataFrame", "matplotlib.pyplot.clf", "scipy.stats.kendalltau", "scipy.stats.spearmanr" ] ]
UCIDataLab/PP_dialog_models
[ "fb290bd55578e045eac6f36c6e650fcbb9104a9f" ]
[ "mhddata.py" ]
[ "__author__ = 'Jihyun Park'\n__email__ = 'jihyunp@uci.edu'\n\nimport os\nfrom collections import defaultdict\n\nimport numpy as np\nimport pandas as pd\ntry:\n import cPickle as cp\nexcept ImportError:\n import pickle as cp\nimport re\n\nfrom sklearn.feature_extraction.text import CountVectorizer, TfidfVector...
[ [ "pandas.read_csv", "numpy.sum", "sklearn.feature_extraction.text.CountVectorizer", "numpy.array", "numpy.zeros", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
hiyouga/Toxic_Detection
[ "7545f71ebf8f65043db8e8fb0f5a8072b8b346cf" ]
[ "code/models/bert.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom .env import multienv\n\n\nclass BERT(nn.Module):\n\n def __init__(self, configs):\n super(BERT, self).__init__()\n self.embeddings = configs[\"embeddings\"]\n self.encoder = configs[\"encoder\"]\n self.num_hidden_layers = configs[\"num_hidd...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.zeros_like", "torch.ones_like" ] ]
eulersim/sposm
[ "9e85a7ba65eacc736730ae2799828b570ce51739" ]
[ "code/extract_revenues_sec_fin_stat_data.py" ]
[ "import pandas as pd\n\ndf_names = [\"sub\", \"tag\", \"num\", \"pre\"]\nfor df in df_names:\n globals()[df] = pd.read_csv('data/' + df + '.csv')\n\ndf_merged = sub[(sub.countryba == \"US\") & (sub.fp.str[0] == 'Q')]\n\ndf_merged = df_merged[['adsh', 'cik', 'name', 'sic', 'fp', 'period', 'fye']]\ndf_merged = df_me...
[ [ "pandas.merge", "pandas.read_csv" ] ]
Lucaman99/strawberryfields
[ "627b8e6c1049d1108303bf0d9ba53cf6b120ea1f" ]
[ "strawberryfields/apps/data.py" ]
[ "# Copyright 2019 Xanadu Quantum Technologies Inc.\r\n\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n# Unless req...
[ [ "scipy.sparse.load_npz" ] ]
mingye-fsu/Python-code-of-Morris-Sensitivity-Analysis-for-a-single-model
[ "75c69d15522376052cfe9109ff936eda823207bb" ]
[ "morris_Sample.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Nov 26 14:56:47 2019\r\n\r\n@author: Jing Yang (jyang7@fsu.edu) and Ming Ye (mye@fsu.edu). This program was modified from the python codes\r\navailable at https://salib.readthedocs.io/en/latest/api.html, but has the following features:\r\n(1) it supports generati...
[ [ "numpy.random.seed", "numpy.random.choice", "numpy.eye", "numpy.matmul", "numpy.random.shuffle", "numpy.ones", "numpy.identity", "numpy.zeros" ] ]
extsui/AeroMixer
[ "bf5dc6fc75e91178234be72898c5e614476dfda8" ]
[ "bin/FontImage.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport numpy as np\n\nclass FontImage:\n def __init__(self, fontfile, ch_width, ch_height,\n ch_num_in_line, ch_byte_size):\n self.font = np.fromfile(fontfile, dtype=np.uint8)\n self.ch_width = ch_width\n self.ch_height = ch_height...
[ [ "numpy.fromfile" ] ]
benjaminpillot/gis-tools
[ "4f18d7b39e159375443e74a8c85fc3bb04fa22e6" ]
[ "gistools/network.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\" Module summary description.\n\nMore detailed description.\n\"\"\"\n\n# __all__ = []\n# __version__ = '0.1'\nfrom abc import abstractmethod\n\nimport networkx as nx\nimport numpy as np\nfrom geopandas import GeoDataFrame\nfrom numba import jit, float64\nfrom shapely.geometry import...
[ [ "numpy.maximum", "numpy.minimum", "numpy.cos", "numpy.sin", "numpy.seterr", "numpy.array", "numpy.fabs" ] ]
nerettilab/SIMBA3D
[ "4df8f13c3b73a3df4cfa65ad091631bee136ba64" ]
[ "simba3d/gradient_manager.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n\n\n\n@author: Michael Rosenthal\n\"\"\"\n\n# import the gradients\n'''\nSome gradients have cython code associated with them to speed up the\ncomputation. Try and import the cython and import a python if that fails.\n'''\n\nimport numpy as np\n#import time\n#import scipy.spatial.d...
[ [ "scipy.sparse.coo_matrix" ] ]
rickybalin/ALCF
[ "3696756d2af90f1ba179caa46d2001d07db5e01d" ]
[ "SmartSim/Theta/onlineInference/Python/src/inference.py" ]
[ "import argparse\nfrom time import sleep\nimport numpy as np\nfrom smartredis import Client\n\ndef init_client(nnDB):\n if (nnDB==1):\n client = Client(cluster=False)\n else:\n client = Client(cluster=True)\n return client\n\ndef main():\n # Import and initialize MPI\n import mpi4py\n ...
[ [ "numpy.random.uniform" ] ]
LightSecAgg/MLSys2022_anonymous
[ "ffda061ce8edaad2e7a3b8d6c38421c06f5bf7f7" ]
[ "fedml_api/data_preprocessing/cifar100/data_loader.py" ]
[ "import logging\n\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\n\nfrom .datasets import CIFAR100_truncated\n\n\n# generate the non-IID distribution for all methods\ndef read_data_distribution(filename='./data_preprocessing/non-iid-distribution/CIFAR...
[ [ "numpy.split", "numpy.unique", "numpy.clip", "torch.utils.data.DataLoader", "torch.from_numpy", "numpy.random.shuffle", "numpy.ones", "numpy.cumsum", "torch.utils.data.readlines", "numpy.random.permutation", "numpy.repeat", "numpy.array_split", "numpy.where", ...
dukeNashor/ChessMaster
[ "0b1f7b75a76e5c9129e73e0722af9e5b3b76f033" ]
[ "Python-Easy-Chess-GUI/python_easy_chess_gui.py" ]
[ "#!/usr/bin/env python3\n\"\"\" \npython_easy_chess_gui.py\n\nRequirements:\n Python 3.7.3 and up\n\nPySimpleGUI Square Mapping\nboard = [\n 56, 57, ... 63\n ...\n 8, 9, ...\n 0, 1, 2, ...\n]\n\nrow = [\n 0, 0, ...\n 1, 1, ...\n ...\n 7, 7 ...\n]\n\ncol = [\n 0, 1, 2, ... 7\n 0, 1, ...
[ [ "numpy.asarray", "numpy.array2string", "numpy.array" ] ]
ug-kim/nerf-pytorch-DDP
[ "8dbda485fc4f243e96eac2112440a5e10efe5ddc" ]
[ "main.py" ]
[ "\nimport os, sys\nimport numpy as np\nimport imageio\nimport json\nimport random\nimport time\nimport wandb\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom tqdm import tqdm, trange\n\nimport matplotlib.pyplot as plt\n\nimport torch.distributed as dist\nimport torch.multiprocessing as mp...
[ [ "torch.set_default_tensor_type", "torch.transpose", "torch.multiprocessing.spawn", "torch.randperm", "numpy.concatenate", "numpy.max", "torch.no_grad", "torch.distributed.init_process_group", "numpy.reshape", "numpy.arange", "torch.reshape", "numpy.ndarray.min", ...
aiLibrary/lanenet-lane-detection
[ "6abedbe1ba6da2e6f6e3935c6d26bd79c55a0d45" ]
[ "lanenet_model/lanenet_instance_segmentation.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# @Time : 18-5-11 上午11:35\n# @Author : Luo Yao\n# @Site : http://icode.baidu.com/repos/baidu/personal-code/Luoyao\n# @File : lanenet_instance_segmentation.py\n# @IDE: PyCharm Community Edition\n\"\"\"\n实现LaneNet中的实例图像分割模型\n\"\"\"\nimport tensorflow as tf\n...
[ [ "tensorflow.variable_scope", "tensorflow.constant", "tensorflow.placeholder" ] ]
xxchenxx/esm
[ "51e08c09a1687941515d7928181613d594c10981" ]
[ "finetune_temp.py" ]
[ "#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nimport pathlib\n\nimport torch\n\nfrom esm import Alphabet, FastaBatchedDataset, Protein...
[ [ "torch.tensor", "numpy.concatenate", "torch.no_grad", "torch.cuda.is_available", "numpy.corrcoef" ] ]
amey-joshi/physics
[ "66ae9bf4a363bd32b09df22a049e281953adb39b" ]
[ "open-systems/simulation-2.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nNumerical simulation of the variance matrix without using the simplification\nintroduced by Simon, Mukunda and others. The transformation matrices are\nderived from canonical commutation relations.\n\nCreated on Sun Dec 20 18:01:54 2020\n\n@author: ajoshi\n\...
[ [ "numpy.matrix", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.cos", "numpy.sin", "matplotlib.pyplot.plot", "numpy.tanh", "numpy.transpose", "matplotlib.pyplot.xlabel", "numpy.reciprocal", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplo...
tmsdy/amazon_captcha_break
[ "d9477aaf44ee5a6605b39cb98c1d55f67149ba34" ]
[ "cnn_captcha_break.py" ]
[ "# Builds the cnn network for running the network forward to make predictions.\n# Author : CheihChiu\n# Date : 2017-06-06\n\nimport math\n\nimport tensorflow as tf\n\nimport numpy as np\n\n# The capcha dataset has 18 classes, representing the charaters in ['a', 'b', 'c', 'e', 'f', 'g', 'h', 'j', 'k','l', 'm', 'n'...
[ [ "tensorflow.matmul", "tensorflow.nn.max_pool", "tensorflow.reshape", "tensorflow.nn.dropout", "tensorflow.nn.conv2d", "tensorflow.random_normal" ] ]
mmendiet/next-prediction
[ "bf5ee6cbc640933460a11a45a5df327f3d6f98a7" ]
[ "code/models.py" ]
[ "# Copyright 2019 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app...
[ [ "tensorflow.compat.v1.reduce_all", "tensorflow.compat.v1.concat", "tensorflow.compat.v1.gradients", "tensorflow.compat.v1.group", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.nn.rnn_cell.LSTMCell", "tensorflow.compat.v1.truncated_normal", "tensorflow.compat.v1.nn.sparse_soft...
AaltoPML/informative_prior
[ "64661650d2d03050689e841f084b97b0a1e3b1da" ]
[ "models/training.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\nimport numpy as np\r\n\r\ndef training_lr(model, x, y, learning_rate=0.001, batch_size=50, num_epoch=1000):\r\n \"\"\"\r\n Train a Bayesian linear regression model with stochastic variational inference on data (x, y)\r\n \"\"\"\r\n ...
[ [ "torch.optim.Adam", "numpy.sqrt", "torch.nn.MSELoss", "torch.cat" ] ]
NIKH0610/Final-Project
[ "da9f3c3280b979c401e46271638fb92d4fd8d7a7" ]
[ "Weather_Docker.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport sklearn\nimport os\n\ndf = pd.read_csv('/opt/weatherHistory.csv')\n\ndf.columns = ['Date', 'Summary', 'Prec Type', 'Temp', 'App Temp', 'Humidity', 'Wind Speed', 'Wind Angle', 'Visibility', 'Loud Cover', 'Pressur...
[ [ "matplotlib.pyplot.yticks", "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "numpy.arange", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "sklearn.linear_model.LinearRegression", "sklearn.feature...
ksemmendinger/Hydro_Parameter_Sensitivity_Visuals
[ "6d63b90e84172452a4e258d30efa049d6720cea1" ]
[ "HBV/SensIndices_RCPlots.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 10 12:56:56 2019\n\n@author: kylasemmendinger\n\"\"\"\n# import python libraries\nimport pandas as pd\nimport os\n\n# back out a directory to load python functions from \"Scripts\" folder\norg_dir_name = os.path.dirname(os.path.realpath('S...
[ [ "pandas.read_csv" ] ]
hoangph3/tslearn
[ "c589de380398379f2587f8cc812571d2a6d75938" ]
[ "tslearn/utils/cast.py" ]
[ "import warnings\n\nimport numpy\nfrom sklearn.utils import check_array\n\ntry:\n from scipy.io import arff\n HAS_ARFF = True\nexcept:\n HAS_ARFF = False\n\nfrom .utils import check_dataset, ts_size, to_time_series_dataset\n\n\ndef to_sklearn_dataset(dataset, dtype=float, return_dim=False):\n \"\"\"Tran...
[ [ "pandas.concat", "sklearn.utils.check_array", "numpy.arange", "pandas.DataFrame", "numpy.zeros", "numpy.empty" ] ]
CNES/pangeo-pyinterp
[ "5f75f62a6c681db89c5aa8c74e43fc04a77418c3" ]
[ "docs/source/examples/ex_3d.py" ]
[ "\"\"\"\n****************\n3D interpolation\n****************\n\nInterpolation of a three-dimensional regular grid.\n\nTrivariate\n==========\n\nThe :py:func:`trivariate <pyinterp.trivariate>` interpolation allows obtaining\nvalues at arbitrary points in a 3D space of a function defined on a grid.\n\nThe distributi...
[ [ "numpy.arange", "numpy.array", "matplotlib.pyplot.figure" ] ]
sphuber/aiida-fleur
[ "df33e9a7b993a52c15a747a4ff23be3e19832b8d", "df33e9a7b993a52c15a747a4ff23be3e19832b8d" ]
[ "aiida_fleur/workflows/relax.py", "aiida_fleur/tools/StructureData_util.py" ]
[ "# -*- coding: utf-8 -*-\n###############################################################################\n# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. #\n# All rights reserved. #\n# This file is part of the AiiDA-FLEUR package....
[ [ "numpy.array" ], [ "numpy.unique", "numpy.linalg.inv", "numpy.around", "numpy.matmul", "numpy.linalg.norm", "numpy.array", "numpy.where" ] ]
alirezasalemi7/ARMAN
[ "e935f38cb8ee58af09c4e0174e83e91fab90a478" ]
[ "models/pegasus/persian_datasets/summarization/PN_summary.py" ]
[ "\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\n\nimport tensorflow.compat.v2 as tf\nimport tensorflow_datasets.public_api as tfds\nimport re\n\n_DOCUMENT = \"_DOCUMENT\"\n_SUMMARY = \"_SUMMARY\"\n\n\n\nDIR = '/*path to data*/'\n\nclass...
[ [ "tensorflow.compat.v2.io.gfile.GFile" ] ]
OKRATechnologies/DiCE
[ "8cbed19e8981d484b1479601ec2669f59b8c9285" ]
[ "dice_ml/explainer_interfaces/explainer_base.py" ]
[ "\"\"\"Module containing a template class to generate counterfactual explanations.\n Subclasses implement interfaces for different ML frameworks such as TensorFlow or PyTorch.\n All methods are in dice_ml.explainer_interfaces\"\"\"\n\nfrom abc import ABC, abstractmethod\nimport numpy as np\nimport pandas as pd\...
[ [ "numpy.isclose", "sklearn.neighbors.KDTree", "numpy.sign", "numpy.argmax", "numpy.exp", "pandas.get_dummies" ] ]
collector-m/pole-localization
[ "719d14e2c325a6528e71114691fe15733a6f31eb" ]
[ "src/poles_extractor.py" ]
[ "import numpy as np\nfrom numba import jit\n\ndef detect_poles(xyz, neighbourthr = 0.5, min_point_num = 3, dis_thr = 0.08, width_thr = 10, fov_up=30.67, fov_down=-10.67, proj_H = 32, proj_W = 250, lowest=0.1, highest=6, lowthr = 1.5, highthr = 0.7, totalthr = 0.6):\n range_data, proj_vertex, _ = range_projection...
[ [ "numpy.minimum", "numpy.sqrt", "numpy.arctan2", "numpy.mean", "numpy.arcsin", "numpy.arange", "numpy.full", "numpy.linalg.det", "numpy.zeros", "numpy.delete", "numpy.append", "numpy.floor", "numpy.argsort", "numpy.array", "numpy.linalg.solve", "numpy...
Kuigesi/PipelineExecution-Reproducible
[ "f9c78989a872cddbf38e39a007b2e72f8c7f27e7" ]
[ "benchmark_plot.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mtick\n\n\nif __name__==\"__main__\":\n\n # Load data\n df = pd.read_csv('./data/benchmark.csv', index_col=0)\n\n # rename index\n df.rename(index={'Data Parallism (2 GPU)': 'Data Parallism\\n(2 GPU)',\\\n 'Data Par...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.ticker.PercentFormatter", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ] ]
lunlun1992/vmaf
[ "efb80822c6a7d8431928404be68a32a1f1574311" ]
[ "python/tools/plot.py" ]
[ "from matplotlib import pyplot as plt\nimport numpy as np\n\n__copyright__ = \"Copyright 2016, Netflix, Inc.\"\n__license__ = \"Apache, Version 2.0\"\n\n\ndef get_cdf(x, num_bins=100):\n x = np.array(x)\n counts, bin_edges = np.histogram(x, bins=num_bins)\n cdf = np.cumsum(counts)\n cdf = cdf / float(cd...
[ [ "numpy.cumsum", "matplotlib.pyplot.grid", "numpy.array", "numpy.histogram", "matplotlib.pyplot.ylabel" ] ]
idiap/DepthInSpace
[ "fe759807f82df4c48c16b97f061718175ea0e6e9" ]
[ "co/metric.py" ]
[ "# DepthInSpace is a PyTorch-based program which estimates 3D depth maps\n# from active structured-light sensor's multiple video frames.\n#\n# MIT License\n#\n# Copyright (c) 2019 autonomousvision\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated d...
[ [ "numpy.hstack", "numpy.asscalar", "numpy.abs", "numpy.linspace", "numpy.min", "numpy.median", "numpy.linalg.norm", "numpy.percentile", "numpy.ones", "numpy.max", "numpy.std", "numpy.mean", "numpy.zeros_like", "numpy.diff", "numpy.trapz", "numpy.array...
zhong110020/tensorflow
[ "b79ce0029dce3264266ced739590bc238b17096c" ]
[ "tensorflow/python/framework/graph_util_test.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.framework.graph_util.remove_training_nodes", "tensorflow.python.ops.variables.Variable", "tensorflow.python.framework.ops.device", "tensorflow.python.ops.gen_state_ops.variable", "tensorflow.python.framework.function.Defun", "tensorflow.python.platform.test.main", "t...
przemekblasiak/StrayVisualizer
[ "df5f39c750e8eec62b130dc9c8a91bdbcff1d952" ]
[ "stray_visualize.py" ]
[ "import os\nimport open3d as o3d\nimport numpy as np\nfrom scipy.spatial.transform import Rotation\nfrom argparse import ArgumentParser\nfrom PIL import Image\nimport skvideo.io\n\ndescription = \"\"\"\nThis script visualizes datasets collected using the Stray Scanner app.\n\"\"\"\n\nusage = \"\"\"\nBasic usage: py...
[ [ "scipy.spatial.transform.Rotation.from_quat", "numpy.linalg.inv", "numpy.eye", "numpy.load", "numpy.array", "numpy.zeros" ] ]
Louis-lew/ROS-Turtlebot3-Burger
[ "2d34ab84a2b5f2c2455d446326756fe9c8f94920" ]
[ "ros_autonomous_slam/nodes/autonomous_move.py" ]
[ "#!/usr/bin/python3\n\nfrom rrt import find_path_RRT\nimport numpy as np\nfrom scipy.misc import imread\nimport math\nimport rospy\nimport geometry_msgs.msg\nfrom geometry_msgs.msg import Point,Pose\nfrom nav_msgs.msg import Odometry, OccupancyGrid, MapMetaData, GridCells\nfrom sensor_msgs.msg import LaserScan\nfro...
[ [ "numpy.reshape", "numpy.ones", "scipy.misc.imread", "numpy.array", "numpy.zeros" ] ]
tomershraga/Udacity_Advanced_Lane_Lines
[ "826436fb695402e3ff1edda5568c3a5be5c91c73" ]
[ "perspective_transform.py" ]
[ "import cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef create_interest_mask(combined_binary_image):\n mask = np.zeros_like(combined_binary_image)\n region_of_interest = np.array([[0, combined_binary_image.shape[0] - 1], [combined_binary_image.shape[1] / 2, int(0.5 * combined_binary_image.shap...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.plot", "numpy.zeros_like", "numpy.array", "numpy.sum", "matplotlib.pyplot.show" ] ]
manal44/profit
[ "a05a2eb0a5a14c36edc46cadfccce3f43fcc1a4e" ]
[ "profit/run/run.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Dec 21 09:27:19 2018\n\n@author: calbert\n\"\"\"\n\nimport os\nimport sys\nimport subprocess\nimport multiprocessing as mp\n\ntry:\n from profit import config, read_input\nexcept:\n pass\n\ntry:\n from tqdm import tqdm\n use_tqdm=True\...
[ [ "numpy.array" ] ]
ryanbahneman/kaggle
[ "8a3d329f58aa1f241e655098c5fdfe78c4460770" ]
[ "digits/code/learn_digits.py" ]
[ "#!/usr/bin/env python\n\nimport pandas as pd\nimport numpy as np\nimport IPython as ipy\nfrom PIL import Image\n\nnp.set_printoptions(threshold='nan')\n\ntraining_data_path = \"../data/train.csv\"\n\ntrain_df = pd.read_csv(training_data_path, header=0)\n\nimages_data = train_df.drop([\"label\"], axis=1).values\n\n...
[ [ "numpy.set_printoptions", "pandas.read_csv" ] ]
JiangengDong/CoMPNetX
[ "7ad851db4c2275b099bdab0c151a23f9b753c839" ]
[ "python/test.py" ]
[ "#!/usr/bin/env python2\n\n\"\"\"\nCopyright (c) 2020, University of California, San Diego\nAll rights reserved.\n\nAuthor: Jiangeng Dong <jid103@ucsd.edu>\n Ahmed Qureshi <a1qureshi@ucsd.edu>\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the...
[ [ "numpy.logical_not", "numpy.isnan", "numpy.logical_and.reduce", "numpy.ones", "numpy.array", "numpy.isinf", "numpy.loadtxt" ] ]
jinxing64/flink-ai-extended
[ "f8eff31d69929f02c0953d60b983104cb60a7aa9" ]
[ "flink-ai-flow/python_ai_flow/test/python_codes/evaluate_component/test_python_evaluate_component.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\")...
[ [ "tensorflow.keras.models.load_model", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "tensorflow.compat.v1.keras.backend.set_session", "tensorflow.keras.datasets.mnist.load_data", "tensorflow.Session", "tensorflow.get_default_graph", "tensorflow.keras.layers.Fl...