repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
sarangbhagwat/Bioindustrial-Park | [
"c1f29bcb2306b3f8f3d9ce1948de81eae3c46021"
] | [
"BioSTEAM 2.x.x/biorefineries/HP/analyses/models.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Aug 23 12:11:15 2020\n\nModified from the cornstover biorefinery constructed in Cortes-Peña et al., 2020,\nwith modification of fermentation system for 2,3-Butanediol instead of the original ethanol\n\n[1] Cortes-Peña et al., BioSTEAM: A Fast ... | [
[
"numpy.array",
"numpy.linspace"
]
] |
FrappucinoGithub/school_meal_forecast_regressions | [
"23db636e7592b39cf100d7e7c707a411779b79bc"
] | [
"models/rolling_models.py"
] | [
"import pandas as pd\nimport statsmodels.api as sm\nimport argparse\nimport numpy as np\n\ndef main(df, window_size):\n \"\"\"\n Rolling Regression on les indexes avec la date de fin de la période\n \"\"\"\n X = df[[\"reel\", \"effectif\", \"annee_scolaire\"]].dropna().sort_index()\n\n X[\"month\"] =... | [
[
"pandas.read_pickle",
"pandas.get_dummies"
]
] |
davidruegamer/SDDR_code | [
"e2c3b62724033717225b0d589aa8029f4b1f32a4"
] | [
"benchmarks/deep_calibration/diabetes.py"
] | [
"import os\n\nimport sys\n# Disable\ndef blockPrint():\n sys.stdout = open(os.devnull, 'w')\n\nimport numpy\nimport scipy.stats\nimport matplotlib.pyplot\nimport sklearn.datasets\nimport sklearn.model_selection\nimport utils\nfrom GP_Beta_cal import GP_Beta\nfrom sklearn.isotonic import IsotonicRegression\nimpor... | [
[
"sklearn.isotonic.IsotonicRegression",
"numpy.min",
"numpy.max",
"numpy.std",
"numpy.shape",
"numpy.mean",
"numpy.diff",
"numpy.savetxt"
]
] |
csmile-1006/can-wikipedia-help-offline-rl | [
"ee5e0d927424dfd4dcfa7c6c1b856e1770f99570"
] | [
"code/experiment.py"
] | [
"import gym\nimport numpy as np\nimport torch\nimport wandb\n\nimport argparse\nimport pickle\nimport random\nimport sys\n\nfrom decision_transformer.evaluation.evaluate_episodes import (\n evaluate_episode,\n evaluate_episode_rtg,\n)\nfrom decision_transformer.models.decision_transformer import DecisionTrans... | [
[
"torch.mean",
"torch.load",
"numpy.min",
"torch.manual_seed",
"numpy.arange",
"numpy.ones",
"numpy.concatenate",
"numpy.max",
"numpy.std",
"numpy.zeros_like",
"numpy.mean",
"torch.no_grad",
"numpy.argsort",
"numpy.array",
"numpy.zeros"
]
] |
confstantine/nlp-task | [
"cb152e885bc6f6f1243a12ad90b1c715eb548736"
] | [
"ark_nlp/factory/predictor/crf_named_entity_recognition.py"
] | [
"\"\"\"\n# Copyright 2021 Xiang Wang, 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# http://www.apache.org/licenses/LICENSE-2.0\n\nAuthor: Xiang Wang, ... | [
[
"torch.no_grad",
"torch.Tensor"
]
] |
goshawk111/FishboneDiagramGenerator | [
"e10b5d7aced5ce78e62f4b769145121968a4cfd1"
] | [
"fishbone_diagram_generator/png_saver.py"
] | [
"\"\"\"\nModule for exporting PNG files\n\"\"\"\nimport copy\nimport cv2\nimport os\nfrom PIL import Image, ImageDraw, ImageFont\nimport textwrap\nimport numpy as np\nimport math\nimport fishbone_diagram_generator.const as const\n\n\nclass PNGSaver():\n \"\"\" Class for PNG file export \"\"\"\n\n def __init__... | [
[
"numpy.array",
"numpy.full"
]
] |
vishalbelsare/leibniz | [
"40bb6f088c5325701ca53506d7a66eb0a9ef4fef"
] | [
"leibniz/nn/net/hyptube.py"
] | [
"import logging\n\nimport torch as th\nimport torch.nn as nn\n\nfrom leibniz.nn.net.simple import Linear, SimpleCNN2d\n\nlogger = logging.getLogger()\nlogger.setLevel(logging.INFO)\n\n\nclass HypTube(nn.Module):\n def __init__(self, in_channels, hidden_channels, out_channels, encoder=Linear, decoder=Linear, **kw... | [
[
"torch.nn.ModuleList",
"torch.cat",
"torch.zeros"
]
] |
smallperks/streamlit | [
"1c4a1c3333342eccb8b28d89d5fe3d647169e8a0"
] | [
"lib/tests/streamlit/hashing_test.py"
] | [
"# Copyright 2018-2020 Streamlit 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 ... | [
[
"tensorflow.compat.v1.ConfigProto",
"pandas.Series",
"pandas.DataFrame",
"tensorflow.compat.v1.Session",
"numpy.remainder",
"numpy.logical_and",
"numpy.zeros"
]
] |
galtay/transformers | [
"8217d4e37fce48490a68af7e8ce902af16318132"
] | [
"src/transformers/models/prophetnet/modeling_prophetnet.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Microsoft Authors and The HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICEN... | [
[
"torch.all",
"torch.abs",
"torch.nn.functional.softmax",
"torch.nn.functional.dropout",
"torch.cat",
"torch.lt",
"torch.nn.Embedding",
"torch.cuda.is_available",
"torch.triu",
"torch.ones",
"torch.einsum",
"torch.bmm",
"torch.arange",
"torch.ones_like",
... |
csherwood-usgs/landlab | [
"4f43055060b544b34e71eba7062c09866ad93640",
"4f43055060b544b34e71eba7062c09866ad93640",
"4f43055060b544b34e71eba7062c09866ad93640"
] | [
"landlab/components/flow_routing/lake_mapper.py",
"landlab/components/stream_power/stream_power.py",
"landlab/grid/gradients.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Find depressions on a topographic surface.\n\n.. codeauthor:: gtucker, DEJH (Flow routing)\n\"\"\"\n# Routing by DEJH, Oct 15.\nfrom __future__ import print_function\n\nimport numpy as np\nfrom landlab import (ModelParameterDictionary, Component, FieldError,\n FIX... | [
[
"numpy.sqrt",
"numpy.in1d",
"numpy.all",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.any",
"numpy.searchsorted",
"numpy.argmin",
"numpy.where",
"numpy.unique",
"numpy.argmax",
"numpy.count_nonzero",
"numpy.zeros",
"numpy.logical_not",
"numpy.union1d"... |
kmsquire/sklearn-xarray | [
"86bca13d803ddcbedff55055fbb1f9ebbb8aeb98",
"86bca13d803ddcbedff55055fbb1f9ebbb8aeb98"
] | [
"sklearn_xarray/datasets.py",
"sklearn_xarray/preprocessing.py"
] | [
"\"\"\" ``sklearn_xarray.datasets`` \"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\n\n\ndef load_dummy_dataarray():\n \"\"\" Load a DataArray for demonstration purposes. \"\"\"\n\n return xr.DataArray(\n np.random.random((100, 10)),\n coords={'sample': range(100), 'featur... | [
[
"numpy.random.rand",
"sklearn.datasets.load_digits",
"numpy.random.random",
"pandas.TimedeltaIndex"
],
[
"numpy.logical_not",
"sklearn.utils.validation.check_is_fitted",
"scipy.signal.resample_poly",
"numpy.isnan",
"numpy.arange",
"numpy.issubdtype",
"pandas.MultiIn... |
cfld/MultitaskAIS | [
"d9b95b8f2f94e5f1fd241108a4f5d14b505de0db"
] | [
"contrario_kde.py"
] | [
"# coding: utf-8\n\n# MIT License\n# \n# Copyright (c) 2018 Duong Nguyen\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rig... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.cm.get_cmap",
"matplotlib.pyplot.ylim",
"numpy.load",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylabel",
"numpy.mean",
"scipy.stats.gaussian_kde",
"matplotlib.... |
Flow3rish/neuralnet-project-1o | [
"5cb0c7e8a169a2e20daa3bb2385c7b69d6e6b034"
] | [
"test/test_neuralnet.py"
] | [
"from typing import Type\nimport numpy as np\nimport unittest\nimport warnings\nimport itertools\nimport json\nimport csv\n\nfrom numpy.core.arrayprint import _leading_trailing\nfrom neural_net.neuralnet import NeuralNet, CompetitiveNeuralNet, NeuralNetException\nimport neural_net.activation_functions as af\n\n\n\"... | [
[
"numpy.cosh",
"numpy.linspace",
"numpy.isnan",
"numpy.random.randn",
"numpy.diff",
"numpy.random.rand",
"numpy.random.uniform",
"numpy.array"
]
] |
presmerats/Nurse-Scheduling-LP-and-Heuristics | [
"0b4796d082908f6644bd28ad4bfad9552879ea75"
] | [
"Tools/Reporting/reporting.py"
] | [
"import json\nimport math\nimport matplotlib.pyplot as plt\nimport os\n\nimport sys\n\nfilename=\"../cplex/model01/log-tests-model01-hfree-1512596874.242562.txt\"\nif len(sys.argv) >1:\n filename=sys.argv[1]\n\n\nif not os.path.exists(filename):\n exit()\n\nlog = json.load(open(filename))\n\n#print(log)\n#exi... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
RaevskyDN/aij2020-amur-noflood-public | [
"d11349b1f8cc79c18bb078392731eac32b3c56ff"
] | [
"amurlevel_model/processing/merge_hydro_meteo.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport pandas as pd\nfrom geopandas.geodataframe import GeoDataFrame\nimport numpy as np\nfrom pykrige.ok import OrdinaryKriging\nfrom sklearn.neighbors import KDTree\nimport gc\nfrom typing import Optional\nimport logging\nfrom tqdm import tqdm\n\nfrom ..dataloaders.asunp import get_asu... | [
[
"pandas.concat",
"sklearn.neighbors.KDTree",
"pandas.DataFrame"
]
] |
davidt0x/hypertunity | [
"30efcf84804e6ea52b2019455c80e119bab89a10"
] | [
"hypertunity/reports/tensorboard.py"
] | [
"import os\nimport sys\nfrom typing import List, Dict, Any, Union\n\ntry:\n import tensorflow as tf\n from tensorboard.plugins.hparams import api as hp\nexcept ImportError as err:\n raise ImportError(\"Install tensorflow>=1.14 and tensorboard>=1.14 \"\n \"to support the HParams plugin.... | [
[
"tensorflow.executing_eagerly"
]
] |
PhillCli/psi4numpy | [
"31d405e351edaaa81285a12d2230e96aad160043"
] | [
"Coupled-Cluster/RHF/EOM_CCSD.py"
] | [
"\"\"\"\nA Psi4 input script to compute excitation energies using EOM CCSD.\nThis implementation shows how to use the Davidson method to partially\ndiagonalize the (large) effective Hamiltonian matrix in order to find the lowest\nfew excited states in the context of the EOM_CCSD method.\n\nA description of the Davi... | [
[
"numpy.dot",
"numpy.linalg.eig",
"numpy.set_printoptions",
"numpy.eye",
"numpy.linalg.norm",
"numpy.zeros_like",
"numpy.column_stack",
"numpy.linalg.qr"
]
] |
SymmetricChaos/WarhammerStats | [
"4b68a189e51e372c6c08c896944a8a96b8d4b576"
] | [
"Analysis/DecisionTree2/GiniImpurityFourGroups.py"
] | [
"import pickle\nimport random\nimport matplotlib.pyplot as plt\nfrom itertools import product\nimport numpy as np\n\n\ndef gini_impurity(L):\n N = np.sum(L)\n out = 0\n for i in L:\n out += (i/N)*(i/N)\n return 1-out\n\nunitsDF = pickle.load( open( \"C:\\\\Users\\\\Alexander\\\\Documents\\\\Pytho... | [
[
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show",
"numpy.sum"
]
] |
GZYZG/TransUnet | [
"806a90398bc063ff12f82e558d2cb6ad62034645"
] | [
"inference_multiview.py"
] | [
"# 使用多个视图进行inference\n\nimport torch\nimport argparse\nfrom scipy.ndimage import zoom\nimport numpy as np\nimport os\nimport SimpleITK as sitk\nfrom networks.vit_seg_modeling import VisionTransformer as ViT_seg\nfrom networks.vit_seg_modeling import CONFIGS as CONFIGS_ViT_seg\n\n\nparser = argparse.ArgumentParser()... | [
[
"torch.softmax",
"torch.load",
"scipy.ndimage.zoom",
"torch.from_numpy",
"torch.no_grad",
"numpy.zeros_like",
"numpy.zeros"
]
] |
Anurag14/STar-framework | [
"6670499c681fce8d76aae1d1910bc849ec5f56ea"
] | [
"utils/augmentations/tensorflow_augs/augment_fixmatch.py"
] | [
"# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"torch.normal",
"numpy.random.choice",
"numpy.stack",
"torch.stack",
"torch.nn.functional.pad",
"numpy.random.randint"
]
] |
henriquepm/ByteTrack_vd | [
"1d0966b5f8d36178b40c841bb865c9409892d935"
] | [
"tools/demo_track.py"
] | [
"from loguru import logger\n\nimport cv2\n\nimport torch\n\nfrom yolox.data.data_augment import preproc\nfrom yolox.exp import get_exp\nfrom yolox.utils import fuse_model, get_model_info, postprocess, vis\nfrom yolox.utils.visualize import plot_tracking\nfrom yolox.tracker.byte_tracker import BYTETracker\nfrom yolo... | [
[
"torch.no_grad",
"torch.from_numpy",
"torch.ones",
"torch.load"
]
] |
kukionfr/Mask_RCNN | [
"db06f3ca09d900ed05313fd95ea18fd654b7ac40"
] | [
"samples/nucleus/nucleus.py"
] | [
"\"\"\"\nMask R-CNN\nTrain on the nuclei segmentation dataset from the\nKaggle 2018 Data Science Bowl\nhttps://www.kaggle.com/c/data-science-bowl-2018/\n\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\n------------------------------------------------------------\n\nUsage: imp... | [
[
"numpy.reshape",
"matplotlib.use",
"numpy.stack",
"numpy.ones",
"numpy.concatenate",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
iabhra/Action_Image_Classification | [
"a84d2509441da787a814965f34340bf37cada5b9"
] | [
"face_detector_facenet.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom scipy import misc\nimport tensorflow as tf\nimport os\nfrom facenet.src import align\nimport facenet.src.align.detect_face\nfrom PIL import Image\nimport numpy as np\nimport cv2\nimport matplotlib.p... | [
[
"tensorflow.Graph",
"numpy.zeros",
"tensorflow.Session"
]
] |
xp10rd/NSU-FIT | [
"2175f07ff325e754a0b5d19d760224af55a0e700",
"2175f07ff325e754a0b5d19d760224af55a0e700"
] | [
"the-3rd-year/architecture-of-modern-microprocessors-and-multiprocessors/laboratory_work_#2/src/build_plot.py",
"the-3rd-year/architecture-of-modern-microprocessors-and-multiprocessors/laboratory_work_#3/src/build_plot.py"
] | [
"import matplotlib.pyplot as plt\nimport sys\nimport platform\n\nif len(sys.argv) < 2:\n raise Exception(\"usage: python3 build_plot.py compute.log\")\n\nlog = open(sys.argv[1], \"r\")\nlines = log.readlines()\n\nx_axis = []\ny_axis = []\n\nfor line in lines:\n data = line.split()\n x_axis.append(int(data[... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
],
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
sola-st/Nalin | [
"3a6f95cec95d9152a65af970cfbb145179b0bd72"
] | [
"src/nn/run_classification.py"
] | [
"\"\"\"\n\nCreated on 21-April-2020\n@author Jibesh Patra\n\n\"\"\"\nimport argparse\nimport os\nimport sys\nfrom multiprocessing import cpu_count\nfrom pathlib import Path\nimport torch\nfrom torch.utils.data import DataLoader\nimport fileutils as fs\n\nfrom dataset_utils.data_transformers.AblationTransformer impo... | [
[
"torch.utils.data.DataLoader",
"torch.cuda.is_available"
]
] |
krisztinasinkovics/seismic-augmentation | [
"e0ea4ba4bc64c067eeba984f47723ed589f7d90d"
] | [
"seismic_augmentation/augmentations.py"
] | [
"import random\nimport julius\nimport torch\n\nclass BaseAugmentation(object):\n def __init__(self, p: float = 1.0):\n \"\"\"\n @param p: the probability of the transform being applied; default value is 1.0\n \"\"\"\n assert 0 <= p <= 1.0, \"p must be a value in the range [0, 1]\"\n ... | [
[
"torch.randn_like",
"torch.ones",
"torch.random.seed",
"torch.FloatTensor",
"torch.square",
"torch.hann_window"
]
] |
alkim-akgun/seamseg | [
"b4eabd95c838ca4804773637f7107e8f0051cdb4"
] | [
"scripts/test_panoptic.py"
] | [
"import argparse\nimport time\nfrom collections import OrderedDict\nfrom functools import partial\nfrom os import path, mkdir\n\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nimport umsgpack\nfrom PIL import Image\nfrom skimage.morphology import dilation\nfrom skimage.segmentation import find_b... | [
[
"numpy.expand_dims",
"torch.distributed.init_process_group",
"torch.cuda.set_device",
"torch.no_grad",
"torch.device",
"torch.distributed.get_rank",
"torch.distributed.get_world_size",
"numpy.array",
"torch.save"
]
] |
antonymarion/RANSAC-Flow | [
"7b0c6c82526e8ea45947c59bbd95e7f4b087141b"
] | [
"train/train.py"
] | [
"#!/usr/bin/python3\n\nimport argparse\nimport os\nimport numpy as np\nimport torch\nimport warnings\nfrom torchvision import transforms\nimport torch.nn.functional as F\nimport itertools\nimport pandas as pd\nimport pickle \nimport time\n\nimport sys \nsys.path.append('..')\n\n\nimport model.model as model\n# impo... | [
[
"torch.abs",
"torch.LongTensor",
"pandas.read_csv",
"torch.ones",
"torch.linspace",
"torch.load",
"torch.cat",
"numpy.arange",
"torch.sum",
"torch.nn.functional.grid_sample",
"torch.cuda.is_available",
"numpy.zeros",
"numpy.roll",
"torch.nn.functional.pad",
... |
erhsh/erhsh-python | [
"aeb04352948a2e1f8125a2681b80104b5146bff8"
] | [
"tmpdir/dump_compare_sync.py"
] | [
"npy = \"/home/cj/dump_sync/rank_0/FCN8s/1/0/Conv2DBackpropInput.Conv2DTranspose-op251.0.0.1633702468784428.input.0.DefaultFormat.npy\"\nnpy = \"/home/cj/dump_sync/rank_0/FCN8s/1/0/Conv2DBackpropInput.Conv2DTranspose-op251.0.0.1633702468786013.input.1.DefaultFormat.npy\"\nnpy = \"/home/cj/dump_sync/rank_0/FCN8s/1/0... | [
[
"numpy.load"
]
] |
flavianh/philips-algorithm | [
"47fefd5aa66420bbc833ed62aaa0a22331c93b02"
] | [
"spectrogram.py"
] | [
"import numpy as np\nfrom scipy.signal import get_window\nfrom scipy.signal import spectrogram\n\n\ndef get_spectrogram(audio, t1, fs, nperseg, overlap_fraction):\n \"\"\"Wrapper on scipy.signal.spectrogram with less parameters.\"\"\"\n window = get_window('hamming', nperseg)\n noverlap = nperseg // overla... | [
[
"scipy.signal.get_window",
"scipy.signal.spectrogram",
"numpy.roll",
"numpy.zeros",
"numpy.sum"
]
] |
VincentLu91/Tree_PGGAN_test2 | [
"9fe1f2c1c17173d4f4ceed1d9cdae6d306261569"
] | [
"networks.py"
] | [
"# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# This work is licensed under the Creative Commons Attribution-NonCommercial\n# 4.0 International License. To view a copy of this license, visit\n# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to\n# Creative Commons, PO Box 1866,... | [
[
"tensorflow.cond",
"tensorflow.concat",
"numpy.sqrt",
"tensorflow.as_dtype",
"tensorflow.initializers.zeros",
"tensorflow.cast",
"tensorflow.nn.conv2d_transpose",
"tensorflow.pad",
"tensorflow.add_n",
"tensorflow.nn.conv2d",
"tensorflow.name_scope",
"numpy.float32",... |
mjvakili/supermean | [
"4388a164cc1da41776c0f8dd0060ada6db7e1c9e"
] | [
"code/precompute.py"
] | [
"import h5py\nimport numpy as np\nimport sampler\nimport time\nimport pyfits as pf\n\ncx = np.loadtxt(\"wfc3_f160w_clean_central100_matchedfilterpoly_cx.txt\")\ncy = np.loadtxt(\"wfc3_f160w_clean_central100_matchedfilterpoly_cy.txt\")\nmasks = pf.open(\"wfc3_f160w_clean_central100.fits\")[1].data[0:120,:]\nmasks[m... | [
[
"numpy.loadtxt"
]
] |
shoehall/studio | [
"c9cad52f71320f2e571824b1971781f377149381",
"c9cad52f71320f2e571824b1971781f377149381"
] | [
"projects/Programing/python/jupyter/cv/02 section/clahe/clahe.py",
"projects/Programing/python/pychm/cv/ch02/fft.py"
] | [
"import cv2\nimport matplotlib.pyplot as plt\n\nimg = cv2.imread('timg.jpg',0) #直接读为灰度图像\nres = cv2.equalizeHist(img)\n\nclahe = cv2.createCLAHE(clipLimit=2,tileGridSize=(10,10))\ncl1 = clahe.apply(img)\n\nplt.subplot(131),plt.imshow(img,'gray')\nplt.subplot(132),plt.imshow(res,'gray')\nplt.subplot(133),plt.imshow(... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
],
[
"numpy.fft.fft2",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.yticks",
"numpy.abs",
"matplotlib.pyplot.title",
"numpy.fft.fftshift",
"matplotlib.pyplot.subplot",
"matplotlib.py... |
ekwan/cctk | [
"85cb8d0b714a80e8e353987dc24006695f1d0532",
"85cb8d0b714a80e8e353987dc24006695f1d0532"
] | [
"test/test_renumber.py",
"cctk/group.py"
] | [
"import unittest, sys, os, io, copy, math\nimport numpy as np\nimport random\nimport networkx as nx\n\nimport cctk\nimport cctk.topology as top\n\nclass TestRenumber(unittest.TestCase):\n\n def test_renumber(self):\n # load test files\n original_molecules = {}\n n_original_molecules = 8\n ... | [
[
"numpy.array_equal"
],
[
"numpy.hstack",
"numpy.dot",
"numpy.ones_like",
"numpy.cross",
"numpy.sum",
"numpy.vstack"
]
] |
jswanglp/Levenberg-Marquardt-algorithm | [
"bc5068b24d8f78c595eb630f340c0463b7cb9789"
] | [
"codes/LM_algorithm.py"
] | [
"# 本程序实现通过 Levenberg-Marquardt 算法寻找 Rosenbrock 函数的极小值点\n# 可选 Rosenbrock 函数由公式 (a-x)**2+b*(y-x**2)**2 决定,代码内设置: a=1., b=1.\n# 在未知最优值的情况下,初始 lam 应设置较小,LM算法接近牛顿法,收敛加速,但在最优值附近会出现震荡\n# coding: utf-8\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nfrom mpl_toolkits.mplot3d import Axes3D\n... | [
[
"numpy.linspace",
"numpy.arange",
"numpy.eye",
"numpy.array",
"numpy.mat",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
sinagilassi/rmt-app | [
"bbd5bb496f36116ecec15d75b4133a43a9233aaa"
] | [
"PyREMOT/tests/test.py"
] | [
"import numpy as np\nfrom library.plot import plotClass as pltc\nimport matplotlib.pyplot as plt\nfrom library.saveResult import saveResultClass as sRes\nfrom docs.rmtUtility import rmtUtilityClass as rmtUtil\nfrom core.utilities import *\n\nfrom docs.rmtThermo import *\n\na1 = np.array([1, 2, 3])\na2 = np.array([5... | [
[
"numpy.array"
]
] |
ngunnar/learning-a-deformable-registration-pyramid | [
"1d8ba6110eaa32ed7c27ace099a605f7b4c46051"
] | [
"src/create_model.py"
] | [
"import sys\nsys.path.append('./src/ext/neuron')\nsys.path.append('./src/ext/pytools-lib')\nsys.path.append('./src/ext/pytools-lib/pynd')\nsys.path.append('./src/ext/pytools-lib/pytools')\n\nimport tensorflow as tf\nimport numpy as np\nfrom .CustomLayers.PyramidLayer import Pyramid\nfrom .CustomLayers.WarpLayer imp... | [
[
"tensorflow.zeros",
"tensorflow.shape",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Input"
]
] |
AndreaFGLS/AndreaFGLS.trabalhoLMS | [
"db4c6b59442a20ea6dfe9ae1f22d57fc231da5ca"
] | [
"Lib/site-packages/setuptools/msvc.py"
] | [
"\"\"\"\nImproved support for Microsoft Visual C++ compilers.\n\nKnown supported compilers:\n--------------------------\nMicrosoft Visual C++ 9.0:\n Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)\n Microsoft Windows SDK 6.1 (x86, x64, ia64)\n Microsoft Windows SDK 7.0 (x86, x64, ia64)\n\nMicroso... | [
[
"numpy.distutils.ccompiler.gen_lib_options"
]
] |
Sen-R/dynamic-programming | [
"cfb6cada511dcef4b442841cf95159d8deb55616"
] | [
"tests/test_solve.py"
] | [
"from typing import Dict\nimport pytest\nfrom numpy.testing import assert_almost_equal\nimport numpy as np\nfrom dp._types import Policy\nfrom dp import FiniteMDP\nfrom dp.solve import (\n backup_optimal_values,\n policy_evaluation,\n policy_evaluation_affine_operator,\n)\nfrom .conftest import SimpleMDP, ... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array"
]
] |
wolterhv/openpilot | [
"c189d15af9a613d8f109b39298c0ab3e22f39f6d"
] | [
"selfdrive/modeld/runners/onnx_runner.py"
] | [
"#!/usr/bin/env python3\n# TODO: why are the keras models saved with python 2?\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport numpy as np\nimport onnxruntime as ort\n\ndef read(sz):\n dd = []\n gt = 0\n while gt < sz * 4:\n st = os.read(0, sz * 4 - gt)\n assert(len(st) > 0)\n dd... | [
[
"numpy.product"
]
] |
Spaak/MusicTransformer-Pytorch | [
"5dba60bc6378cf187e6412002dd960282718751a"
] | [
"playground_generate.py"
] | [
"import torch\nimport torch.nn as nn\nimport os\nimport random\n\nfrom third_party.midi_processor.processor import decode_midi, encode_midi\n\nfrom utilities.argument_funcs import parse_generate_args, print_generate_args\nfrom model.music_transformer import MusicTransformer\nfrom dataset.e_piano import create_epian... | [
[
"torch.set_grad_enabled",
"torch.load"
]
] |
tnixon/mlflow | [
"92b7ac7b0138588487aeb380d9a210aa70202a7a"
] | [
"mlflow/lightgbm.py"
] | [
"\"\"\"\nThe ``mlflow.lightgbm`` module provides an API for logging and loading LightGBM models.\nThis module exports LightGBM models with the following flavors:\n\nLightGBM (native) format\n This is the main flavor that can be loaded back into LightGBM.\n:py:mod:`mlflow.pyfunc`\n Produced for use by generic ... | [
[
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close",
"numpy.argsort",
"numpy.array"
]
] |
FlexiGroBots-H2020/datacube-wps | [
"d73b798791cf0c50217ede4524c6e58da75897a6"
] | [
"datacube_wps/processes/fcdrill.py"
] | [
"from timeit import default_timer\n\nimport altair\nimport numpy as np\nimport xarray\nfrom datacube.utils.masking import make_mask\nfrom pywps import ComplexOutput, LiteralOutput\n\nfrom . import FORMATS, PolygonDrill, chart_dimensions, log_call\n\n\nclass FCDrill(PolygonDrill):\n SHORT_NAMES = ['BS', 'PV', 'NP... | [
[
"numpy.isnan",
"numpy.isfinite"
]
] |
damianospark/eazyprofiler | [
"e4d59d5efd416d2394591fbd1705829d7b95d81e"
] | [
"eazyprofiler/GetStats.py"
] | [
"#!/usr/bin/env python\n\n# log_gpu_cpu_stats\n# Logs GPU and CPU stats either to stdout, or to a CSV file.\n# See usage below.\n\n# Copyright (c) 2019, Scott C. Lowe <scott.code.lowe@gmail.com>\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, ar... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
IBM/Lale.jl | [
"8b34ade3e9ec2bd89046fe5e097ac80b8f1bcf3f"
] | [
"demo/old/project.py"
] | [
"import sklearn\nimport pandas as pd\nimport lale.datasets as dt\nimport lale\n\nfrom lale.lib.lale import Project\nfrom lale.lib.sklearn import OneHotEncoder\nfrom lale.lib.lale import ConcatFeatures\nfrom lale.lib.sklearn import DecisionTreeClassifier as Tree\nfrom lale.lib.sklearn import KNeighborsClassifier as ... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.make_scorer"
]
] |
gahjelle/where | [
"f7d025c4fb36adb3e511c3a61b244263bbfd000d"
] | [
"where/apriori/trf/itrf.py"
] | [
"\"\"\"A parser for reading data from ITRF files in SNX format\n\nDescription:\n------------\n\nReads station positions and velocities from ITRF files in SNX format. The velocity model is a simple linear offset\nbased on the reference epoch. For ITRF2014 a model for post seismic deformations are also included. see\... | [
[
"numpy.log",
"numpy.logical_and",
"numpy.squeeze",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.vstack"
]
] |
kvpradap/py_entitymatching | [
"4ff803df1a03cf4d77ef935357355e6de5dd9438"
] | [
"py_entitymatching/tests/test_feature_simfunctions.py"
] | [
"from functools import partial\nfrom nose.tools import *\nimport unittest\nimport pandas as pd\nimport six\n\nimport py_entitymatching.feature.simfunctions as sim\n\n\n@nottest\ndef test_null_cases(sim_measure, input1, input2):\n val = sim_measure(input1, input2)\n assert_equal(pd.isnull(val), True)\n\n\ndef ... | [
[
"pandas.isnull"
]
] |
luohongyin/Transformer-XL-MHD | [
"22e1fa375086e6a590184f9e1b70600dbcac0856"
] | [
"tf/avg_checkpoints.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"tensorflow.all_variables",
"tensorflow.get_variable",
"tensorflow.Variable",
"tensorflow.gfile.Exists",
"tensorflow.contrib.framework.load_checkpoint",
"tensorflow.assign",
"tensorflow.placeholder",
"tensorflow.initialize_all_variables",
"tensorflow.logging.info",
"tensorf... |
ZeyuGaoAi/Instance_based_Vision_Transformer- | [
"0ebe034f9b6faf171870a3964bf49346477c2a48",
"0ebe034f9b6faf171870a3964bf49346477c2a48"
] | [
"I-ViT/train_scnn_pos.py",
"nuclei_seg_cls_infer/single_image_infer.py"
] | [
"import argparse\nimport os\nfrom tqdm import tqdm\nimport time\nimport datetime\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nimport tensorboardX\nimport numpy as np\nfrom load_dataset import load_prcc_dataset_scnn_pos\nimport vit\nimport my_transform as T\n\nfrom vit.utils import (\n... | [
[
"torch.nn.CrossEntropyLoss",
"torch.utils.data.DataLoader",
"torch.cuda.max_memory_allocated",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.DataParallel"
],
[
"numpy.lib.pad",
"numpy.split",
"numpy.amax",
"scipy.ndimage.morphology.binary_fill_holes",
"numpy... |
amyxzhang/wikum | [
"23ee7cddd9507969e917fa6f38217eb0283cb975"
] | [
"wikum/website/views.py"
] | [
"from __future__ import print_function\nfrom __future__ import absolute_import\nfrom future import standard_library\nstandard_library.install_aliases()\nfrom builtins import zip\nfrom builtins import str\nfrom builtins import range\nfrom django.shortcuts import render, redirect\nfrom django.http import HttpResponse... | [
[
"sklearn.cluster.k_means_.MiniBatchKMeans",
"numpy.array"
]
] |
piskvorky/Kalman-and-Bayesian-Filters-in-Python | [
"0cc841f68c186b365bdd25f02cbb7a327f5c1417"
] | [
"code/ukf_internal.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Copyright 2015 Roger R Labbe Jr.\n\n\nCode supporting the book\n\nKalman and Bayesian Filters in Python\nhttps://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python\n\n\nThis is licensed under an MIT license. See the LICENSE.txt file\nfor more information.\n\"\"\"\n\nfrom __fut... | [
[
"matplotlib.pyplot.legend",
"matplotlib.patches.Arrow",
"numpy.asarray",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"matplotlib.pyplot.gca",
"numpy.arange",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
... |
likso/catalyst | [
"6c3e39f04dc9c2ada16c61741f785538b4ef3f48"
] | [
"research/data_accessor.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom os.path import expanduser\n\nfrom catalyst.data.minute_bars import BcolzMinuteBarReader\nfrom catalyst.exchange.utils.exchange_utils import get_sid\n\n\nclass OHLCVDataAccessor:\n \"\"\"\n Class to retrieve OHLCV minute data from catalyst.\n\n Attributes:\n ... | [
[
"numpy.multiply",
"pandas.Panel",
"pandas.DatetimeIndex"
]
] |
mjirik/imma | [
"c666e8280028a672a0816cadd4d0ca9fe57489c5"
] | [
"imma/sparse.py"
] | [
"#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nimport numpy as np\n\n\nclass SparseMatrix:\n def __init__(self, ndarray):\n self.coordinates = ndarray.nonzero()\n self.shape = ndarray.shape\n self.values = ndarray[self.coordinates]\n self.dtype = ndarray.dtype\n self.spa... | [
[
"numpy.zeros"
]
] |
friedsoap7/bmusegan-chorales | [
"cbe43dd29d83a159809fb401fd91d920e88abc07"
] | [
"config.py"
] | [
"\"\"\"Define configuration variables in experiment, model and training levels.\n\nQuick Setup\n===========\nChange the values in the dictionary `SETUP` for a quick setup.\nDocumentation is provided right after each key.\n\nConfiguration\n=============\nMore configuration options are provided. Four dictionaries `EX... | [
[
"numpy.array",
"tensorflow.compat.v1.ConfigProto",
"numpy.tile",
"tensorflow.compat.v1.disable_v2_behavior"
]
] |
marc260/Artificial-Neural-Network | [
"f54520056ab437c7b7af06f2b427591f0fd57eb3"
] | [
"ann-k-fold.py"
] | [
"# Artificial Neural Network\n# ANN using k-fold cross validation\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler, LabelEncoder, OneHotEncoder\nfrom sklearn.me... | [
[
"pandas.read_csv",
"sklearn.model_selection.cross_val_score",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.StandardScaler",
"sklearn.preprocessing.LabelEncoder"
]
] |
murimija/Masters_Diploma | [
"4116d7de51aa80d38de32670489b33de99f6df3f"
] | [
"pendubot.py"
] | [
"# -*- coding: utf-8 -*-\nimport random\nfrom collections import deque\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.optimizers import Adam\nimport math\nimport gym\nfrom gym import spaces, logger\nfrom gym.utils import seeding\nimport numpy as np\nimport numpy as np\nfrom numpy i... | [
[
"numpy.reshape",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.append",
"matplotlib.pyplot.clf",
"numpy.argmax",
"numpy.random.rand",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.y... |
audreyemmely/estrutura-de-dados | [
"9682dfd68180267f561994ca51251d943a09a621"
] | [
"estruturas/queue.py"
] | [
"# Importando a biblioteca Pandas para inserir os dados do CSV\nimport pandas as pd\ndata = pd.read_csv('https://raw.githubusercontent.com/audreyemmely/estrutura-de-dados/main/dados/USvideos.csv', encoding = \"UTF-8\")\n\n# criando os nós da fila\nclass Node: \n def __init__(self, value):\n self.value = v... | [
[
"pandas.read_csv"
]
] |
ling9601/tensorflow-yolov4-tflite | [
"6fef2c7f89d0d04486b7b90a72f59b8dcd846428"
] | [
"evaluate.py"
] | [
"from absl import app, flags, logging\nfrom absl.flags import FLAGS\nimport cv2\nimport os\nimport shutil\nimport numpy as np\nimport tensorflow as tf\nfrom core.yolov4 import filter_boxes\nfrom tensorflow.python.saved_model import tag_constants\nimport core.utils as utils\nfrom core.config import cfg\n\nflags.DEFI... | [
[
"tensorflow.constant",
"tensorflow.saved_model.load",
"tensorflow.shape",
"tensorflow.lite.Interpreter",
"numpy.copy"
]
] |
basedata10/baseq | [
"0f1786c3392a51a6ec7cb0f32355cd28eaa5df29",
"0f1786c3392a51a6ec7cb0f32355cd28eaa5df29"
] | [
"baseq/drops/barcode/split.py",
"baseq/drops/apa/UTR.py"
] | [
"import os, sys\nimport pandas as pd\nimport numpy as np\n\nfrom time import time\nfrom baseq.utils.file_reader import read_file_by_lines\nfrom baseq.drops.barcode.count import extract_barcode\nfrom itertools import product\n\nbarcode_prefix = [x[0]+x[1] for x in list(product('ATCG', repeat=2))]\n\ndef open_splited... | [
[
"pandas.read_csv"
],
[
"matplotlib.use",
"pandas.DataFrame"
]
] |
yrahul3910/study | [
"b19ee56c0893b78ae9bfdede3d0c607b640c16bb"
] | [
"src/dodge.py"
] | [
"from raise_utils.learners import *\nfrom raise_utils.metrics import ClassificationMetrics\nfrom raise_utils.data import Data\nfrom raise_utils.transforms import Transform\nfrom raise_utils.hyperparams import DODGE\nfrom hyperopt import hp, fmin, tpe, space_eval\nfrom tensorflow.keras.utils import to_categorical\nf... | [
[
"numpy.array",
"sklearn.svm.SVC"
]
] |
DLUTElvis/dgl | [
"ae3102d3a2d34a92b6441691d1e20cbcfa0a5f82"
] | [
"python/dgl/data/chem/alchemy.py"
] | [
"# -*- coding:utf-8 -*-\n\"\"\"Example dataloader of Tencent Alchemy Dataset\nhttps://alchemy.tencent.com/\n\"\"\"\nimport numpy as np\nimport os\nimport os.path as osp\nimport pathlib\nimport pickle\nimport zipfile\nfrom collections import defaultdict\n\nfrom .utils import mol_to_complete_graph\nfrom ..utils impor... | [
[
"numpy.std",
"numpy.array",
"numpy.mean",
"numpy.linalg.norm"
]
] |
dedoogong/asrada | [
"55fbc6acae562d534ee0dcbc6b2931d77abe5203",
"55fbc6acae562d534ee0dcbc6b2931d77abe5203"
] | [
"HandPose_Detector/FingerPoseEstimate.py",
"FaceLandmark_Detector_DAN/generate_hd5.py"
] | [
"import numpy as np\nimport math\n\nfrom Finger import Finger\nfrom FingerCurled import FingerCurled\nfrom FingerPosition import FingerPosition\n\nclass FingerPoseEstimate:\n def __init__(self, coords_xyz):\n self.coords_xyz = np.squeeze(coords_xyz)\n self.finger_position = [FingerPosition.Vertical... | [
[
"numpy.squeeze"
],
[
"numpy.concatenate",
"numpy.array",
"numpy.loadtxt",
"numpy.transpose"
]
] |
semlen/pymanopt | [
"405abc0d1b337d03897c4827f4499cc6fe91aae8"
] | [
"examples/closest_unit_norm_column_approximation.py"
] | [
"import os\n\nimport autograd.numpy as np\nimport tensorflow as tf\nimport theano.tensor as T\nimport torch\nfrom examples._tools import ExampleRunner\nfrom numpy import linalg as la, random as rnd\n\nimport pymanopt\nfrom pymanopt.manifolds import Oblique\nfrom pymanopt.solvers import ConjugateGradient\n\n\nos.env... | [
[
"tensorflow.zeros",
"tensorflow.reduce_sum",
"torch.sum",
"torch.from_numpy",
"numpy.linalg.norm",
"numpy.random.randn"
]
] |
vsilyaev/tensorflow | [
"db0b5da485e1d1f23003ee08ed2e191451ee0319",
"db0b5da485e1d1f23003ee08ed2e191451ee0319",
"f41959ccb2d9d4c722fe8fc3351401d53bcf4900"
] | [
"tensorflow/python/ops/gradients.py",
"tensorflow/python/kernel_tests/sparsemask_op_test.py",
"tensorflow/python/ops/state_ops.py"
] | [
"\"\"\"Implements the graph generation for computation of gradients.\"\"\"\n\nimport collections\nimport warnings\n\nimport tensorflow.python.platform\n\nimport numpy as np\n\nfrom tensorflow.python.framework import ops\nfrom tensorflow.python.framework import tensor_shape\nfrom tensorflow.python.framework import t... | [
[
"tensorflow.python.ops.array_ops.shape",
"tensorflow.python.framework.ops.op_scope",
"tensorflow.python.framework.ops.convert_n_to_tensor_or_indexed_slices",
"tensorflow.python.framework.ops.get_gradient_function",
"tensorflow.python.platform.logging.vlog",
"tensorflow.python.ops.array_ops... |
mkirchmeyer/adaptation-imputation | [
"7ef683f2da08699b3f877467fdb0e00d3b02bccc"
] | [
"src/utils/utils_network.py"
] | [
"import numpy as np\nimport torch\nimport logging\nimport os\nimport torch.optim as optim\nimport torch.nn.functional as F\n\nfrom logging.handlers import RotatingFileHandler\nfrom src.utils.network import FeatureExtractorDigits, DataClassifierDigits, DomainClassifierDigits, \\\n ReconstructorDigits, FeatureExtr... | [
[
"numpy.power",
"torch.LongTensor",
"torch.nn.functional.log_softmax",
"torch.nn.functional.softmax"
]
] |
shalei120/OxCTE | [
"0909a7d8f4fd8269de51eefe25732553e9fd4f59"
] | [
"Hyperparameters.py"
] | [
"import os\nimport torch\n\nclass HP:\n def __init__(self):\n self.args = self.predefined_args()\n\n def predefined_args(self):\n args = {}\n args['test'] = None\n args['createDataset'] = True\n args['playDataset'] = 10\n args['reset'] = True\n args['device'] =... | [
[
"torch.cuda.is_available"
]
] |
kaustubh-shirpurkar/wine-recommend | [
"eb12a29dc6cc03539c6d8cea715a239e23789a47"
] | [
"engine.py"
] | [
"import torch\r\nfrom tqdm import tqdm\r\n\r\n\r\ndef loss_fn(outputs, points):\r\n return torch.nn.CrossEntropyLoss()( outputs, points )\r\n\r\n\r\ndef train_fn(data_loader, model, optimizer, device, scheduler):\r\n model.train()\r\n\r\n for bi, d in tqdm( enumerate( data_loader ), total=len( data_loader ... | [
[
"torch.nn.CrossEntropyLoss",
"torch.no_grad",
"torch.argmax"
]
] |
tks10/PythonRobotics | [
"10042893d30f1a75f0f2083b338c63d43ab5cd1e",
"10042893d30f1a75f0f2083b338c63d43ab5cd1e"
] | [
"PathPlanning/QuinticPolynomialsPlanner/quintic_polynomials_planner.py",
"SLAM/FastSLAM1/fast_slam1.py"
] | [
"\"\"\"\n\nQuinitc Polynomials Planner\n\nauthor: Atsushi Sakai (@Atsushi_twi)\n\nRef:\n\n- [Local Path Planning And Motion Control For Agv In Positioning](http://ieeexplore.ieee.org/document/637936/)\n\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\n\n# parameter\nMAX_T = 100.0 # maxi... | [
[
"numpy.linalg.solve",
"numpy.arange",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.subplots",
"numpy.rad2deg",
"matplotlib.pyplot.plot",
"numpy.hypot",
"numpy.deg2rad",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"numpy.array",
... |
alinutzal/exatrkx-iml2020 | [
"f4b1e4438cda7db2d40c8e572b1b682c12781e6c"
] | [
"exatrkx/src/processing/cell_direction_utils/extract_direction.py"
] | [
"import time\r\nimport numpy as np\r\nimport pandas as pd\r\nimport logging\r\n\r\n#####################################################\r\n# UTILD PANDAS #\r\n#####################################################\r\ndef select_min(test_val, current_val):\r\n return min(test_... | [
[
"numpy.matrix",
"numpy.expand_dims",
"numpy.absolute",
"numpy.sqrt",
"numpy.linalg.inv",
"numpy.matmul",
"numpy.arccos",
"pandas.DataFrame",
"numpy.concatenate",
"numpy.arctan2",
"numpy.tan",
"numpy.argsort",
"numpy.array"
]
] |
dcoates/nitime | [
"5e5835b6ed8d1404f4e4ba1c5beb0ef1ac7afe48"
] | [
"nitime/utils.py"
] | [
"\"\"\"Miscellaneous utilities for time series analysis.\n\nXXX wrie top level doc-string\n\n\"\"\"\nimport numpy as np\nimport scipy.linalg as linalg\n\n#-----------------------------------------------------------------------------\n# Spectral estimation testing utilities\n#----------------------------------------... | [
[
"numpy.dot",
"numpy.asarray",
"numpy.squeeze",
"numpy.cumsum",
"numpy.mean",
"numpy.searchsorted",
"numpy.exp",
"numpy.where",
"numpy.hstack",
"numpy.clip",
"numpy.unique",
"numpy.arange",
"numpy.empty_like",
"numpy.eye",
"numpy.sin",
"numpy.intersec... |
lylinsh/Edge-loss-for-image-inpainting | [
"a15bddbb48dec32d188735f365a7a3b6d9ba6422"
] | [
"code/edgeModel.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass BaseNetwork(nn.Module):\n def __init__(self):\n super(BaseNetwork, self).__init__()\n\n def init_weights(self, init_type='normal', gain=0.02):\n '''\n initialize network's weights\n init_type: normal | xavier | kaiming | orthogonal\n ... | [
[
"torch.nn.Sequential",
"torch.nn.ReflectionPad2d",
"torch.load",
"torch.nn.init.constant_",
"torch.nn.utils.spectral_norm",
"torch.nn.Conv2d",
"torch.nn.init.xavier_normal_",
"torch.nn.InstanceNorm2d",
"torch.nn.init.normal_",
"torch.nn.init.orthogonal_",
"torch.nn.ReLU... |
mlcruw/covid-news-analyzer | [
"76c6a906de20633ff0e325f1ebe669c1e0eac325"
] | [
"analysis/analyze.py"
] | [
"from sklearn.metrics import accuracy_score, mean_squared_error\nimport pandas as pd\nimport numpy as np\n\ndef map_fake_label(label):\n if label == \"Authentic\":\n return 0\n else:\n return 1\n\ndef compute_accuracy_scores():\n df_true = pd.read_csv(\"true_results.csv\")\n df_pred = pd.r... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
Iamsdt/UdacityDeepLearningNanodegree | [
"507c2ce620f42e36271549471b819d3d7fceb1b6"
] | [
"projects/project_deployment_sentiment/train/train.py"
] | [
"import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport torch\nimport torch.optim as optim\nimport torch.utils.data\nimport time\n\n\nfrom model import LSTMClassifier\n\ndef model_fn(model_dir):\n \"\"\"Load the PyTorch model from the `model_d... | [
[
"torch.load",
"torch.manual_seed",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"torch.from_numpy",
"torch.nn.BCELoss",
"torch.cuda.is_available",
"torch.save"
]
] |
kichanll/multiband-melgan | [
"a0086054aaa5c70aebe278db3320bb913cce9558",
"a0086054aaa5c70aebe278db3320bb913cce9558"
] | [
"inference.py",
"denoiser.py"
] | [
"import os\nimport glob\nimport tqdm\nimport torch\nimport argparse\nfrom scipy.io.wavfile import write\nimport numpy as np\nfrom model.generator import Generator\nfrom utils.hparams import HParam, load_hparam_str\nfrom utils.pqmf import PQMF\nfrom denoiser import Denoiser\n\nMAX_WAV_VALUE = 32768.0\n\n\ndef main(a... | [
[
"numpy.load",
"scipy.io.wavfile.write",
"torch.no_grad",
"torch.load"
],
[
"torch.randn",
"torch.clamp",
"torch.no_grad",
"torch.zeros"
]
] |
mathLab/PyDMD | [
"2158376cf42bae31ce7271b3f9d5179f7e34bfc1"
] | [
"tests/test_spdmd.py"
] | [
"from unittest import TestCase\nfrom pydmd import SpDMD, DMD\nimport scipy.io\nimport numpy as np\n\ndata = np.load(\"tests/test_datasets/heat_90.npy\")\ngammas = [1.0e-1, 0.5, 2, 5, 10, 20, 40, 50, 100]\n\n\nclass TestSpDmd(TestCase):\n def test_number_nonzero_amplitudes_rho1(self):\n zeros = np.load(\"t... | [
[
"numpy.logical_not",
"numpy.load",
"numpy.linalg.solve",
"numpy.random.rand"
]
] |
robopsi/a3c_continuous | [
"1d3aa45e9e31f98e4bfd1729df20de67d52c7dbd"
] | [
"utils.py"
] | [
"from __future__ import division\nimport math\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\nimport json\nimport logging\n\n\ndef setup_logger(logger_name, log_file, level=logging.INFO):\n l = logging.getLogger(logger_name)\n formatter = logging.Formatter('%(asctime)s : %(message)s')\... | [
[
"numpy.sqrt",
"torch.from_numpy",
"numpy.prod",
"torch.cuda.device",
"numpy.array",
"torch.autograd.Variable"
]
] |
zimmerman-cole/hons-proj-public | [
"6fe2583d80ba0c5d5b1b90e703b394ade121f777",
"6fe2583d80ba0c5d5b1b90e703b394ade121f777"
] | [
"mylib/acquisitions.py",
"mylib/simulators.py"
] | [
"\"\"\"\nAcquisition functions contained here.\n\"\"\"\nimport numpy as np\nimport numpy.linalg as la\nimport matplotlib.pyplot as plt\nfrom scipy.optimize import minimize\nfrom scipy.stats import norm\n\nimport models\n\nclass Acquisition(object):\n \n \"\"\"\n Base class for acquisition functions.\n \... | [
[
"numpy.log",
"scipy.stats.norm.cdf",
"numpy.sqrt",
"scipy.stats.norm.pdf",
"numpy.arange",
"numpy.random.multivariate_normal",
"scipy.optimize.minimize",
"numpy.random.uniform",
"numpy.array",
"numpy.random.RandomState",
"numpy.zeros",
"numpy.isinf"
],
[
"nu... |
Brazilian-Institute-of-Robotics/autonomous_perception | [
"5645a2bc6811b33e9e6bf0f6873f496dff45ad94"
] | [
"src/scripts/inference_time_eval.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport json\nimport sys\nimport os\nsys.path.append(os.path.dirname(__file__) + '/..')\nfrom models.cmsnet import CMSNet\nfrom models.others import CnnsFcn, Darkfcn, UpNet\nfrom evaluation.others import load_... | [
[
"matplotlib.pyplot.boxplot",
"tensorflow.config.experimental.list_logical_devices",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.config.experimental.list_physical_devices",
"matplotlib.pyplot.rc",
"numpy.percentile",
"numpy.ones",
"tensorflow.keras.backend.clear_... |
philhu22/image-enhancers-AWSRN | [
"097578891f001a97146be8831ea4de0d2a145969"
] | [
"code/src/data/common.py"
] | [
"import random\n\nimport numpy as np\nimport skimage.color as sc\n\nimport torch\nfrom torchvision import transforms\n\ndef get_patch(*args, patch_size=96, scale=1, multi_scale=False):\n ih, iw = args[0].shape[:2]\n p = scale if multi_scale else 1\n tp = p * patch_size\n ip = tp // scale\n\n ix = ran... | [
[
"numpy.concatenate",
"numpy.expand_dims",
"torch.from_numpy"
]
] |
Pimpwhippa/object-detection | [
"2b33b3b44bdbb69805f4d8f0d2e155a40216b87b"
] | [
"detectorcode/grandyolo_nms.py"
] | [
"# import the necessary packages\nimport numpy as np\nimport argparse\nimport time\nimport cv2\nimport os\n \n# construct the argument parse and parse the arguments\nap = argparse.ArgumentParser()\nap.add_argument(\"-i\", \"--image\", required=True,\n\thelp=\"path to input image\")\nap.add_argument(\"-y\", \"--yolo... | [
[
"numpy.array",
"numpy.argmax",
"numpy.random.seed"
]
] |
amloewi/css-blockmodels | [
"f4c0b907632c1cd9dea2930e3efc25125cd18e66"
] | [
"grouping_distance.py"
] | [
"\nimport numpy as np\n\ndef mean_hamming(x, y):\n \"\"\"Mean Hamming ... similarity? between vectors x, y.\n\n\n \"\"\"\n return np.mean(x==y)\n\ndef d1(x, y):\n \"\"\"The max mean Hamming similarity between vectors x, y\n \"\"\"\n\n same = mean_hamming(x, y)\n flipped = mean_hamming(x, (1-y)**2)\n ... | [
[
"matplotlib.pyplot.plot",
"numpy.mean"
]
] |
ribeiro-hugo/smplx | [
"c78618adca86e746d84fe5da3fab1edb319f3f1f"
] | [
"transfer_model/utils/torch_utils.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is\n# holder of all proprietary rights on this computer program.\n# You can only use this computer program if you have closed\n# a license agreement with MPG or you get the right to use the computer\n# program from som... | [
[
"torch.is_tensor"
]
] |
Milogav/PytorchDL | [
"39d8e40cf430113003b2e03f81951d43118dc09a"
] | [
"pytorchDL/layers.py"
] | [
"import torch\n\n\nclass ActivationLayer(torch.nn.Module):\n\n def __init__(self, activation, **kwargs):\n super(ActivationLayer, self).__init__()\n\n activation = activation.lower()\n if activation == 'relu':\n self._act = torch.nn.ReLU(**kwargs)\n elif activation == 'leak... | [
[
"torch.nn.Sequential",
"torch.nn.BatchNorm1d",
"torch.add",
"torch.nn.ConvTranspose2d",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
yfredrix/pyraptor | [
"a00b1d5576cd4126611483409e293d283cb7917d"
] | [
"tests/conftest.py"
] | [
"\"\"\"conftest\"\"\"\nimport datetime\n\nimport pytest\nimport pandas as pd\nimport numpy as np\n\nfrom pyraptor.model.structures import Timetable\nfrom tests.utils import to_stops_and_trips, to_timetable\n\n\n@pytest.fixture(scope=\"session\")\ndef default_timetable() -> Timetable:\n \"\"\"Default timetable\"\... | [
[
"numpy.arange",
"pandas.concat",
"pandas.DataFrame"
]
] |
abherifintech/investpy | [
"6e77399adee7c36200f792a06549cb2b3d6f13eb"
] | [
"investpy/stocks.py"
] | [
"#!/usr/bin/python3\n\n# Copyright 2018-2020 Alvaro Bartolome @ alvarob96 in GitHub\n# See LICENSE for details.\n\nfrom datetime import datetime, date\nimport json\nfrom random import randint\n\nimport pandas as pd\nimport pkg_resources\nimport requests\nimport unidecode\nfrom lxml.html import fromstring\n\nfrom in... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
heng2j/delamain | [
"9eb522358fa4c253d74bca185b654522fc63f7f7"
] | [
"base/debug_cam.py"
] | [
"import numpy as np\nimport cv2\nimport carla\n\nfrom lane_tracking.lane_track import lane_track_init\n\n\ndef process_img(image):\n i = np.array(image.raw_data)\n i2 = i.reshape((288, 768, 4))\n i3 = i2[:, :, :3]\n # image.save_to_disk('data/image_%s.png' % image.timestamp)\n return i3\n\n\ndef save... | [
[
"numpy.array"
]
] |
thisismygitrepo/emi_da | [
"2c81c0c9293962b666f2b6456e87697a46ec951c"
] | [
"paper_results/plots.py"
] | [
"import numpy as np\nfrom scipy.io import loadmat\nimport pandas as pd\nfrom glob import glob\nfrom scipy.signal import savgol_filter\nimport matplotlib.pyplot as plt\nfrom matplotlib import rc\nimport toolbox as tb\n\n\n#%% Setting up matplotlib\nrc('font', **{'family': 'serif', 'serif': ['Computer Modern']})\nrc(... | [
[
"numpy.log",
"pandas.read_csv",
"numpy.arange",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.colormaps",
"scipy.io.loadmat",
"numpy.random.randint",
"matplotlib.pyplot.close",
"scipy.signal.savgol_filter",
"mat... |
amjsmith/rescale-cosmology | [
"1980fa89a4acc95e2a1effb3b0939af8e8dca275"
] | [
"displacement_field.py"
] | [
"import numpy as np\nfrom scipy.fftpack import fftfreq\nimport pyfftw\nimport h5py\n\n\nclass DisplacementField(object):\n \"\"\"\n Class which creates the displacement field \n\n Args:\n pos: array of halo comoving positions in units [Mpc/h]\n z: target redshift\n Plin: PowerSp... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.histogramdd",
"numpy.real",
"numpy.log10",
"scipy.fftpack.fftfreq",
"numpy.var",
"numpy.array",
"numpy.exp",
"numpy.where",
"numpy.zeros"
]
] |
chunyusunny/spark | [
"a5fe5d368c56c7015458e1aa690e4eadde33224c"
] | [
"python/pyspark/pandas/tests/test_series.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.to_datetime",
"pandas.Series",
"pandas.Int16Dtype",
"pandas.Int32Dtype",
"pandas.MultiIndex.from_tuples",
"pandas.DataFrame",
"pandas.Float64Dtype",
"pandas.StringDtype",
"pandas.Index",
"pandas.DatetimeIndex",
"pandas.Float32Dtype",
"pandas.MultiIndex",
... |
lsj2408/pytorch_geometric | [
"21cc1efd7c3b2912f4c2c98ddd5e9065a9aef6d4"
] | [
"torch_geometric/nn/conv/x_conv.py"
] | [
"from typing import Optional\n\nfrom math import ceil\n\nimport torch\nfrom torch import Tensor\nfrom torch.nn import Sequential as S, Linear as L, BatchNorm1d as BN\nfrom torch.nn import ELU, Conv1d\nfrom torch_geometric.nn import Reshape\n\nfrom ..inits import reset\n\ntry:\n from torch_cluster import knn_grap... | [
[
"torch.nn.BatchNorm1d",
"torch.cat",
"torch.nn.ELU",
"torch.nn.Linear",
"torch.matmul",
"torch.nn.Conv1d"
]
] |
alisoncleonard/Team-Virus-2020 | [
"8163e9c8394a68e3c0857c80f3c0636364c1fd42"
] | [
"model_himob-hifrac.py"
] | [
"# to run with model, run, and server files, use terminal command $ mesa runserver\nimport random\nfrom mesa import Model, Agent\nfrom mesa.time import RandomActivation\nfrom mesa.datacollection import DataCollector\nfrom mesa.space import MultiGrid\nimport scipy.stats\nimport numpy as np\nimport math\nfrom mesa.ba... | [
[
"pandas.DataFrame"
]
] |
steven9046/TinyNeuralNetwork | [
"9b4313bbe6fb46d602681b69799e4725eef4d71b"
] | [
"examples/converter/convert_and_compare.py"
] | [
"import os\nimport sys\n\nimport numpy as np\nimport tensorflow as tf\nimport torch\n\nfrom examples.models.cifar10.mobilenet import DEFAULT_STATE_DICT, Mobilenet\nfrom tinynn.converter import TFLiteConverter\nfrom tinynn.converter.base import GraphOptimizer\n\nsys.path.append('../../')\n\n\nCURRENT_PATH = os.path.... | [
[
"numpy.allclose",
"numpy.abs",
"torch.load",
"numpy.min",
"tensorflow.lite.Interpreter",
"numpy.all",
"numpy.max",
"numpy.mean",
"torch.rand",
"numpy.transpose"
]
] |
an918tw/textlesslib | [
"d9fcccefbd76b5d6dc6f1df0b8c743e730038f1f"
] | [
"examples/gslm/sample.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 logging\nimport random\nfrom typing import Optional\n\nfrom fairseq import utils\nimport numpy as np\nimport torch\nimport tor... | [
[
"torch.device",
"numpy.random.seed"
]
] |
bgerofi/hpc_results_v0.7 | [
"9cd9fa80ebc57db8438b1ac8dbd2d49232da6c2e"
] | [
"CSCS/benchmarks/cosmoflow/implementations/cosmoflow-benchmark/utils/checkpoints.py"
] | [
"\"\"\"Utility code for handling checkpoint loading\"\"\"\n\n# System imports\nimport os\nimport logging\n\n# External imports\nimport tensorflow as tf\nimport horovod.tensorflow.keras as hvd\n\ndef load_hvd_model(checkpoint):\n \"\"\"Load model with Horovod setup.\n\n This exists as a workaround for my horov... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.optimizers.Optimizer.__subclasses__"
]
] |
molenathyhoangxuannguyen/Regression-with-Python | [
"39ba827a05565bbd51fd2a391e26e7c6da3a4256"
] | [
"Regression.py"
] | [
"import random\nfrom math import sqrt\nfrom matplotlib import pyplot as plt\n\ndef mean(x):\n\n xTotal = 0\n for num in x:\n xTotal += num\n xLen = len(x)\n xMean=xTotal/xLen\n return xMean\n\ndef sumSig(num, mean):\n newLis = []\n for n in num:\n newLis.append(n - mean)\n retu... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter"
]
] |
ChuaCheowHuan/sagemaker-rl-container | [
"f8e86873ea9f74b32a38d1794e2914dbf36ccfba"
] | [
"src/vw-serving/src/vw_serving/serve.py"
] | [
"from __future__ import absolute_import\nimport json\nimport logging\nimport os\nimport signal\nimport sys\nimport warnings\nimport uuid\nimport datetime\nimport random\n\nimport numpy as np\nfrom gunicorn.six import iteritems\nfrom pkg_resources import iter_entry_points as iep\nimport flask\nimport gunicorn.app.ba... | [
[
"numpy.random.choice"
]
] |
thalfeust/TicTacToe-AI | [
"611c13290db096f5c8b6e94f9d42548f2764b1bd"
] | [
"game.py"
] | [
"import numpy as np\nimport random\nimport minimax as ai\nimport gui\n\nclass Grid():\n def __init__(self):\n self.grid = np.full((3,3), None)\n\n def update(self, x, y, symbol):\n if(self.grid[x][y] == None):\n self.grid[x][y] = symbol\n return True\n else:\n ... | [
[
"numpy.full"
]
] |
martin220485/vehicle_counting_tensorflow | [
"571a10fb0ba14a63c7e236b4c7d47db7bd20f09d"
] | [
"vehicle_detection_main.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# ----------------------------------------------\n# --- Author : Ahmet Ozlu\n# --- Mail : ahmetozlu93@gmail.com\n# --- Date : 27th January 2018\n# ----------------------------------------------\n\n# Imports\nimport numpy as np\nimport os\nimpo... | [
[
"tensorflow.Graph",
"tensorflow.import_graph_def",
"numpy.expand_dims",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"tensorflow.Session",
"tensorflow.GraphDef"
]
] |
hongtao12310/FfDL | [
"5ab24e49878601d93031ae3bf24e3f19e430fdea"
] | [
"etc/examples/tf-model/convolutional_network.py"
] | [
"'''\nA Convolutional Network implementation example using TensorFlow library.\nThis example is using the MNIST database of handwritten digits\n(http://yann.lecun.com/exdb/mnist/)\n\nAuthor: Aymeric Damien\nProject: https://github.com/aymericdamien/TensorFlow-Examples/\n'''\n\nimport tensorflow as tf\nimport input_... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.nn.max_pool",
"tensorflow.cast",
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.conv2d",
"tensorflow.Session",
"tensorflow.argmax",
"tensorflow.nn.dropout",
"tensorflow.matmul",
"tensorflow.saved_model.builder... |
KedoKudo/daxm_analyzer | [
"e2944acdbddef356c8b1bbca327f83d46631f115"
] | [
"voxel.py"
] | [
"#!/usr/bin/env python\n\nfrom __future__ import print_function\nimport h5py\nimport numpy as np\nimport sys\nfrom daxmexplorer.vecmath import normalize\nfrom daxmexplorer.cxtallite import OrientationMatrix\n\nclass DAXMvoxel(object):\n \"\"\"\n DAXM voxel stores the crystallograhic information derived from D... | [
[
"numpy.dot",
"numpy.argmin",
"numpy.cross",
"numpy.square",
"numpy.arange",
"numpy.eye",
"numpy.sin",
"numpy.copy",
"numpy.column_stack",
"numpy.zeros",
"numpy.log",
"numpy.random.choice",
"numpy.linalg.inv",
"numpy.delete",
"numpy.array",
"numpy.ran... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.